进入保护模式时VirtualBox Guru Meditation错误

时间:2014-07-04 18:57:47

标签: assembly x86 virtualbox

我使用VirtualBox来模拟x86 pc。我写了一个进入保护模式的bootloader。但我总是得到一个Guru Meditation错误。这是我的代码:

; clear interrupts
cli
; set up gdt
xor eax, eax
mov ax, ds
shl eax, 4
add eax, gdt
mov [gdtr + 2], eax
mov eax, gdt_end
sub eax, gdt
mov [gdtr], ax
lgdt [gdtr]
; enter protected mode
mov eax, cr0
or  al, 1
mov cr0, eax
; enter kernel
jmp 08h:0

我也测试了jmp 0x2000:0000,但这也没有用。我做错了什么?

PS:这是我的GDT代码:

; global descriptor table
gdt:
dq 0 ; null descriptor

; code descriptor kernel
dw 0x0000 ; base low word
dw 0x4000 ; limit low word
db 0x00   ; base high byte
db 0x40   ; flags
db 0x9A   ; access byte
db 0x02   ; base center byte

; data descriptor kernel
dw 0x0000 ; base low word
dw 0x4000 ; limit low word
db 0x00   ; base high byte
db 0x40   ; flags
db 0x92   ; access byte
db 0x02   ; base center byte
gdt_end:

2 个答案:

答案 0 :(得分:0)

根据我对CentOS-6.5 Guru Meditation error 的经验,当您的应用程序需要更多ram大小时,则分配ram大小或CPU使用率超过100%。 因此,增加分配的RAM大小是问题的解决方案之一

答案 1 :(得分:0)

关闭所有正在运行的虚拟机,然后从BIOS禁用虚拟化。然后重启。然后从BIOS启用虚拟化。重启。 对我有用