Reset in protected mode
Posted: Fri Sep 25, 2009 6:48 am
I enter the protected mode successfully and make a jmp but at an instruction occurs pop es after which triple fault occurs the errors are
The code I use is
buffer is where i have read sector from disk. After the jump to buffer it resets at instruction pop es. What should I do?
Code: Select all
00015087615e[CPU0 ] fetch_raw_descriptor: GDT: index (5ef)bd > limit (17)
00015087615e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x
0d)
00015087615e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x
08)
00015087615i[CPU0 ] CPU is in protected mode (active)
00015087615i[CPU0 ] CS.d_b = 32 bit
00015087615i[CPU0 ] SS.d_b = 32 bit
00015087615i[CPU0 ] EFER = 0x00000000
00015087615i[CPU0 ] | RAX=0000000060000008 RBX=0000000000007e00
00015087615i[CPU0 ] | RCX=0000000000000002 RDX=0000000000000000
00015087615i[CPU0 ] | RSP=0000000000007c00 RBP=0000000000000000
00015087615i[CPU0 ] | RSI=00000000000e7e00 RDI=000000000000ffac
00015087615i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00015087615i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00015087615i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00015087615i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00015087615i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf AF pf CF
00015087615i[CPU0 ] | SEG selector base limit G D
00015087615i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00015087615i[CPU0 ] | CS:0010( 0002| 0| 0) 00000000 f0000fff 1 1
00015087615i[CPU0 ] | DS:0008( 0001| 0| 0) 00000000 f0000fff 1 1
00015087615i[CPU0 ] | SS:0008( 0001| 0| 0) 00000000 f0000fff 1 1
00015087615i[CPU0 ] | ES:0008( 0001| 0| 0) 00000000 f0000fff 1 1
00015087615i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015087615i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015087615i[CPU0 ] | MSR_FS_BASE:0000000000000000
00015087615i[CPU0 ] | MSR_GS_BASE:0000000000000000
00015087615i[CPU0 ] | RIP=0000000000007e4c (0000000000007e4c)
00015087615i[CPU0 ] | CR0=0x60000011 CR2=0x0000000000000000
00015087615i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
(0).[15087615] [0x00007e4c] 0010:0000000000007e4c (unk. ctxt): pop es
; 07
00015087615e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown
status is 00h, resetting
Code: Select all
cli
lgdt [gdtr]
mov eax, cr0
or al,0x1
mov cr0,eax
jmp 0x10: protected
[BITS 32]
protected:
mov ax,0x08
mov ds,ax
mov es,ax
mov ss,ax
mov esp,0x7C00
jmp buffer
[BITS 16]
gdt: dw 0x0000, 0x0000, 0x0000, 0x0000
sys_data: dw 0xFFFF, 0x0000, 0x9200, 0x00CF
sys_code: dw 0xFFFF, 0x0000, 0x9800, 0x00CF
gdt_end:
gdtr: dw gdt_end - gdt - 1
dd gdt
TIMES 510 - ($ - $$) db 0
DW 0xAA55
buffer:
buffer is where i have read sector from disk. After the jump to buffer it resets at instruction pop es. What should I do?