> We are using the SGI cross-compiler developed by Tor to compile our
> linux source tree. We wrote a disassembler to look at the information
> in the header. We have two problems which we hope someone can help us
> 1) The magic number we read out is 263. The numbers that seem to be
> valid are 407, 410, 413, 314 for OMAGIC, NMAGIC, ZMAGIC and QMAGIC,
> respectively. We can't use standard tools like dis and gdb on this
> binary so we were wondering what is wrong with our magic number.
263 decimal == 407 octal :-)
> 2) We read the header into a struct called kexec, just like the a.out
> loader. In our struct, kexec.a_entry is 0x0. If we read the value
> associated with "kernel_entry" out of the symbol table it is 0x01a4.
> Should these be the same or does milo use this field?
For all normal a.out executables a_entry is the virtual loadaddress
AND the entry point into the kernel. The Linux/MIPS a.out format
bootfiles have their execption handlers at the start of the code, so
this wouldn't work. That's why the value of the kernel_entry symbol
is used instead.
> We should note, to get the binary to compile to big-endian format with
> the SGI complier we had to make two changes:
> - in /usr/local/mips-linux/ldscripts we had to change the
> mipslinux.x* files so the output format was "a.out-mips-big-linux"
> - we changed the make file so that ld used the option
> -oformat a.out-mips-big-linux
> because ld was still generating little endian after we made the first
Ok, this is a bug. There should be linker scripts for mipslinux.x*
and mipsellinux.x*. Always thought noone'd notice :-)