Skip to content
Snippets Groups Projects
Commit 12a32b8b authored by Bernard Blackham's avatar Bernard Blackham
Browse files

A little sanity checker.

parent dc87be12
No related merge requests found
...@@ -36,9 +36,10 @@ LD = $(DEVC_PREFIX)ld ...@@ -36,9 +36,10 @@ LD = $(DEVC_PREFIX)ld
all: rom2.b rom2.elf rom2.s19 all: rom2.b rom2.elf rom2.s19
rom2.elf: $(OBJS) memory.x rom2.elf: $(OBJS) memory.x check-romsrc.pl
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBADD)
$(SIZE) $@ $(SIZE) $@
@perl -w check-romsrc.pl
clean: clean:
rm -f *.o *.elf *.s19 *.b *.a rom.tar.bz2 romsrc.s crctab.h m68hc11-gdb gencrctab rm -f *.o *.elf *.s19 *.b *.a rom.tar.bz2 romsrc.s crctab.h m68hc11-gdb gencrctab
......
#!/usr/bin/perl -w
# looking for a line like:
# 00009800 g .rodata 00000000 _rom_src_data
open(OD, "m68hc11-objdump -x rom2.elf|") or die "Could not open objdump of rom image!\n";
while (<OD>) {
if (/^([0-9a-fA-F]+).*_rom_src_data$/) { $origin = $1 }
}
close OD;
if (!defined $origin) {
print "WARNING!!! No bz2 data could be found in the ROM image!\n";
exit 1;
}
$origin = hex($origin);
open(PL, "src2asm.pl") or die "Could not open src2asm.pl\n";
while (<PL>) {
if (/^\$origin = 0x([0-9a-fA-F]+);$/) { $pl_origin = $1 }
}
close PL;
if (!defined $pl_origin) {
print "WARNING!!! Couldn't find origin in src2asm.pl!\n";
exit 2;
}
$pl_origin = hex($pl_origin);
if ($pl_origin != $origin) {
printf "WARNING!!! The origin of the bz2 data is now 0x%04x. This needs to\n", $origin;
printf " be updated in src2asm.pl (which currently says 0x%04x).\n", $pl_origin;
exit 3;
}
printf "Origin of bz2 data is 0x%04x and correct.\n", $origin;
#!/usr/bin/perl -w #!/usr/bin/perl -w
$origin = 0x9800; # must match address of .romsrc in memory.x # keep the format of this next line the same to match regex in check-romsrc.pl
$origin = 0x9800;
$hole_start = 0xb600; $hole_start = 0xb600;
$hole_size = 0x0200; $hole_size = 0x0200;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment