I am using Grub instead of my own bootloader, I decided to drop it because it had some bugs on real hardware.
However, in the tutorial paging is enabled from the bootloader, and Grub doesn't enable paging. So my guess is that I have to do that in the loader (the asm code executed just before entering main, which sets up the stack, verifies the bootloader etc). And how can I do the jump to higher space (e.g. 0xC0000000), since the kernel is linked at 0x100000?
If this might help, I'm using Cygwin, I compiled gcc and binutils myself, and output format is i586-elf.
Enabling paging outside bootloader?
Moderator:Moderators
Re: Enabling paging outside bootloader?
Cant you edit a flag in your multiboot header to cause grub to initialise paging?
Otherwise, the alternative is to link your kernel to 0xC0000000 and have a short stub at the entry point which sets up identitiy paging, then jumps to main.
~Andrew
Otherwise, the alternative is to link your kernel to 0xC0000000 and have a short stub at the entry point which sets up identitiy paging, then jumps to main.
~Andrew

-
- Posts:22
- Joined:Sat Jul 17, 2010 7:55 am
Re: Enabling paging outside bootloader?
Thank you for your reply.Andyhhp wrote:Cant you edit a flag in your multiboot header to cause grub to initialise paging?
Otherwise, the alternative is to link your kernel to 0xC0000000 and have a short stub at the entry point which sets up identitiy paging, then jumps to main.
~Andrew
I'm not sure, I can't find info about flags anywhere. The only info I could find was that bit 0 is for 4k aligning, bit1 is for memory info, and bit 2 is for video info, and bit16 has to do with where the kernel is loaded. Nothing about the rest of the bits.
Could you give some more details about second method? Do I have to create an additional 'stage', to load and execute the kernel? Or how can I do something like that? Or create an additional section in the asm code, which will be linked at 0x100000, and all the other sections will be linked at 0xC000000?