Installing the IDT in Assembly
Posted: Sat Apr 24, 2010 11:01 pm
I'm having trouble creating the IDT in Assembly. This is what I have so far for my IDT.inc file:
Code:
IDT_General is going to be the general exception handler for the interrupts I haven't covered yet. I'm pretty sure I have that set up right. But what I'm really confused about is how to set that to all 256 descriptors so it can cover them all.
I'm not sure what to do next in it to get it working. I'm looking at different tutorials about the IDT and I know what they're saying but implementing it is harder than I thought. It's because they're all in C/C++. If you know one in Assembly please let me know. And please don't (if your going to help me here) just give me the code, I want to work this out on my own.
Code:
Code: Select all
;***************************************;
; IDT.inc ;
;***************************************;
bits 32
;=======================================;
; Include Files ;
;=======================================;
;=======================================;
; Install_IDT ;
;=======================================;
Install_IDT:
pusha
lidt [IDT_Desc]
popa
ret
;=======================================;
; IDT - Interrupt Descriptor Table ;
;=======================================;
IDT_General:
mov ax, 0x12
call Set_Text_Color
call ClrScr32
mov ax, 0x01F
call GotoXY
mov ebx, msg
call Puts32
jmp $
IDT_End:
IDT_Desc:
dw IDT_General - IDT_End - 1
dd IDT_General
;=======================================;
; Data ;
;=======================================;
msg db "*** [i86 Hal] i86_default_handler: Unhandled Exception", 0x0A, 0x00
I'm not sure what to do next in it to get it working. I'm looking at different tutorials about the IDT and I know what they're saying but implementing it is harder than I thought. It's because they're all in C/C++. If you know one in Assembly please let me know. And please don't (if your going to help me here) just give me the code, I want to work this out on my own.