On Thursday 19 July 2007 21:59, Marc Jones wrote: > Marc Jones wrote: > > This patch gets Geode LX into initram. It also cleans up some of the > > generic stage0 and stage1 code for getting through CAR and initram. > > > > At this point I need some help. We get into initram but I think that > > there is a link problem where the first function call to post_code() is > > past the beginning of the ROM. > > > > I see the following: > > lar finds normal/initram at 0xFFFC4B20 > > The call to 0xFFFC4B20 works and we are executing initram. > > The call to post_code() is to 0xFFF427d4 <--- BAD! > > > > Also, There aren't any map files being generated. I think that they > > would be helpful in debugging stuff like this. Any volunteers better at > > makefiles than I am? > > Looking at the map file initram knows where post_code() should be but is > different from where the code calls. > initram.map: > 00080000 T main > ... > ffffdcb4 A post_code > ... > > I have dumped the code at ffffdcb4 and it is post_code(). > > I think that the linker knows where the stage0 code is supposed to be > but it is linking to it with relative addresses instead of absolute???
Using relative addresses is all right, as long ffffdcb4 == runtime address == link address for stage 0 and 00080000 == runtime address == link address for initram. > It needs to link relative to initram functions and absolute to stage0. The compiler generates the opcodes. The linker only fills in the addresses or offsets. If the Compiler generates a relative jump/call the linker cannot change it (as far as I know). > Any one else have any thoughts? Initram should run at the address it was linked to. Juergen -- linuxbios mailing list linuxbios@linuxbios.org http://www.linuxbios.org/mailman/listinfo/linuxbios