is CR3 physical,linear or virtual ?
Posted: Sun Apr 23, 2017 4:36 pm
I'm trying to use paging and i hit a road block.
im trying to load the page directory into CR3 but it tripple faults even tho i am 99% sure that the directory and the tables are correct
Here is my problem:
after loading the second stage i do following things:
Identity page 0x0 - 0x400000 (because it fills a whole table)
Map 0x100000 to 0xC0000000 (im doing higher half kernel)
set cr3 to the page directory
enable paging
load kernel into 0xc0100000 and put stack at 0xc00FFFFF
execute kernel:
kernel creates page tables and page directories (Identity page 0x0 - 0x100000 and map 0x100000 to 0xC0000000)
kernel sets cr3 to new page directory address
Tripple fault
now lets say the directory is stored at 0xc0200000 (physical address 0x300000)
do i have to set cr3 to 0xc0200000 or 0x300000 ?(i have gdt mapped from 0x0 to 0xFFFFFFFF so linear = physical)
and i didnt have problems in the second stage bootloader because its Identity maped and virtual would equal to physical
Sry for bad english it is not my first language.
im trying to load the page directory into CR3 but it tripple faults even tho i am 99% sure that the directory and the tables are correct
Here is my problem:
after loading the second stage i do following things:
Identity page 0x0 - 0x400000 (because it fills a whole table)
Map 0x100000 to 0xC0000000 (im doing higher half kernel)
set cr3 to the page directory
enable paging
load kernel into 0xc0100000 and put stack at 0xc00FFFFF
execute kernel:
kernel creates page tables and page directories (Identity page 0x0 - 0x100000 and map 0x100000 to 0xC0000000)
kernel sets cr3 to new page directory address
Tripple fault
now lets say the directory is stored at 0xc0200000 (physical address 0x300000)
do i have to set cr3 to 0xc0200000 or 0x300000 ?(i have gdt mapped from 0x0 to 0xFFFFFFFF so linear = physical)
and i didnt have problems in the second stage bootloader because its Identity maped and virtual would equal to physical
Sry for bad english it is not my first language.