Assumptions: For the sake of simplicity I am assuming the following aspects of machine and Kernel.
1. I am assuming a 32 bit Intel CPU and the machine has physical memory of 16 MBs
2. Kernel size is less than 1 MB.
3. Grub is used as boot loader.
4. I am assuming following memory model.
Code: Select all
----------------> 0x1000000 = 16 MB
| |
| |
| Remaining |
| 14 MBs |
| |
| |
| |
----------------> 0x200000 = 2MB = Start of Page directory
| |
----------------> End of Kernel
| Kernel |
| of |
| size < 1MB |
| |
----------------> 0x100000 = 1MB = Start of Kernel
| BIOS |
| Video |
| & |
| others |
----------------> 0x0000000
1. Is my assumption about the memory correct? Meaning is this how it is lay'ed out in real OSes
2. While enabling paging how do I determine how many page directories and eventually how many page frames do I need?
3. Is it correct to assume that remaining 14 MBs will/can all be allocated to page frames, page tables and directory?
4. Where do we create GDT and LDT? Is it inside the kernel itself, meaning inside the memory that I have marked as start and end of kernel?
5. Who creates the segment selectors? Are these created by compilers / assemblers?
It would be really helpful for me to understand the design theory so thanks in advance for taking the time to answer these.
Thanks!