1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2003-2005. ;
3 ;----------------------------------------------------------;
5 ; set/modify IDT entries ;
7 ;----------------------------------------------------------;
11 ;--------------------------------------------------;
13 ; in: edi = pointer to "unhandled int"-function. ;
14 ;--------------------------------------------------;
22 mov [(0x6c00+ecx)], ax ; set whole IDT
23 add ecx, 2 ; 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 .loop ; * 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 = offset in IDT (1/2 for dword list)
54 mov [(idt_list+ecx/2)], edi ; add new int to idt entry list
57 mov [(0x6c00+ecx)], ax
60 mov dword [(0x6c00+ecx)], 0x8E000008
65 mov [(0x6c00+ecx)], ax
73 ;------------------------------------------------;
75 ; in: cl = int number ;
76 ; out: esi = address or 0 if none present ;
77 ;------------------------------------------------;
81 mov eax, 4 ; 4 bytes for each address
92 ;----------------------------------------;
93 ; sets ints from list ;
94 ; in: esi = pointer to int list ;
95 ;----------------------------------------;
118 ;------------------------------;
119 ; list of idt entries. ;
121 ;------------------------------;
142 times 12 dd 0 ; 12 unused ints
145 times 16 dd 0 ; 16 unused ints
146 dd isr32 ; First free and BOS system interrupt.
147 times 205 dd 0 ; 205 unused ints