iansjack wrote:
Rather than blindly following a tutorial you should think about what you are doing. For most purposes I think the default 4KB page size is the best choice.
What advantage do you see in larger pages?
I tried, but when I tried to fill the BootPageDirectory
Code:
BootPageDirectory:
.int 0x00000083
.fill KERNEL_PAGE_NUMBER - 1, 4, 0
.int 0x00000083
.fill 0x400 - KERNEL_PAGE_NUMBER - 1, 4, 0
I couldn't understand how to do it. So I left how it was with 4MB pages...
sortie wrote:
You need to be careful not to consider the kernel itself unused memory.
There's an extra danger here: The multiboot structures, where your memory map is stored, is also somewhere in unused memory (somewhere else than your kernel, GRUB does do that). You need to check every page for whether it overlaps with any of the multiboot structures that you use (remember, there's a bunch of pointers in there).
So I have to verify if the page isn't between those flags-like that I set in the linker (e. g. . = start at the beginning plus . = end at the bottom) and between mmap->mmap_addr and mmap->mmap_addr + mmap_length too?
sortie wrote:
When you initialize paging, you may be tempted to use some hard-coded physical addresses for that, but you can't do that. GRUB might put its information there. Instead you should make 4096 byte sized variables with 4096 byte alignment in your code. Then you can use those pages, as GRUB will know to avoid your variables (using your ELF program headers).
I think it's used in the higher half tutorial while doing that type of definition I put above... right?