idt problems
Posted: Tue Apr 08, 2003 1:56 pm
can someone look at this. when an interrupt occurs the ISR does not get executed and the code acts like an interrupt never occured. this is the second file of my bootloader. the first file is compiled as a binary and this one is compiled in aout format and linked to several functions writen in c. this file is loaded into memory from sector 7 of a floppy disk at 60:0 in real mode. the first bootloader then jumps to 60:0 and this file jumps to my kernel. any help would be appreciated.
Code: Select all
jmp start
;notes:
;this file should be compiled in aout format
;so that 'extern' is available
;-------------------------varaiables---------------------
IDTpntr:
dw IDTend - IDT - 1
dd IDT
;-------------------------idt----------------------------------
IDT:
;int 0:
DW ISR0
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
;int 1:
DW ISR1
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
;int 2:
DW ISR2
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
;int 3:
DW ISR3
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
;int 4:
DW ISR4
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
;int 5:
DW ISR5
DW 0x08 ;code selector
DB 0x00
DB 0x8E
DW 0x00
IDTend:
;----------------------------ISRs------------------------
;----------------------------0---------------------------
ISR0:
pusha
push gs
push fs
push es
push ds
[extern _isr_0]
call _isr_0
pop ds
pop es
pop fs
pop gs
popa
iret
;----------------------------1---------------------------
ISR1:
pusha
push gs
push fs
push es
push ds
[extern _isr_1]
call _isr_1
pop ds
pop es
pop fs
pop gs
popa
iret
;----------------------------2---------------------------
ISR2:
pusha
push gs
push fs
push es
push ds
[extern _isr_2]
call _isr_2
pop ds
pop es
pop fs
pop gs
popa
iret
;----------------------------3---------------------------
ISR3:
pusha
push gs
push fs
push es
push ds
[extern _isr_3]
call _isr_3
pop ds
pop es
pop fs
pop gs
popa
iret
;----------------------------4---------------------------
ISR4:
pusha
push gs
push fs
push es
push ds
[extern _isr_4]
call _isr_4
pop ds
pop es
pop fs
pop gs
popa
iret
;----------------------------5---------------------------
ISR5:
pusha
push gs
push fs
push es
push ds
[extern _isr_5]
call _isr_5
pop ds
pop es
pop fs
pop gs
popa
iret
start:
lidt [IDTpntr]
sti
XOR EBX,EBX
DIV EBX
jmp 0x100000
hlt