SayoriOS  0.3.3
cpu_isr.h
1 #ifndef CPU_ISR_H
2 #define CPU_ISR_H
3 
4 #define INT_0 0x00
5 #define INT_1 0x01
6 #define INT_2 0x02
7 #define INT_3 0x03
8 #define INT_4 0x04
9 #define INT_5 0x05
10 #define INT_6 0x06
11 #define INT_7 0x07
12 #define INT_8 0x08
13 #define INT_9 0x09
14 #define INT_10 0x0A
15 #define INT_11 0x0B
16 #define INT_12 0x0C
17 #define INT_13 0x0D
18 #define INT_14 0x0E
19 #define INT_15 0x0F
20 #define INT_16 0x10
21 #define INT_17 0x11
22 #define INT_18 0x12
23 
24 #define EXT_BIT (1 << 0)
25 #define IDT_BIT (1 << 1)
26 #define TI_BIT (1 << 2)
27 #define ERR_CODE_MASK 0xFFF8
28 
29 #include "common.h"
30 #include "sys/isr.h"
31 
32 /*------------------------------------------------------------------------------
33 // Handlers prototypes
34 //----------------------------------------------------------------------------*/
35 
36 /* INT 00h - division by zero */
37 void division_by_zero(registers_t regs);
38 
39 /* INT 06h - fault opcode */
40 void fault_opcode(registers_t regs);
41 
42 /* INT 08h - double error */
43 void double_error(registers_t regs);
44 
45 /* INT 0Ah - invalid TSS */
46 void invalid_tss(registers_t regs);
47 
48 /* INT 0Bh - Segment isn't available */
49 void segment_is_not_available(registers_t regs);
50 
51 /* INT 0Ch - Stack error */
52 void stack_error(registers_t regs);
53 
54 /* INT 0Dh - General protection error */
55 void general_protection_error(registers_t regs);
56 
57 /* INT 0Eh - page fault */
58 void page_fault(registers_t regs);
59 
60 /* INT 10h - FPU fault */
61 void fpu_fault(registers_t regs);
62 
63 uint32_t extern read_cr2();
64 
65 void bsod_screen(registers_t regs, char* title, char* msg, uint32_t code);
66 #endif
Основные определения ядра