os-tutorial
os-tutorial copied to clipboard
Lesson 23-fixes issue
The "fixes" in 23 actually broke my kernel. Instead of doing what the fixes were supposed to do, 'fix', they caused my kernel to crash with a General Protection Fault. And I can't debug it because gdb doesn't actually seem to work.
@JuliusCaesar12 Make sure you popped eax in isr_common_stub after isr_handler call, respectively ebx in irq_common_stub. There should be 2x register pop:
isr_common_stub:
pusha
...
cld
call isr_handler
pop eax ; <-- pop 1.
pop eax ; <-- pop 2.
...
iret
@zdychacek This is already here and it crashes for me too:
qemu: fatal: invalid tss type
EAX=00000000 EBX=00009500 ECX=00000000 EDX=000003d5
ESI=00000000 EDI=00106000 EBP=00000000 ESP=000cb268
EIP=00000000 EFL=00260002 [-------] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0000 00000000 0000ffff 0000f300 DPL=3 DS16 [-WA]
CS =b1bb 000b1bb0 0000ffff 0000f300 DPL=3 DS16 [-WA]
SS =0e0a 0000e0a0 0000ffff 0000f300 DPL=3 DS16 [-WA]
DS =0e0a 0000e0a0 0000ffff 0000f300 DPL=3 DS16 [-WA]
FS =0000 00000000 0000ffff 0000f300 DPL=3 DS16 [-WA]
GS =0000 00000000 0000ffff 0000f300 DPL=3 DS16 [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 000cb268 00000027
IDT= 00103880 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00006f0c CCO=EFLAGS
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