Memory management in microkernel with modules from grub

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Memory management in microkernel with modules from grub

Post by iammisc »

Hi!

I have a secondary boot loader which sets up a gdt, basic idt, and paging. It then loads my kernel from the grub modules and jumps to 0xC0000000(where it mapped my real kernel to). But once in that kernel, I need to allocate pages to user-space apps. The problem is that i need to allocate a page table for my index for my allocator, index the pages, and then i also have to make sure i mark pages with modules in it as used. If you have any ideas on how to do this please please post them here. I am really puzzled about this issue.

Thanks.
Otter
Member
Member
Posts: 75
Joined: Sun Dec 31, 2006 11:56 am
Location: Germany

Post by Otter »

Your bootloader should map everything to kernel space what is needed, at least the page directory and some space for page tables ( the simplest idea is to reserve 4 mb for page tables, but of course you could use less. You simply have to make sure that you have at least access to one unused page table so you can (at least) temporally map physical space to virtual space ).

You have to decide how you use your virtual and physcial space. If your allocator needs some space for itself, you have to reserve some pages for it before you use your allocator
Post Reply