Code: Select all
//our first page table comes right after the page directory
unsigned int *first_page_table = page_directory + 0x1000;
So, as 0x1000 = 4096, in fact it will advance in memory by 0x1000 * 4 = 4096 * 4 = 16384.
But we need to advance only by 4096 bytes (0x400 in hex) becauses the next page table is in 4096 bytes.
So the correct line should be:
Code: Select all
//our first page table comes right after the page directory (4096 bytes offset),
unsigned int *first_page_table = page_directory + 1024;