Unreal mode triggering exception?
Posted: Sun Jul 03, 2005 12:58 pm
When I try to get into unreal mode, bochs returns this error
load_seg_reg(): not data or readable code
exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
and it reboots. Apparently it's a segment overrun? Here's the offending code:
load_seg_reg(): not data or readable code
exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
and it reboots. Apparently it's a segment overrun? Here's the offending code:
Code: Select all
; Move to unreal mode
cli
mov al,0xD1 ; Turn on A20 line
out 0x64,al
mov al,0x03
out 0x60,al
push ds ; Save real mode data segment
lgdt [GDT] ; Load GDT
mov eax,cr0 ; Jump to protected mode
inc ax
mov cr0,eax
mov bx,0x08 ; Select the first descriptor in GDT
mov ds,bx
dec ax ; Get back to real mode
mov cr0,eax
pop ds
sti
GDT:
dw .point
dd GDT
dw 0
.cseg: dd 0x0000FFFF,0x00CF9800
.dseg: dd 0x0000FFFF,0x00CF9200
.cs16: dd 0x0000FFFF,0x00009800
.ds16: dd 0x0000FFFF,0x00009200
.point: gdt_limit equ $-GDT-1