-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidt.h
More file actions
33 lines (26 loc) · 736 Bytes
/
idt.h
File metadata and controls
33 lines (26 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef IDT_H
#define IDT_H
extern void setup_idt();
extern void idt_set_gate(void *handler, int gate);
void install_handler(void *handler, unsigned char gate);
struct idt_gate {
unsigned short offset_1;
unsigned short selector;
unsigned char pad;
unsigned char type;
unsigned short offset_2;
} __attribute__((packed));
struct idt_desc {
unsigned short size;
unsigned int offset;
} __attribute__((packed));
struct regs {
unsigned int gs, fs, es, ds;
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
unsigned int int_no, err_code;
unsigned int eip, cs, eflags, useresp, ss;
} __attribute__((packed));
void int_handler(struct regs *r);
extern struct idt_gate idt[256];
extern struct idt_desc idtp;
#endif