I try to setup my IDT:
--------------------------------------
...
cli ; no interrupts allowed!
mov edi, idt
mov esi, panic
mov ecx, 64 ; number of exception handlers
do_idt:
mov eax, esi ; EAX=offset of entry point
mov [edi], ax ; set low 16 bits of gate offset
shr eax,16
mov [edi + 6], ax ; set high 16 bits of gate offset
add edi, 8 ; 8 bytes/interrupt gate
dec ecx
jne do_idt
...
jmp dword code_desc:go32
[bits 32]
go32:
...
sti
...
idtr dw idt_end-idt-1
dd idt
idt:
%rep 64
dw 0 ; offset 15:0
dw code_desc ; selector, linear code selector
db 0 ; (always 0 for interrupt gates)
db sys_interrupt ; present,ring 0,'386 interrupt gate
dw 0 ; offset 31:16
%endrep
idt_end:
irq_clear:
push ax
mov al, 0x20
out 0x20, al ; quiet screaming irq chip.
pop ax
ret
panic:
push edi
mov byte [es:edi], "#" ; ES = Video_desc
pop edi ; just print a debug message
call irq_clear
iret
------------------------------------------
After I use "sti", Bochs says:
FATAL: floppy recal:f07: ctrl not ready
>>PANIC<< BIOS panic at rombios.c, line 1558
What's the worse, CPU turns back to real mode after "sti".
But what's the matter? Is there anything wrong?
Hope someone can help me.
Thanks in advance.
IDT problem
RE:IDT problem
Sad but true, this still cannot work.
Bochs says:
FATAL: floppy recal:f07: ctrl not ready
>>PANIC<< BIOS panic at rombios.c, line 1558
CPU turns back to real mode,too.
Bochs says:
FATAL: floppy recal:f07: ctrl not ready
>>PANIC<< BIOS panic at rombios.c, line 1558
CPU turns back to real mode,too.