From 912b5df8aef99aa00848d2a87bb5e5cebc7ff6b2 Mon Sep 17 00:00:00 2001 From: s-ol Date: Tue, 6 Jul 2021 12:03:57 +0200 Subject: fix and finish new pipeline --- elf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'elf.py') diff --git a/elf.py b/elf.py index 0db1138..776dd91 100755 --- a/elf.py +++ b/elf.py @@ -6,7 +6,7 @@ import subv Takes a packed & surveyed hex stream (with section headers) and packs it into a simulatable ELF file that can be run as a kernel: - qemu-system-riscv32 -nographic -machine sifive_u -nographic -kernel out.elf + qemu-system-riscv32 -nographic -machine sifive_u -bios none -kernel out.elf sifive-u has lots of memory mapped peripherals, see https://github.com/qemu/qemu/blob/master/hw/riscv/sifive_u.c#L66-L83 @@ -71,9 +71,9 @@ def write_program_header(segment, c, start): flags = 5 if segment["name"] == "code" else 6 if offset % align != start % align: - print("{:02x} {:02x}".format(offset, offset % align)) - print("{:02x} {:02x}".format(start, start % align)) - raise ValueError("improper alignment") + extra = "\n{:02x} {:02x}".format(offset, offset % align) + extra += "\n{:02x} {:02x}".format(start, start % align) + raise ValueError("improper alignment:" + extra) c += wi(0x1, 4) # p_type c += wi(offset, 4) # p_offset -- cgit v1.2.3