1 ; AcessOS Microkernel Version
11 GDT_SIZE equ (1+2*2+1+MAX_CPUS)*8
20 dd 0x00000000, 0x00000000 ; 00 NULL Entry
21 dd 0x0000FFFF, 0x00CF9A00 ; 08 PL0 Code
22 dd 0x0000FFFF, 0x00CF9200 ; 10 PL0 Data
23 dd 0x0000FFFF, 0x00CFFA00 ; 18 PL3 Code
24 dd 0x0000FFFF, 0x00CFF200 ; 20 PL3 Data
25 dd 26*4-1, 0x00408900 ; Double Fault TSS
26 times MAX_CPUS dd 26*4-1, 0x00408900
33 times 256 dd 0x00080000,0x00000F00
35 dw 256 * 16 - 1 ; Limit
39 [global Desctab_Install]
43 mov ax, 0x10 ; PL0 Data
55 mov WORD [gIDT + %1*8], ax
57 mov WORD [gIDT + %1*8+6], ax
58 mov ax, WORD [gIDT + %1*8 + 4]
60 mov WORD [gIDT + %1*8 + 4], ax
63 mov ax, WORD [gIDT + %1*8 + 4]
65 mov WORD [gIDT + %1*8 + 4], ax
89 out dx, al ; Init Command
92 out dx, al ; Offset (Start of IDT Range)
94 out dx, al ; IRQ connected to Slave (00000100b) = IRQ2
102 out dx, al ; Init Command
105 out dx, al ; Offset (Start of IDT Range)
107 out dx, al ; IRQ Line connected to master
109 out dx, al ; Set Mode
111 out dx, al ; Set Mode
153 ISR_NOERR 0; 0: Divide By Zero Exception
154 ISR_NOERR 1; 1: Debug Exception
155 ISR_NOERR 2; 2: Non Maskable Interrupt Exception
156 ISR_NOERR 3; 3: Int 3 Exception
157 ISR_NOERR 4; 4: INTO Exception
158 ISR_NOERR 5; 5: Out of Bounds Exception
159 ISR_NOERR 6; 6: Invalid Opcode Exception
160 ISR_NOERR 7; 7: Coprocessor Not Available Exception
161 ISR_ERRNO 8; 8: Double Fault Exception (With Error Code!)
162 ISR_NOERR 9; 9: Coprocessor Segment Overrun Exception
163 ISR_ERRNO 10; 10: Bad TSS Exception (With Error Code!)
164 ISR_ERRNO 11; 11: Segment Not Present Exception (With Error Code!)
165 ISR_ERRNO 12; 12: Stack Fault Exception (With Error Code!)
166 ISR_ERRNO 13; 13: General Protection Fault Exception (With Error Code!)
167 ISR_ERRNO 14; 14: Page Fault Exception (With Error Code!)
168 ISR_NOERR 15; 15: Reserved Exception
169 ISR_NOERR 16; 16: Floating Point Exception
170 ISR_NOERR 17; 17: Alignment Check Exception
171 ISR_NOERR 18; 18: Machine Check Exception
172 ISR_NOERR 19; 19: Reserved
173 ISR_NOERR 20; 20: Reserved
174 ISR_NOERR 21; 21: Reserved
175 ISR_NOERR 22; 22: Reserved
176 ISR_NOERR 23; 23: Reserved
177 ISR_NOERR 24; 24: Reserved
178 ISR_NOERR 25; 25: Reserved
179 ISR_NOERR 26; 26: Reserved
180 ISR_NOERR 27; 27: Reserved
181 ISR_NOERR 28; 28: Reserved
182 ISR_NOERR 29; 29: Reserved
183 ISR_NOERR 30; 30: Reserved
184 ISR_NOERR 31; 31: Reserved
186 DEF_SYSCALL 0xAC ; Acess System Call
201 ; ---------------------
202 ; Common error handling
203 ; ---------------------
204 [extern ErrorHandler]
221 add esp, 8 ; Error Code and ID
224 ; --------------------------
225 ; Common System Call Handler
226 ; --------------------------
227 [extern SyscallHandler]
244 add esp, 8 ; Error Code and ID
267 add esp, 8 ; Error Code and ID
273 [extern Proc_Scheduler]
281 mov eax, [esp+12*4] ; CPU Number
282 push eax ; Pus as argument
286 add esp, 4 ; Remove Argument
298 ; No Error code / int num