On Mar 27, 2008, at 23:34 , Tim Rightnour wrote:
On 24-Mar-2008 Julio M. Merino Vidal wrote:I am trying to add Multiboot support to amd64 kernels. The first step in doing so is adding the Multiboot header at the beginning of the file (within the first 8KB of the _file_). Unfortunately, adding that as the very first thing in the entry point at locore.S does not have the desired effect.I had this exact problem on the ofppc version of ofwboot. Take a look at the ofwstart.S file there to see how I worked around it. Also note, that I used asecond trick to add the same section again later using the ldscript.
Hmm, I don't see what the trick is in ofwstart.S. Could you clarify, please?
Also, in the ldscript, I notice that you generated it using the -N flag. If I use this same flag to create the amd64 kernel, then the text section is properly positioned at the beginning of the file. However, I have made ld dump the default linker script and the one used when -N is given, diffed the two scripts, and the differences are minimal: i.e. I can't see anything that justifies the huge difference in the location of .text in the resulting image :-( Do you know what exactly you used to make it work? I assume that -N is not OK for kernels due to its explanation.
Thanks.