My kernel runs normally in qemu,but double fault in bochs.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
venuswu
Posts: 2
Joined: Tue Jan 03, 2012 8:22 am

My kernel runs normally in qemu,but double fault in bochs.

Post by venuswu »

My kernel crashes when it executes the first page fault executes.
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
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.
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: My kernel runs normally in qemu,but double fault in boch

Post by gravaera »

Yo:
venuswu wrote:...

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

...

I don't know the reason.
Well, you've sort of gunned for the wrong cause: the int 15h message is caused by GrUB. The part that's relevant to your kernel is the other one I've highlighted.

--Happy debugging
gravaera
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Post Reply