]>
wirehaze git hosting - BOS.git/blob - kernel/int/idt.asm
1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2003-2005. ;
3 ;----------------------------------------------------------;
5 ; set/modify IDT entries ;
7 ;----------------------------------------------------------;
11 ;--------------------------------------------------;
13 ; in: esi = pointer to "unhandled int"-function. ;
14 ;--------------------------------------------------;
21 mov eax, esi ; loop full IDT and
22 mov [(0x6c00+ecx)], ax ; set to one ISR
25 mov dword [(0x6c00+ecx)], 0x8E000008 ; 0x6c00 is where
26 add ecx, 4 ; we put the IDT
30 mov [(0x6c00+ecx)], ax
33 cmp ecx, 0x800 ; 256 ints
34 jb .l1
; * 8 bytes each
42 ;--------------------------------------;
43 ; modify IDT, set any int ;
44 ; in: cl = int number ;
45 ; edi = int function pointer ;
46 ;--------------------------------------;
51 mov al, 8 ; 8 bytes for each int
53 movzx ecx, ax ; ecx = IDT offset
54 shr ecx, 1 ; 1/2 for dword list
55 mov dword [(idt_list
+ecx)], edi ; add to dword int list
56 movzx ecx, ax ; ecx = IDT offset
59 mov [(0x6c00+ecx)], ax
62 mov dword [(0x6c00+ecx)], 0x8E000008
67 mov [(0x6c00+ecx)], ax
75 ;------------------------------------------------;
77 ; in: cl = int number ;
78 ; out: esi = address or 0 if none present ;
79 ;------------------------------------------------;
83 mov eax, 4 ; 4 bytes for each address
94 ;----------------------------------------;
95 ; sets ints from list ;
96 ; in: esi = pointer to int list ;
97 ;----------------------------------------;
120 ;------------------------------;
121 ; list of idt entries. ;
123 ;------------------------------;
144 times 12 dd 0 ; 12 unused ints
147 times 16 dd 0 ; 16 unused ints
148 dd isr32
; First free and BOS system interrupt.
149 times 205 dd 0 ; 205 unused ints