Bonfra wrote:
Whenever I enable paging and protected mode updating the content of CR0, VirtualBox throws what it calls "a critical error"... I've tried to locate something useful in the log file but I couldn't find anything so I'm
posing it here.
According to your log file, it's getting a bit further than that before it triple faults.
Code:
00:00:10.286852 rip=000000000010c44f
That address (0x10c44f) should be somewhere inside your kernel binary. I'm not sure exactly where because I don't have a copy of your kernel binary.
Code:
00:00:10.286856 cr0=0000000080000013
CR0 has PG and PE set, so there weren't any issues setting those bits.
Code:
00:00:10.286905 EFER =0000000000000500
EFER says you're definitely in long mode.
Code:
00:00:10.286953 CPUM0: 0010:000000000010c44f 88 10 mov byte [rax], dl
The log says this MOV is the cause of the triple fault. There aren't many ways for a MOV instruction to fault, it's either a non-canonical address or a page fault.
Code:
00:00:10.286848 rax=000000000052c000
That looks like a canonical address to me. It's probably a page fault.
sj95126 wrote:
This pattern (data cpl0, code cpl0, data cpl3, code cpl3) matches your 64-bit GDT but apparently it thinks you've set 16-bit segments.
I think it's just displaying them wrong. It shows the appropriate bits are set to put the CPU in 64-bit mode.