My kernel runs normally in qemu,but double fault in bochs.
Posted: Sat May 26, 2012 6:02 pm
My kernel crashes when it executes the first page fault executes.
And my page fault handler looks like this:
In gdb when the crashed at "pushl 48(%esi)".
Here is what the bochs log said:
00013164299i[BIOS ] Booting from 0000:7c00
00021758146i[BIOS ] int13_harddisk: function 41, unmapped device for ELDL=80
00021762944i[BIOS ] int13_harddisk: function 08, unmapped device for ELDL=80
00021767594i[BIOS ] *** int 15h function AX=00c0, BX=0000 not yet supported!00024800000i[XGUI ] charmap update. Font Height is 16
00027200000i[XGUI ] charmap update. Font Height is 16
00047080538e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00072892000i[ ] cpu loop quit, shutting down simulator
00072892000i[CPU0 ] CPU is in protected mode (active)
00072892000i[CPU0 ] CS.mode = 32 bit
00072892000i[CPU0 ] SS.mode = 32 bit
00072892000i[CPU0 ] | EAX=00000018 EBX=1badd00d ECX=00000000 EDX=0000001c
00072892000i[CPU0 ] | ESP=0013a9b8 EBP=0013b15c ESI=0022fed4 EDI=0002a1b1
00072892000i[CPU0 ] | IOPL=3 id vip vif ac vm rf nt of df if tf SF zf AF PF CF
00072892000i[CPU0 ] | SEG selector base limit G D
00072892000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00072892000i[CPU0 ] | CS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | DS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | SS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | ES:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | FS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | GS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | EIP=001009cd (001009cd)
00072892000i[CPU0 ] | CR0=0xe0000011 CR2=0x010000f0
00072892000i[CPU0 ] | CR3=0x00230000 CR4=0x00000000
00072892000i[CPU0 ] 0x001009cd>> jmp .-2 (0x001009cd) : EBFE
00072892000i[CMOS ] Last time is 1338049180 (Sat May 26 09:19:40 2012)
00072892000i[XGUI ] Exit
I don't know the reason.
And my page fault handler looks like this:
Code: Select all
asm_page_error_wrapper:
PUSHA
movl %esp, %esi
pushl 48(%esi)/*esp,pusha has already been calculated*/
pushl 32(%esi)/*error*/
CALL page_error_interrupt
popl %ecx
popl %ecx
POPA
addl $4, %esp
IRET
Here is what the bochs log said:
00013164299i[BIOS ] Booting from 0000:7c00
00021758146i[BIOS ] int13_harddisk: function 41, unmapped device for ELDL=80
00021762944i[BIOS ] int13_harddisk: function 08, unmapped device for ELDL=80
00021767594i[BIOS ] *** int 15h function AX=00c0, BX=0000 not yet supported!00024800000i[XGUI ] charmap update. Font Height is 16
00027200000i[XGUI ] charmap update. Font Height is 16
00047080538e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00072892000i[ ] cpu loop quit, shutting down simulator
00072892000i[CPU0 ] CPU is in protected mode (active)
00072892000i[CPU0 ] CS.mode = 32 bit
00072892000i[CPU0 ] SS.mode = 32 bit
00072892000i[CPU0 ] | EAX=00000018 EBX=1badd00d ECX=00000000 EDX=0000001c
00072892000i[CPU0 ] | ESP=0013a9b8 EBP=0013b15c ESI=0022fed4 EDI=0002a1b1
00072892000i[CPU0 ] | IOPL=3 id vip vif ac vm rf nt of df if tf SF zf AF PF CF
00072892000i[CPU0 ] | SEG selector base limit G D
00072892000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00072892000i[CPU0 ] | CS:0010( 0002| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | DS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | SS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | ES:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | FS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | GS:0018( 0003| 0| 0) 00000000 ffffffff 1 1
00072892000i[CPU0 ] | EIP=001009cd (001009cd)
00072892000i[CPU0 ] | CR0=0xe0000011 CR2=0x010000f0
00072892000i[CPU0 ] | CR3=0x00230000 CR4=0x00000000
00072892000i[CPU0 ] 0x001009cd>> jmp .-2 (0x001009cd) : EBFE
00072892000i[CMOS ] Last time is 1338049180 (Sat May 26 09:19:40 2012)
00072892000i[XGUI ] Exit
I don't know the reason.