I am lost on IDT... it loads correctly, but I am quite sure I'm doing something wrong. my assembler is nasm.
here is my idt.s
Code: Select all
bits 32
global installIDT
extern puts
installIDT:
pusha
lidt [idtr]
popa
ret
startidt:
dd isr0, 00000000000010001000111000000000b, 0
dd isr1, 00000000000010001000111000000000b, 0
< etc, ...>
IDT_END:
idtr:
dw startidt -IDT_END - 1
dd startidt
isr0:
pusha
;handle interrupt here
popa
sti
iret
isr1:
pusha
;handle interrupt here
popa
sti
iret
Code: Select all
dw 0xffff
dw 0x08
db 0
db 10001110b
dw isr0
then I tried this line which I found on the forums:
Code: Select all
dw isr0, 8, 1000111000000000b, 0
everything assembles and links fine, but when I call an int it crashes...
I have not set the stack in my os, but I booted with grub and the tutorial i looked at also did not set the stack after using grub, so i'm not sure if this is a problem.
I have read the wiki, I have re-read the entire chapter on interupts in the intel manuals, i have searched the forums for "lidt" since "idt assembly" is too common a search string and gives me that error. been trying at this for a good 8 hours can't figure it out.