The page enabling code really seems to go through without a hitch. Here's how things go:
Call the paging enable function:
Code: Select all
> step
(0) [0x0000001003ff] 0010:00000000001003ff (unk. ctxt): jmp .-644 (0x00100180) ; e97cfdffff
Move the address of the page directory into EAX:
Code: Select all
> step
(0) [0x000000100180] 0010:0000000000100180 (unk. ctxt): mov eax, dword ptr ds:0x00102000 ; a100201000
> reg
rax: 00000000_0ffef000
The value in RAX is correct, it's the same one that my kernel reports.
Copy the page directory address into CR3:
Code: Select all
> step
(0) [0x000000100185] 0010:0000000000100185 (unk. ctxt): mov cr3, eax ; 0f22d8
> creg
CR3=0x00000ffef000
Note that this information was actually from the CR* poll from
after the next call. I guess it takes longer to update...?
Copy CR0 to EAX:
Code: Select all
> step
(0) [0x000000100188] 0010:0000000000100188 (unk. ctxt): mov eax, cr0 ; 0f20c0
> reg
rax: 00000000_60000011
This one also took two steps to take effect, apparently.
Set the high bit:
Code: Select all
> step
(0) [0x00000010018b] 0010:000000000010018b (unk. ctxt): or eax, 0x80000000 ; 0d00000080
> reg
rax: 00000000_e0000011
Looks right to me.
Copy the correct value back into CR0:
Code: Select all
> step
(0) [0x000000100190] 0010:0000000000100190 (unk. ctxt): mov cr0, eax ; 0f22c0
> creg
CR0=0xe0000011: PG CD NW ac wp ne ET ts em mp PE
Houston, we have paging.
Then these two guys showed up:
Code: Select all
> step
(0) [0x00000feed193] 0010:0000000000100193 (unk. ctxt): add byte ptr ds:[eax+edx*2], 0xfc ; 800450fc
> step
(0).[101655341] [0x00000feed193] 0010:0000000000100193 (unk. ctxt): add byte ptr ds:[eax+edx*2], 0xfc ; 800450fc
And one more step brings me to
Code: Select all
> step
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
Continuing from here gives me a reboot. Any ideas?