Go to the source code of this file.
| #define CALL_GATE_16 4 |
Definition at line 38 of file interrupt.h.
| #define CALL_GATE_32 12 |
Definition at line 42 of file interrupt.h.
| #define DPL_0 0 |
Definition at line 7 of file interrupt.h.
| #define DPL_1 1 |
Definition at line 8 of file interrupt.h.
| #define DPL_2 2 |
Definition at line 9 of file interrupt.h.
| #define DPL_3 3 |
Definition at line 10 of file interrupt.h.
| #define IDT_P 1 |
Definition at line 4 of file interrupt.h.
| #define IDT_SELECTOR 0x0008 |
Definition at line 5 of file interrupt.h.
| #define INT_CPU_ALIGNMENT_ERROR 0x11 |
Definition at line 29 of file interrupt.h.
| #define INT_CPU_BOUND 0x05 |
Definition at line 17 of file interrupt.h.
| #define INT_CPU_BREAKPOINT 0x03 |
Definition at line 15 of file interrupt.h.
| #define INT_CPU_DIVIDE_BY_0 0x00 |
Definition at line 12 of file interrupt.h.
| #define INT_CPU_DOUBLE_FAULT 0x08 |
Definition at line 20 of file interrupt.h.
| #define INT_CPU_FPU_ERROR 0x10 |
Definition at line 28 of file interrupt.h.
| #define INT_CPU_FPU_SEGMENT_OVERFLOW 0x09 |
Definition at line 21 of file interrupt.h.
| #define INT_CPU_INVAL_TSS 0x0A |
Definition at line 22 of file interrupt.h.
| #define INT_CPU_INVALID_OPCODE 0x06 |
Definition at line 18 of file interrupt.h.
| #define INT_CPU_INVALID_SEGMENT 0x0B |
Definition at line 23 of file interrupt.h.
| #define INT_CPU_MACHINE_ERROR 0x12 |
Definition at line 30 of file interrupt.h.
| #define INT_CPU_NMI 0x02 |
Definition at line 14 of file interrupt.h.
| #define INT_CPU_NO_FPU 0x07 |
Definition at line 19 of file interrupt.h.
| #define INT_CPU_OVERFLOW 0x04 |
Definition at line 16 of file interrupt.h.
| #define INT_CPU_PAGE_FAULT 0x0E |
Definition at line 26 of file interrupt.h.
| #define INT_CPU_PROTECTION 0x0D |
Definition at line 25 of file interrupt.h.
| #define INT_CPU_SIMD_ERROR 0x13 |
Definition at line 31 of file interrupt.h.
| #define INT_CPU_SINGLE_STEP 0x01 |
Definition at line 13 of file interrupt.h.
| #define INT_CPU_STACK_FAULT 0x0C |
Definition at line 24 of file interrupt.h.
| #define INT_CPU_UNDEFINE 0x0F |
Definition at line 27 of file interrupt.h.
| #define INT_GATE_16 6 |
Definition at line 40 of file interrupt.h.
| #define INT_GATE_32 14 |
Definition at line 43 of file interrupt.h.
| #define INT_VECTOR_IRQ0 0x20 |
Definition at line 33 of file interrupt.h.
| #define INT_VECTOR_IRQ8 0x28 |
Definition at line 34 of file interrupt.h.
| #define INT_VECTOR_OS_CSW 0x30 |
Definition at line 36 of file interrupt.h.
| #define IRQ0_TIMER 0 |
Definition at line 48 of file interrupt.h.
| #define IRQ10_USER 10 |
Definition at line 59 of file interrupt.h.
| #define IRQ11_USER 11 |
Definition at line 60 of file interrupt.h.
| #define IRQ12_USER 12 |
Definition at line 61 of file interrupt.h.
| #define IRQ13_FPU 13 |
Definition at line 62 of file interrupt.h.
| #define IRQ14_HDC 14 |
Definition at line 63 of file interrupt.h.
| #define IRQ15_RESERVE 15 |
Definition at line 64 of file interrupt.h.
| #define IRQ1_KEYBOARD 1 |
Definition at line 49 of file interrupt.h.
| #define IRQ2_PIC_SLACE 2 |
Definition at line 50 of file interrupt.h.
| #define IRQ3_COM2 3 |
Definition at line 51 of file interrupt.h.
| #define IRQ4_COM1 4 |
Definition at line 52 of file interrupt.h.
| #define IRQ5_LPT2 5 |
Definition at line 53 of file interrupt.h.
| #define IRQ6_FDC 6 |
Definition at line 54 of file interrupt.h.
| #define IRQ7_LPT1 7 |
Definition at line 55 of file interrupt.h.
| #define IRQ8_RTC 8 |
Definition at line 57 of file interrupt.h.
| #define IRQ9_REDIR_IRQ2 9 |
Definition at line 58 of file interrupt.h.
| #define TASK_GATE 5 |
Definition at line 39 of file interrupt.h.
| #define TRAP_GATE_16 7 |
Definition at line 41 of file interrupt.h.
| #define TRAP_GATE_32 15 |
Definition at line 44 of file interrupt.h.
| void InterruptCpuInt0Handler | ( | void | ) |
Definition at line 171 of file interrupt.c.
00171 { 00172 SystemCgaInit(); 00173 SystemCgaStringPrint("Cpu fault 0"); 00174 SystemCgaStringPrint("\nFAULT TYPE: DIVIDE BY 0"); 00175 SystemCgaStringPrint("\nSYSTEM HALT"); 00176 SystemHalt(); 00177 }
| void InterruptCpuInt10Handler | ( | void | ) |
Definition at line 244 of file interrupt.c.
00244 { 00245 SystemCgaInit(); 00246 SystemCgaStringPrint("Cpu fault 10"); 00247 SystemCgaStringPrint("\nFAULT TYPE: INVALID TSS"); 00248 SystemCgaStringPrint("\nSYSTEM HALT"); 00249 SystemHalt(); 00250 }
| void InterruptCpuInt11Handler | ( | void | ) |
Definition at line 251 of file interrupt.c.
00251 { 00252 SystemCgaInit(); 00253 SystemCgaStringPrint("Cpu fault 11"); 00254 SystemCgaStringPrint("\nFAULT TYPE: SEGMENT NOT PRESENT"); 00255 SystemCgaStringPrint("\nSYSTEM HALT"); 00256 SystemHalt(); 00257 }
| void InterruptCpuInt12Handler | ( | void | ) |
Definition at line 258 of file interrupt.c.
00258 { 00259 SystemCgaInit(); 00260 SystemCgaStringPrint("Cpu fault 12"); 00261 SystemCgaStringPrint("\nFAULT TYPE: STACK SEGMENT OVERFLOW"); 00262 SystemCgaStringPrint("\nSYSTEM HALT"); 00263 SystemHalt(); 00264 }
| void InterruptCpuInt13Handler | ( | void | ) |
Definition at line 265 of file interrupt.c.
00265 { 00266 SystemCgaInit(); 00267 SystemCgaStringPrint("Cpu fault 13"); 00268 SystemCgaStringPrint("\nFAULT TYPE: GENERAL PROTECTION"); 00269 SystemCgaStringPrint("\nSYSTEM HALT"); 00270 SystemHalt(); 00271 }
| void InterruptCpuInt14Handler | ( | void | ) |
Definition at line 272 of file interrupt.c.
00272 { 00273 SystemCgaInit(); 00274 SystemCgaStringPrint("Cpu fault 14"); 00275 SystemCgaStringPrint("\nFAULT TYPE: PAGE FAULT"); 00276 SystemCgaStringPrint("\nSYSTEM HALT"); 00277 SystemHalt(); 00278 }
| void InterruptCpuInt15Handler | ( | void | ) |
Definition at line 279 of file interrupt.c.
00279 { 00280 SystemCgaInit(); 00281 SystemCgaStringPrint("Cpu fault 15"); 00282 SystemCgaStringPrint("\nFAULT TYPE: UNDEFINE."); 00283 SystemCgaStringPrint("\nTHIS FAULT TYPE SHOULD NOT HAPPEN ,BECAUSE IT IS UNDEFINED."); 00284 SystemCgaStringPrint("\nSYSTEM HALT"); 00285 SystemHalt(); 00286 }
| void InterruptCpuInt16Handler | ( | void | ) |
Definition at line 287 of file interrupt.c.
00287 { 00288 SystemCgaInit(); 00289 SystemCgaStringPrint("Cpu fault 16"); 00290 SystemCgaStringPrint("\nFAULT TYPE: FPU ERROR"); 00291 SystemCgaStringPrint("\nSYSTEM HALT"); 00292 SystemHalt(); 00293 }
| void InterruptCpuInt17Handler | ( | void | ) |
Definition at line 294 of file interrupt.c.
00294 { 00295 SystemCgaInit(); 00296 SystemCgaStringPrint("Cpu fault 17"); 00297 SystemCgaStringPrint("\nFAULT TYPE: ALIGNMENT ERROR"); 00298 SystemCgaStringPrint("\nSYSTEM HALT"); 00299 SystemHalt(); 00300 }
| void InterruptCpuInt18Handler | ( | void | ) |
Definition at line 301 of file interrupt.c.
00301 { 00302 SystemCgaInit(); 00303 SystemCgaStringPrint("Cpu fault 18"); 00304 SystemCgaStringPrint("\nFAULT TYPE: MACHINE ERROR"); 00305 SystemCgaStringPrint("\nSYSTEM HALT"); 00306 SystemHalt(); 00307 }
| void InterruptCpuInt19Handler | ( | void | ) |
Definition at line 308 of file interrupt.c.
00308 { 00309 SystemCgaInit(); 00310 SystemCgaStringPrint("Cpu fault 19"); 00311 SystemCgaStringPrint("\nFAULT TYPE: SIMD ERROR"); 00312 SystemCgaStringPrint("\nSYSTEM HALT"); 00313 SystemHalt(); 00314 }
| void InterruptCpuInt1Handler | ( | void | ) |
Definition at line 178 of file interrupt.c.
00178 { 00179 SystemCgaInit(); 00180 SystemCgaStringPrint("Cpu fault 1"); 00181 SystemCgaStringPrint("\nFAULT TYPE: SINGLE STEP"); 00182 SystemCgaStringPrint("\nSINGLE STEP IS FOR DEBUG USE."); 00183 SystemCgaStringPrint("\nSYSTEM HALT"); 00184 SystemHalt(); 00185 }
| void InterruptCpuInt2Handler | ( | void | ) |
Definition at line 186 of file interrupt.c.
00186 { 00187 SystemCgaInit(); 00188 SystemCgaStringPrint("Cpu fault 2"); 00189 SystemCgaStringPrint("\nFAULT TYPE: NON MASKABLE INTERRUPT"); 00190 SystemCgaStringPrint("\nNMI IS NOT SUPPORTED."); 00191 SystemCgaStringPrint("\nSYSTEM HALT"); 00192 SystemHalt(); 00193 }
| void InterruptCpuInt3Handler | ( | void | ) |
Definition at line 194 of file interrupt.c.
00194 { 00195 SystemCgaInit(); 00196 SystemCgaStringPrint("Cpu fault 3"); 00197 SystemCgaStringPrint("\nFAULT TYPE: BREAK POINT"); 00198 SystemCgaStringPrint("\nBREAK POINT IS FOR DEBUG USE."); 00199 SystemCgaStringPrint("\nSYSTEM HALT"); 00200 SystemHalt(); 00201 }
| void InterruptCpuInt4Handler | ( | void | ) |
Definition at line 202 of file interrupt.c.
00202 { 00203 SystemCgaInit(); 00204 SystemCgaStringPrint("Cpu fault 4"); 00205 SystemCgaStringPrint("\nFAULT TYPE: OVERFLOW"); 00206 SystemCgaStringPrint("\nSYSTEM HALT"); 00207 SystemHalt(); 00208 }
| void InterruptCpuInt5Handler | ( | void | ) |
Definition at line 209 of file interrupt.c.
00209 { 00210 SystemCgaInit(); 00211 SystemCgaStringPrint("Cpu fault 5"); 00212 SystemCgaStringPrint("\nFAULT TYPE: BOUND"); 00213 SystemCgaStringPrint("\nSYSTEM HALT"); 00214 SystemHalt(); 00215 }
| void InterruptCpuInt6Handler | ( | void | ) |
Definition at line 216 of file interrupt.c.
00216 { 00217 SystemCgaInit(); 00218 SystemCgaStringPrint("Cpu fault 6"); 00219 SystemCgaStringPrint("\nFAULT TYPE: INVALID OP CODE"); 00220 SystemCgaStringPrint("\nSYSTEM HALT"); 00221 SystemHalt(); 00222 }
| void InterruptCpuInt7Handler | ( | void | ) |
Definition at line 223 of file interrupt.c.
00223 { 00224 SystemCgaInit(); 00225 SystemCgaStringPrint("Cpu fault 7"); 00226 SystemCgaStringPrint("\nFAULT TYPE: NO FPU"); 00227 SystemCgaStringPrint("\nSYSTEM HALT"); 00228 SystemHalt(); 00229 }
| void InterruptCpuInt8Handler | ( | void | ) |
Definition at line 230 of file interrupt.c.
00230 { 00231 SystemCgaInit(); 00232 SystemCgaStringPrint("Cpu fault 8"); 00233 SystemCgaStringPrint("\nFAULT TYPE: DOUBLE FAULT"); 00234 SystemCgaStringPrint("\nSYSTEM HALT"); 00235 SystemHalt(); 00236 }
| void InterruptCpuInt9Handler | ( | void | ) |
Definition at line 237 of file interrupt.c.
00237 { 00238 SystemCgaInit(); 00239 SystemCgaStringPrint("Cpu fault 9"); 00240 SystemCgaStringPrint("\nFAULT TYPE: FPU SEGMENT OVERFLOW"); 00241 SystemCgaStringPrint("\nSYSTEM HALT"); 00242 SystemHalt(); 00243 }
| void InterruptCpuIntHandlerSet | ( | U8 | IntNumber, | |
| INT_HANDLER | IntHandler | |||
| ) |
Definition at line 53 of file interrupt.c.
00053 { 00054 if(IntNumber>=20) return; //invalid cpu fault int number 00055 CpuIntHandlersTable[IntNumber]=IntHandler; 00056 }
| void InterruptIdtEntrySet | ( | U8 | IntNumber, | |
| U8 | IdtType, | |||
| INT_HANDLER | Handler, | |||
| U8 | IdtDpl | |||
| ) |
Definition at line 68 of file interrupt.c.
00068 { 00069 GATE* pGate; 00070 U32 Base; 00071 00072 pGate=&IdtTable[IntNumber]; 00073 Base=(U32)Handler; 00074 pGate->OffsetLow=Base&0x0000ffff; 00075 pGate->Selector=IDT_SELECTOR; 00076 pGate->Dcount=0x00; 00077 pGate->Attribute=(IDT_P<<7)|(IdtDpl<<5)|IdtType; 00078 pGate->OffsetHigh=(Base>>16)&0x0000ffff; 00079 }
| void InterruptIdtTableFill | ( | void | ) |
Definition at line 81 of file interrupt.c.
00081 { 00082 InterruptIdtEntrySet(INT_CPU_DIVIDE_BY_0, INT_GATE_32,CpuIntExecutorTable[0],DPL_3); 00083 InterruptIdtEntrySet(INT_CPU_SINGLE_STEP, INT_GATE_32,CpuIntExecutorTable[1],DPL_3); 00084 InterruptIdtEntrySet(INT_CPU_NMI, INT_GATE_32,CpuIntExecutorTable[2],DPL_3); 00085 InterruptIdtEntrySet(INT_CPU_BREAKPOINT, INT_GATE_32,CpuIntExecutorTable[3],DPL_3); 00086 InterruptIdtEntrySet(INT_CPU_OVERFLOW, INT_GATE_32,CpuIntExecutorTable[4],DPL_3); 00087 InterruptIdtEntrySet(INT_CPU_BOUND, INT_GATE_32,CpuIntExecutorTable[5],DPL_3); 00088 InterruptIdtEntrySet(INT_CPU_INVALID_OPCODE, INT_GATE_32,CpuIntExecutorTable[6],DPL_3); 00089 InterruptIdtEntrySet(INT_CPU_NO_FPU, INT_GATE_32,CpuIntExecutorTable[7],DPL_3); 00090 InterruptIdtEntrySet(INT_CPU_DOUBLE_FAULT, INT_GATE_32,CpuIntExecutorTable[8],DPL_3); 00091 InterruptIdtEntrySet(INT_CPU_FPU_SEGMENT_OVERFLOW, INT_GATE_32,CpuIntExecutorTable[9],DPL_3); 00092 InterruptIdtEntrySet(INT_CPU_INVAL_TSS, INT_GATE_32,CpuIntExecutorTable[10],DPL_3); 00093 InterruptIdtEntrySet(INT_CPU_INVALID_SEGMENT, INT_GATE_32,CpuIntExecutorTable[11],DPL_3); 00094 InterruptIdtEntrySet(INT_CPU_STACK_FAULT, INT_GATE_32,CpuIntExecutorTable[12],DPL_3); 00095 InterruptIdtEntrySet(INT_CPU_PROTECTION, INT_GATE_32,CpuIntExecutorTable[13],DPL_3); 00096 InterruptIdtEntrySet(INT_CPU_PAGE_FAULT, INT_GATE_32,CpuIntExecutorTable[14],DPL_3); 00097 //InterruptIdtEntrySet(INT_CPU_UNDEFINE, INT_GATE_32,CpuIntExecutorTable[15],DPL_3); //undefine means this int is not defined. 00098 InterruptIdtEntrySet(INT_CPU_FPU_ERROR, INT_GATE_32,CpuIntExecutorTable[16],DPL_3); 00099 InterruptIdtEntrySet(INT_CPU_ALIGNMENT_ERROR, INT_GATE_32,CpuIntExecutorTable[17],DPL_3); 00100 InterruptIdtEntrySet(INT_CPU_MACHINE_ERROR, INT_GATE_32,CpuIntExecutorTable[18],DPL_3); 00101 InterruptIdtEntrySet(INT_CPU_SIMD_ERROR, INT_GATE_32,CpuIntExecutorTable[19],DPL_3); 00102 00103 InterruptIdtEntrySet(INT_VECTOR_IRQ0+0, INT_GATE_32,IrqExecutorTable[0],DPL_3); 00104 InterruptIdtEntrySet(INT_VECTOR_IRQ0+1, INT_GATE_32,IrqExecutorTable[1],DPL_3); 00105 InterruptIdtEntrySet(INT_VECTOR_IRQ0+2, INT_GATE_32,IrqExecutorTable[2],DPL_3); 00106 InterruptIdtEntrySet(INT_VECTOR_IRQ0+3, INT_GATE_32,IrqExecutorTable[3],DPL_3); 00107 InterruptIdtEntrySet(INT_VECTOR_IRQ0+4, INT_GATE_32,IrqExecutorTable[4],DPL_3); 00108 InterruptIdtEntrySet(INT_VECTOR_IRQ0+5, INT_GATE_32,IrqExecutorTable[5],DPL_3); 00109 InterruptIdtEntrySet(INT_VECTOR_IRQ0+6, INT_GATE_32,IrqExecutorTable[6],DPL_3); 00110 InterruptIdtEntrySet(INT_VECTOR_IRQ0+7, INT_GATE_32,IrqExecutorTable[7],DPL_3); 00111 InterruptIdtEntrySet(INT_VECTOR_IRQ8+0, INT_GATE_32,IrqExecutorTable[8],DPL_3); 00112 InterruptIdtEntrySet(INT_VECTOR_IRQ8+1, INT_GATE_32,IrqExecutorTable[9],DPL_3); 00113 InterruptIdtEntrySet(INT_VECTOR_IRQ8+2, INT_GATE_32,IrqExecutorTable[10],DPL_3); 00114 InterruptIdtEntrySet(INT_VECTOR_IRQ8+3, INT_GATE_32,IrqExecutorTable[11],DPL_3); 00115 InterruptIdtEntrySet(INT_VECTOR_IRQ8+4, INT_GATE_32,IrqExecutorTable[12],DPL_3); 00116 InterruptIdtEntrySet(INT_VECTOR_IRQ8+5, INT_GATE_32,IrqExecutorTable[13],DPL_3); 00117 InterruptIdtEntrySet(INT_VECTOR_IRQ8+6, INT_GATE_32,IrqExecutorTable[14],DPL_3); 00118 InterruptIdtEntrySet(INT_VECTOR_IRQ8+7, INT_GATE_32,IrqExecutorTable[15],DPL_3); 00119 00120 InterruptIdtEntrySet(INT_VECTOR_OS_CSW, INT_GATE_32,SoftwareIntExecutorTable[0],DPL_3); 00121 }
| void InterruptIrq0Handler | ( | void | ) |
| void InterruptIrq10Handler | ( | void | ) |
| void InterruptIrq11Handler | ( | void | ) |
| void InterruptIrq12Handler | ( | void | ) |
| void InterruptIrq13Handler | ( | void | ) |
| void InterruptIrq14Handler | ( | void | ) |
| void InterruptIrq15Handler | ( | void | ) |
| void InterruptIrq1Handler | ( | void | ) |
| void InterruptIrq2Handler | ( | void | ) |
| void InterruptIrq3Handler | ( | void | ) |
| void InterruptIrq4Handler | ( | void | ) |
| void InterruptIrq5Handler | ( | void | ) |
| void InterruptIrq6Handler | ( | void | ) |
| void InterruptIrq7Handler | ( | void | ) |
| void InterruptIrq8Handler | ( | void | ) |
| void InterruptIrq9Handler | ( | void | ) |
| void InterruptIrqHandlerSet | ( | U8 | IrqNumber, | |
| INT_HANDLER | IrqHandler | |||
| ) |
Definition at line 58 of file interrupt.c.
00058 { 00059 if(IrqNumber>=16) return; //invalid irq number 00060 IrqHandlersTable[IrqNumber]=IrqHandler; 00061 }
| void InterruptSoftwareInt48Handler | ( | void | ) |
| void InterruptSoftwareIntHandlerSet | ( | U8 | IntNumber, | |
| INT_HANDLER | IntHandler | |||
| ) |
Definition at line 63 of file interrupt.c.
00063 { 00064 if(IntNumber>=1) return; //invalid int number 00065 SoftwareIntHandlersTable[IntNumber]=IntHandler; 00066 }
1.5.9