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
55 mov dword [(idt_list+ecx)], edi ; add new int to idt entry list
58 mov [(0x6c00+ecx)], ax
61 mov dword [(0x6c00+ecx)], 0x8E000008
66 mov [(0x6c00+ecx)], ax
74 ;------------------------------------------------;
76 ; in: cl = int number ;
77 ; out: esi = address or 0 if none present ;
78 ;------------------------------------------------;
82 mov eax, 4 ; 4 bytes for each address
93 ;----------------------------------------;
94 ; sets ints from list ;
95 ; in: esi = pointer to int list ;
96 ;----------------------------------------;
119 ;------------------------------;
120 ; list of idt entries. ;
122 ;------------------------------;
143 times 12 dd 0 ; 12 unused ints
146 times 16 dd 0 ; 16 unused ints
147 dd isr32 ; First free and BOS system interrupt.
148 times 205 dd 0 ; 205 unused ints