Small IDT work, gotta go hiking lol
This commit is contained in:
parent
8c51b7010e
commit
fbef354410
3 changed files with 9 additions and 7 deletions
|
|
@ -17,6 +17,7 @@ typedef struct IDTR_s {
|
|||
|
||||
extern IDTR_t idtr;
|
||||
extern InterruptDescriptor_t* idt_start;
|
||||
extern char num_interrupts;
|
||||
|
||||
void setup_idt();
|
||||
void write_descriptors();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
global idtr, idt_start
|
||||
%define NUM_INTERRUPTS 32
|
||||
global idtr, idt_start, num_interrupts
|
||||
section .idtr
|
||||
num_interrupts:
|
||||
db NUM_INTERRUPTS
|
||||
idtr:
|
||||
;Normally, the size would be the size of the whole table, but i'm only defining 32 interrupts for now.
|
||||
;dw idt_end - idt_start
|
||||
dw 32
|
||||
dw NUM_INTERRUPTS * 8
|
||||
dd idt_start
|
||||
|
||||
section .idt nobits
|
||||
idt_start:
|
||||
resb 256 * 8 ;idt technically has 256 entries by the spec, so i'm reserving that much space... even if i dont implement that many.
|
||||
resb NUM_INTERRUPTS * 8
|
||||
idt_end:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@ void setup_idt() {
|
|||
|
||||
void write_descriptors() {
|
||||
|
||||
for(int i = 0; i < idtr.size; i+=(sizeof(InterruptDescriptor_t))) {
|
||||
|
||||
for(int i = 0; i < num_interrupts; i++) {
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void load_idt() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue