adding structures to be used later in construction idt
This commit is contained in:
parent
a97affbe72
commit
7385ba7d7f
@ -1,5 +1,10 @@
|
||||
#include "interrupts.h"
|
||||
#include "types.h"
|
||||
|
||||
void interrupt_handler(struct cpu_reg_state cpu, struct stack_state stack, u32 interrupt_code) {
|
||||
void load_idt() {
|
||||
asm("lidt [idt_ptr]");
|
||||
return;
|
||||
}
|
||||
|
||||
//void interrupt_handler(struct cpu_reg_state cpu, struct stack_state stack, u32 interrupt_code) {
|
||||
//}
|
||||
|
23
interrupts.h
23
interrupts.h
@ -30,5 +30,26 @@ struct stack_state {
|
||||
u32 eflags;
|
||||
};
|
||||
|
||||
struct IDT_Entry {
|
||||
u16 offset_low; // offset bits 0..15
|
||||
u16 selector; // code segment in either gdt or ldt
|
||||
u8 zero; // not used always 0
|
||||
/* 7 0
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
* | P | DPL | S | GateType |
|
||||
* +---+---+---+---+---+---+---+---+
|
||||
*/
|
||||
u8 type_attrs; // format specified above
|
||||
u16 offset_high;// offset bits 16..31
|
||||
}__attribute__((packed));
|
||||
|
||||
void interrupt_handler(struct cpu_reg_state, struct stack_state, u32);
|
||||
struct IDT_PTR {
|
||||
u16 limit;
|
||||
u32 address;
|
||||
}__attribute__((packed));
|
||||
|
||||
struct IDT_Entry IDT[255];
|
||||
struct IDT_PTR idt_ptr;
|
||||
|
||||
//void interrupt_handler(struct cpu_reg_state, struct stack_state, u32);
|
||||
void load_idt();
|
||||
|
Loading…
Reference in New Issue
Block a user