I am extending the higher half tutorial found here: https://wiki.osdev.org/Multiboot_1_High ... Bare_Bones
I have added a page table (page_table_000) which debug seems to show looks ok:
The identity mapping looks ok to me.(gdb) x/256xw &page_table_000
0xc010f000: 0x00000003 0x00001003 0x00002003 0x00003003
0xc010f010: 0x00004003 0x00005003 0x00006003 0x00007003
0xc010f020: 0x00008003 0x00009003 0x0000a003 0x0000b003
0xc010f030: 0x0000c003 0x0000d003 0x0000e003 0x0000f003
0xc010f040: 0x00010003 0x00011003 0x00012003 0x00013003
0xc010f050: 0x00014003 0x00015003 0x00016003 0x00017003
0xc010f060: 0x00018003 0x00019003 0x0001a003 0x0001b003
0xc010f070: 0x0001c003 0x0001d003 0x0001e003 0x0001f003
0xc010f080: 0x00020003 0x00021003 0x00022003 0x00023003
...
Once I no longer need the identity mapping to get to my kernel (I'm using the 0xC... addresses) and the tutorial wants to remove the first meg identity mapping. I try to replace the first meg with my mapping:
The addresses look good to me:_start2:
# At this point, paging is fully set up and enabled.
# Unmap the identity mapping as it is now unnecessary.
# replace with the identity mapping for the first meg
movl $(page_table_000 + 0x003), page_directory + 0
# Reload crc3 to force a TLB flush so the changes to take effect.
movl %cr3, %ecx
movl %ecx, %cr3
so I think when I get past the movl %ecx, %cr3 above I should now be able to view an address in the 1st meg.(gdb) p/x &page_table_000
$12 = 0xc010f000
(gdb) p/x (long)page_directory
$13 = 0xc010f003
But when I try I get:
I'm hoping I'm doing something obviously wrong. If not, how would you proceed in debugging this?(gdb) p/x *0x9500
Cannot access memory at address 0x9500
TD
