Any interrupt causes my qemu VM to restart
Posted: Tue Feb 24, 2015 8:21 pm
Any interrupt I send to my OS causes qemu to reset the virtual machine. I've got gdt working and loaded the idt, and double checked it and everything looks good (as far as my noob self can tell). I've used qemu's debugging capabilities, and the only thing I see happening is It jump to some random location (0x0e05b, if that means anything) on each interrupt. I've got interrupts logged, (warning, wall of text.):
Unfortunately, It's not very clear to me at all what is happening here. I've tried to find the problem but I'm at my wits end. The next thing I've considered doing is taking a look at the qemu code base, but that's quite the rabbit hole and I'm pretty sure I just made some stupid mistake somewhere that I can't see. I've already looked at the related wiki pages, but nothing I've tried from there has fixed it.
Here is the source code for my os (quite a mess, I know. This Is just a attempt to get something sorta working the first time, then rewrite it all once I've learned from my mistakes.) Any help would be very much appreciated.
Code: Select all
SMM: enter
EAX=00000001 EBX=00000000 ECX=02000000 EDX=00000cfc
ESI=0000000b EDI=02000000 EBP=00000007 ESP=00006d74
EIP=000f16a1 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9b00 DPL=0 CS32 [-RA]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 000f6c58 00000037
IDT= 000f6c96 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=000f1190 CCD=00000001 CCO=LOGICB
EFER=0000000000000000
SMM: after RSM
EAX=00000001 EBX=00000000 ECX=02000000 EDX=00000cfc
ESI=0000000b EDI=02000000 EBP=00000007 ESP=00006d74
EIP=000f16a1 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
SS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 000f6c58 00000037
IDT= 000f6c96 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000000 CCD=ffffff9c CCO=EFLAGS
EFER=0000000000000000
0: v=02 e=0000 i=1 cpl=0 IP=0008:00100353 pc=00100353 SP=0010:00107038 env->regs[R_EAX]=00000001
EAX=00000001 EBX=00009500 ECX=00000021 EDX=00101031
ESI=00000000 EDI=00109000 EBP=00107038 ESP=00107038
EIP=00100353 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 00102000 00000800
IDT= 00102840 00000800
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000010 CCD=00107040 CCO=ADDL
EFER=0000000000000000
check_exception old: 0xffffffff new 0xd
1: v=0d e=0012 i=0 cpl=0 IP=0008:00100353 pc=00100353 SP=0010:00107038 env->regs[R_EAX]=00000001
EAX=00000001 EBX=00009500 ECX=00000021 EDX=00101031
ESI=00000000 EDI=00109000 EBP=00107038 ESP=00107038
EIP=00100353 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 00102000 00000800
IDT= 00102840 00000800
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000010 CCD=00107040 CCO=ADDL
EFER=0000000000000000
check_exception old: 0xd new 0xd
2: v=08 e=0000 i=0 cpl=0 IP=0008:00100353 pc=00100353 SP=0010:00107038 env->regs[R_EAX]=00000001
EAX=00000001 EBX=00009500 ECX=00000021 EDX=00101031
ESI=00000000 EDI=00109000 EBP=00107038 ESP=00107038
EIP=00100353 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 00102000 00000800
IDT= 00102840 00000800
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000010 CCD=00107040 CCO=ADDL
EFER=0000000000000000
check_exception old: 0x8 new 0xd
Here is the source code for my os (quite a mess, I know. This Is just a attempt to get something sorta working the first time, then rewrite it all once I've learned from my mistakes.) Any help would be very much appreciated.