Crash with IDT Implementation
Posted: Wed May 20, 2015 6:15 pm
Just starting with OS dev, but I have lots of previous experience with programming.
I've got a pretty basic kernel running thanks to the wiki, along with GDT. However now that I'm trying to implement the IDT, it isn't wanting to be friendly anymore.
I'm reusing code from James Molloy.
Here's what I've got with qemu:
According to EIP, it happens when I pop ebx and esi...
I'm completely lost here. Not really sure how to debug something like this..
Here's the "isr common stub", it's probably the relevant code:
I'd really appreciate any tips or help. Thanks a bunch guys.
I've got a pretty basic kernel running thanks to the wiki, along with GDT. However now that I'm trying to implement the IDT, it isn't wanting to be friendly anymore.
I'm reusing code from James Molloy.
Here's what I've got with qemu:
Code: Select all
qemu: fatal: Trying to execute code outside RAM or ROM at 0x5e665b66
EAX=00006180 EBX=5b66ffff ECX=00000001 EDX=0a2b5d66
ESI=08c48366 EDI=00104fa8 EBP=00000014 ESP=000fffe8
EIP=5e665b66 EFL=00200087 [--S--PC] 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= 00106020 00000027
IDT= 00106080 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000050 CCD=ffffffb1 CCO=SUBL
EFER=0000000000000000
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000
./qemu.sh: line 5: 14902 Aborted (core dumped) qemu-system-$(./target-triplet-to-arch.sh $HOST) -cdrom myos.iso
I'm completely lost here. Not really sure how to debug something like this..
Here's the "isr common stub", it's probably the relevant code:
Code: Select all
pusha
mov ax, ds
push eax
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
call isr_handler
pop eax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
popa
add esp, 8
sti
iret