Questions about paging
Posted: Wed Feb 13, 2008 12:18 pm
Hi everyone!
I'm making a minimal OS in C, based in James M. and Brandon F. tutorials.
I want to add paging to it, so I got some questions.
As far as I know, paging is another way of accessing memory which provides memory protection and virtual address, Am I wrong?
If I want to enable it I'll do the following:
Thanks,
Gonzalo
I'm making a minimal OS in C, based in James M. and Brandon F. tutorials.
I want to add paging to it, so I got some questions.
As far as I know, paging is another way of accessing memory which provides memory protection and virtual address, Am I wrong?
If I want to enable it I'll do the following:
- Load my kernel in a direction which can be divided by 4096
- Add padding to all kernel with Align(4096) in the linker file in each section
- Make a symbol at the end so I know where can I start allocating memory
- Alloc page_directory and page_table aligned at 4K
- Set all kernel pages to be read and writeable by the kernel but not user
- Make kernel virtual address the same linear address
- Set video framebuffer page/s read and write only by kernel
- Add a Page fault handler at interrupt 14
- Send the linear address of page_directory to CR3
- Set on the paging bit in CR0
Thanks,
Gonzalo