dude PLEASE i dont want to implement ISRs dude PLEASEEEEE

I did set up all of the stuff around it tho. Gotta implement some
handlers.
This commit is contained in:
lordtet 2025-06-12 01:19:59 -04:00
parent 3b2503a187
commit d32c1fab63
4 changed files with 47 additions and 3 deletions

View file

@ -40,11 +40,25 @@ typedef struct tss_s {
extern tss_t tss;
void clear_tss();
//IDT
// GDT
typedef struct InterruptDescriptor_s {
uint16_t offset_1;
uint16_t selector;
uint8_t reserved;
uint8_t attributes;
uint16_t offset_2;
} InterruptDescriptor_t;
typedef struct IDTR_s {
uint16_t size;
InterruptDescriptor_t* IDT;
} IDTR_t;
extern IDTR_t idtr;
void setup_idt();
void write_descriptors();
void load_idt();
#endif

View file

@ -21,6 +21,7 @@ SECTIONS
{
*(.rodata*)
*(.gdt_sect)
*(.idtr)
}
/*initialized rw data. */
@ -34,5 +35,6 @@ SECTIONS
{
*(COMMON)
*(.bss)
*(.idt)
}
}

15
src/idt.s Normal file
View file

@ -0,0 +1,15 @@
global idtr
section .idtr
idtr:
dw idt_end - idt_start
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.
idt_end:
;Sigh... ISRs essentially MUST be insanely verbose.

View file

@ -1,7 +1,20 @@
/* kdtables.c
* Kernel Descriptor Tables
*
* Contains GDT, LDT, and any relevant functions and structs pertaining to them
* Contains GDT, IDT, and any relevant functions and structs pertaining to them
*/
#include "kdtables.h"
void setup_idt() {
write_descriptors();
load_idt();
}
void write_descriptors() {
}
void load_idt() {
}