Velko wrote:
Regarding GRUB-provided memory map, I would say that it should be preferred method, unless there's a special need. You could check out Multiboot2, however.
I'm using multiboot2 header, so i suppose i just need to read data throught it i suppose.
Velko wrote:
Regarding PMM bitmap: yes, each bit will represent 2 MiB of memory. The best approach, however, would be to support both page sizes. It might get a bit tricky (especially on de-allocations), but you can maintain 2 bitmaps, one for each size.
Yeah i was thinking of making a mechanism of supporting both 4kb and 2mb pages. I was thinking of providing probably few Macros to do the computation that they will be expanded depending on the size selected by the user (that should be tricky but hopefully doable)
Velko wrote:
Personally I find 2 MiB pages too large for efficient use, but it's your OS and your preferences.
I stumbled across a post in the forum where someone did a proper computation and showed up that using the 2mb pages approach was wasting a lot of resources, said that at the moment i haven't chosen clearly what page size to use (luckily my code base is still pretty small and the change is going to be minimal), i used 2mb just because i was following a tutorial to boot a kernel in 64bit mode and it was using 2mb pages. but as said above i'm thinking of trying to support both, so that should not be an issue.
Velko wrote:
Recursive paging works just fine in Long Mode. About the choice of entry #, I don't think there are any conventions, but I did exactly the opposite - used 256th entry. This way it is easy to find out addressed area by just looking at the pointer. Paging is one of the most trickiest parts of OS, so you may want to have as many debugging clues as possible.
If i understood correctly you placed it halfway in the pagedir? Why it should be easiest at 256th instead of any other postion?
Yeah i know, when i studied the paging address translation and the recursion method, it took me long time to understand it!!!
And everytime i still have to compute a entry for some reason manually i have to redo it 3/4 times because i always miscount some bit XD
Thanks for the info!