1 ; AcessOS Microkernel Version
11 GDT_SIZE equ (1+2*2+1+MAX_CPUS)*8
19 dd 0x00000000, 0x00000000 ; 00 NULL Entry
20 dd 0x0000FFFF, 0x00CF9A00 ; 08 PL0 Code
21 dd 0x0000FFFF, 0x00CF9200 ; 10 PL0 Data
22 dd 0x0000FFFF, 0x00CFFA00 ; 18 PL3 Code
23 dd 0x0000FFFF, 0x00CFF200 ; 20 PL3 Data
24 dd 26*4-1, 0x00408900 ; 28 Double Fault TSS
25 times MAX_CPUS dd 26*4-1, 0x00408900 ; 30+ TSSes
34 ; CS = 0x08, Type = 32-bit Interrupt (0xE = 1 110)
35 times 256 dd 0x00080000,0x00000E00
38 dw 256 * 16 - 1 ; Limit
43 [global Desctab_Install]
47 mov ax, 0x10 ; PL0 Data
59 mov WORD [gIDT + %1*8], ax
61 mov WORD [gIDT + %1*8+6], ax
63 mov ax, WORD [gIDT + %1*8 + 4]
65 mov WORD [gIDT + %1*8 + 4], ax
68 or WORD [gIDT + %1*8 + 4], 0x6000
71 or WORD [gIDT + %1*8 + 4], 0x0100
82 SET_TRAP 0xAC ; Interruptable
85 SETISR 0xEE ; 0xEE Timer
86 SETISR 0xEF ; 0xEF Spurious Interrupt
103 out dx, al ; Init Command
106 out dx, al ; Offset (Start of IDT Range)
108 out dx, al ; IRQ connected to Slave (00000100b) = IRQ2
110 out dx, al ; Set Mode
112 out dx, al ; Set Mode
116 out dx, al ; Init Command
119 out dx, al ; Offset (Start of IDT Range)
121 out dx, al ; IRQ Line connected to master
123 out dx, al ; Set Mode
125 out dx, al ; Set Mode
166 ISR_NOERR 0; 0: Divide By Zero Exception
167 ISR_NOERR 1; 1: Debug Exception
168 ISR_NOERR 2; 2: Non Maskable Interrupt Exception
169 ISR_NOERR 3; 3: Int 3 Exception
170 ISR_NOERR 4; 4: INTO Exception
171 ISR_NOERR 5; 5: Out of Bounds Exception
172 ISR_NOERR 6; 6: Invalid Opcode Exception
173 ISR_NOERR 7; 7: Coprocessor Not Available Exception
174 ISR_ERRNO 8; 8: Double Fault Exception (With Error Code!)
175 ISR_NOERR 9; 9: Coprocessor Segment Overrun Exception
176 ISR_ERRNO 10; 10: Bad TSS Exception (With Error Code!)
177 ISR_ERRNO 11; 11: Segment Not Present Exception (With Error Code!)
178 ISR_ERRNO 12; 12: Stack Fault Exception (With Error Code!)
179 ISR_ERRNO 13; 13: General Protection Fault Exception (With Error Code!)
180 ISR_ERRNO 14; 14: Page Fault Exception (With Error Code!)
181 ISR_NOERR 15; 15: Reserved Exception
182 ISR_NOERR 16; 16: Floating Point Exception
183 ISR_NOERR 17; 17: Alignment Check Exception
184 ISR_NOERR 18; 18: Machine Check Exception
185 ISR_NOERR 19; 19: Reserved
186 ISR_NOERR 20; 20: Reserved
187 ISR_NOERR 21; 21: Reserved
188 ISR_NOERR 22; 22: Reserved
189 ISR_NOERR 23; 23: Reserved
190 ISR_NOERR 24; 24: Reserved
191 ISR_NOERR 25; 25: Reserved
192 ISR_NOERR 26; 26: Reserved
193 ISR_NOERR 27; 27: Reserved
194 ISR_NOERR 28; 28: Reserved
195 ISR_NOERR 29; 29: Reserved
196 ISR_NOERR 30; 30: Reserved
197 ISR_NOERR 31; 31: Reserved
199 DEF_SYSCALL 0xAC ; Acess System Call
203 [extern SchedulerBase]
204 ; AP's Timer Interrupt
207 xchg bx, bx ; MAGIC BREAK
212 xchg bx, bx ; MAGIC BREAK
220 [extern SchedulerBase]
221 [extern SetAPICTimerCount]
224 ;xchg bx, bx ; MAGIC BREAK
227 jmp SetAPICTimerCount ; This is reset once the bus speed has been calculated
238 ; ---------------------
239 ; Common error handling
240 ; ---------------------
241 [extern ErrorHandler]
243 ;xchg bx, bx ; MAGIC BREAK
265 add esp, 8 ; Error Code and ID
268 ; --------------------------
269 ; Common System Call Handler
270 ; --------------------------
271 [extern SyscallHandler]
288 add esp, 8 ; Error Code and ID
318 add esp, 8 ; Error Code and ID