No subject


Tue Jul 29 02:03:00 CEST 2008


i386 port ever worked. u-boot.lds sets up a real mode trampoline
at 0x000007c0 and some BIOS emulation at 0x0000 - 0x053e. The next
4-byte alignment (0x0540) is where __u_boot_cmd_start is supposed to
end up in memory. Going by u-boot.map, the load address of .bios is
0x3805214e - Add 0x540 gives 0x3805268e which is 0x1268e into
u-boot.bin which is exactly where I found found the command table.

BUT - The command table is never, as far as I can tell, copied into
RAM - .bios is by bios_setup () in /lib_i386/bios_setup.c

So, it looks like I could add:

	_i386boot__u_boot_cmd_start = LOADADDR(.u_boot_cmd);
and
	_i386boot__u_boot_cmd_size = SIZEOF(.u_boot_cmd);

and copy the command table into RAM at 0x0540 and all should be well.
At the same time, I could copy .text into RAM and adjust the target
addresses in the command table (I can grab this code from other
platforms)

QUESTIONS:
 - Where should I relocate to? I have 128MB to play with - should I
   relocate to the highest possible location in RAM and if so,
   should I change to setup of the stack, bss and data segments to
   be high in RAM as well? Is there any advantages, especially when
   loading the linux kernel, in locating U-Boot at any particular
   location in RAM?

 - Should I shuffle the link script a little to that the order of
   segments is .data, .got, .u_boot_cmd then .bss, .realmode and
   .bios and set:

	_i386boot_romdata_size = SIZEOF(.data) + SIZEOF(.got) + SIZEOF(.u_boot_cmd)

   This would have the advantage that I could use a single copy
   operation to copy .data, .got and .u_boot_cmd

 - Is the code in .text natively relocatable or do I need to do
   something (gcc or ld options) to make it relocatable?

Thanks for your patience

Regards,


Graeme

 


More information about the U-Boot mailing list