Currently I am trying to identity map my kernel and I ran into a problem. How do I fit 32 bits inside 20 bits? I don't understand how is that possible, since a page frame is only 20 bits wide. I am not using any tutorials or anything similar, trying to do this on my own. I have a page directory structure that points to 1024 page tables that have 1024 pages themselves. My "page" structure is the same as described in Intel Manuals.
Relevant code:
Code: Select all
//current_address -> range from 0 to 0x10E000
page_directory->page_tables[current_address / 1024]->pages[current_address % 1024].frame_address = current_address;
Code: Select all
(frame_address, current_address) -> they should be equals since: .frame_address = current_address
0x0 0x0
0x1000 0x1000
0x2000 0x2000
0x3000 0x3000
0x4000 0x4000
0x5000 0x5000
...snip...
0xE000 0xE000
0xF000 0xF000
0x0 0x10000
0x11000 0x11000
0x12000 0x12000