When I try my boot + kernel with bochs I get the message:
write_virtual_checks(): write beyond limit, r/w ED
>>PANIC<< exception(): 3rd (13) exception with no result
The Status is:
protected mode
CS.d_b = 32 bit
SS.d_b = 32 bit
| EAX=00000008 EBX=00000007 ECX=00000002 EDX=00000000
| ESP=00007ffe EBP=00000000 ESI=00007cc5 EDI=0000ffe4
| IOPL=0 NV UP DI PL NZ NA PE NC
| SEG selector base limit G D
| SEG sltr(index|ti|rpl) base limit G D
| DS:0008( 0001| 0| 0) 00000000 0000ffff 1 1
| ES:0008( 0001| 0| 0) 00000000 0000ffff 1 1
| FS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
| GS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
| SS:0008( 0001| 0| 0) 00000000 0000ffff 1 1
| CS:0010( 0002| 0| 0) 00000000 0000ffff 1 1
| EIP=00001000 (00001000)
| CR0=0x60000011 CR1=0x00000000 CR2=0x00000000
| CR3=0x00000000 CR4=0x00000000
restoring default signal behavior
quit_sim called with exit code 1
My GDT is:
Code: Select all
gdt:
; null descriptor
dw 0 ; limit 15:0
dw 0 ; base 15:0
db 0 ; base 23:16
db 0 ; type
db 0 ; limit 19:16, flags
db 0 ; base 31:24
; data descriptor
DATA_SEL equ $-gdt
dw 0xFFFF ; limit 15:0
dw 0x00 ; base 15:0
db 0x00 ; base 23:16
db 0x97 ; access byte: present, ring0, code/data segment, non-executable, conforming, writeable, accessed
db 0xC0 ; flags: Granularity, 32-bit
db 0x00 ; base 31:24
; code descriptor
CODE_SEL equ $-gdt
dw 0xFFFF ; limit 15:0
dw 0x00 ; base 15:0
db 0x00 ; base 23:16
db 0x9B ; access byte: present, ring0, code/data segment, executable, non-conforming, readable, accessed
db 0xC0 ; flags: Granularity, 32-bit
db 0x00 ; base 31:24
gdt_end:
gdt_desc:
dw gdt_end - gdt - 1 ; GDT limit
dd gdt ; linear address of GDT
my enter_pmode function is:
Code: Select all
enter_pmode:
cli
lgdt [gdt_desc]
mov eax, cr0 ; enable pmode
or eax, 1
mov cr0, eax
mov eax, DATA_SEL
mov ds, eax
mov es, eax
mov ss, eax
jmp CODE_SEL:0x1000 ; 0x1000 is where the kernel is load