Code: Select all
mem info 1 in qemu(debug mode: info mem)
00000000-00111000 00111000 ur-
c0000000-c0400000 00400000 ur- //0x301 0x0
mem info 2 in qemu(debug mode: info mem)
00000000-00111000 00111000 ur-
c0000000-c0400000 00400000 ur-
c0401000-c0402000 00001000 -r- //0x301 0x1, where is the hole? <; i have debuged for 4 days, failed.
same in bochs:
cr3: 000000000010c000
0x00000000-0x00110fff -> 0x00000000-0x00110fff
0xc0000000-0xc03fffff -> 0x00111000-0x00510fff
0xc0401000-0xc0401fff -> 0x00000000-0x00000fff
0xc0404000-0xc0503fff -> 0x00511000-0x00610fff
Code: Select all
//page_directory_entry_index=0x301, for 0xC0400000
dir->tables[page_directory_entry_index]=(page_table_t*)kmalloc_aligned(sizeof(page_table_t), &tmp);
memset(dir->tables[page_directory_entry_index], 0, 1024); // fill 4096 bytes with 0
dir->tablesPhysical[page_directory_entry_index] = tmp | 0x7; //0x7=0b111
without 0xC0400000-0xC0401000, page-fault will come(cr2=0xC0400000) when i crossed the 4m boundary in test_case of expand.
And when i call get_page with address 0xC0400000+0x1000*i, all map info like that:
Code: Select all
00000000-00111000 00111000 ur-
c0000000-c0400000 00400000 ur-
c0401000-c0402000 00001000 -r-
c0404000-c0504000 00100000 ur-