All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
I just finished a rough draft of a tutorial on how to compile and link a 64-bit kernel. It covers compilation, linking (as a higher-half elf64), and three different ways of loading the kernel (including how to include a 32-bit bootstrap into an elf64 executable).
Hope this reduces the number of people who have trouble with x86-64 kernels, like relocation issues and loading.
As you know, I had many issues while trying to do this, and you've covered them, which is fantastic. If only you'd written it earlier, it would have saved me a lot of time
I might have to go back and add to my 32-bit kernel stub, so that it can read the GRUB2 multiboot information tags, because at the moment I've got no support for that... just for the old structure.
Sorry to ressurect the thread, but I ran across this thread that describes how opensolaris loads a 64-bit elf into grub. If I'm understanding correctly, they set bit 16 in the multiboot flags, which forces grub to look at the header address fields specified in the multiboot header rather than parse out the elf. So they set all the address info at link time and then give grub physical start/end and entry addresses themselves.
Thoughts? Perhaps something to add to the wiki? (I haven't been approved for editing yet, otherwise I'd love to help.)[/url]
I'm going to try and test this when I get home from work this afternoon.
This is what I do on my 64-bit port, works nicely. Doesn't require any special patches to GRUB so it's easy to implement. I have the following in my multiboot header:
Cool, works for me as well. Interestingly enough, NASM & ld balked when I tried to extern the _start _edata and _end symbols (relocation truncated error), but gas has no problems. Looks like I'm switching assemblers.
Could those with edit permissions add this to the wiki entry?
wiki wrote:Enter Protected Mode (or skip this step and enter long mode directly)
I don't think that that should point on the forum. Perhaps the forum thread should be in the See also section or smth like that and your link should point here.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
vinaychandra wrote:Could you please provide the links for the code of elf.c and elf.h used in the option of using a separate loader for creating the 64 bit kernel?