IDT in asm
Posted: Sun Sep 11, 2005 4:48 am
Hello.
Here is part of my boiler-plate:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:Text section
lidt [idt_pointer]
call main
jmp $
;My only ISR for now
isr:
pusha
push gs
push fs
push es
push ds
extern interrupt_service_routine
call interrupt_service_routine
pop ds
pop es
pop fs
pop gs
popa
iret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Data section
start_of_idt:
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
dw 0x0000
dw 0x10
dw 0xE00
dw 0x20
%rep 0xC
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
%endrep
dw 0x0000
dw 0x10
dw 0xE00
dw 0x20
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
end_of_idt:
idt_pointer:
dw end_of_idt - start_of_idt - 1
dd start_of_idt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I want to keep this as simple as I can.
The question is:
what do I have to change from IDT
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
if I want it to jump to "isr" when the interrupt comes?
Here is part of my boiler-plate:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:Text section
lidt [idt_pointer]
call main
jmp $
;My only ISR for now
isr:
pusha
push gs
push fs
push es
push ds
extern interrupt_service_routine
call interrupt_service_routine
pop ds
pop es
pop fs
pop gs
popa
iret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Data section
start_of_idt:
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
dw 0x0000
dw 0x10
dw 0xE00
dw 0x20
%rep 0xC
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
%endrep
dw 0x0000
dw 0x10
dw 0xE00
dw 0x20
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
end_of_idt:
idt_pointer:
dw end_of_idt - start_of_idt - 1
dd start_of_idt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I want to keep this as simple as I can.
The question is:
what do I have to change from IDT
dw 0x0000
dw 0x10
dw 0x8E00
dw 0x20
if I want it to jump to "isr" when the interrupt comes?