Many code changes, many undocumented. Documentation and cleanup is next. Fixed a lot of bugs related to IDT structure. Changed the IDT paradigm to be dynamically written isntead of statically to account for nobits on that section. Also added a gdb remote debugger automatic script, for simplicity in debugging.
26 lines
515 B
C
26 lines
515 B
C
#ifndef IDT_H
|
|
#define IDT_H
|
|
#include <stdint.h>
|
|
|
|
typedef struct InterruptDescriptor_s {
|
|
uint16_t offset_lo;
|
|
uint16_t selector;
|
|
uint8_t reserved;
|
|
uint8_t attributes;
|
|
uint16_t offset_hi;
|
|
} InterruptDescriptor_t;
|
|
|
|
typedef struct IDTR_s {
|
|
uint16_t size;
|
|
InterruptDescriptor_t* IDT;
|
|
} __attribute__((packed)) IDTR_t;
|
|
|
|
extern IDTR_t idtr;
|
|
extern InterruptDescriptor_t idt_start;
|
|
extern unsigned char num_interrupts;
|
|
|
|
void setup_idt();
|
|
void write_descriptors();
|
|
extern void load_idt();
|
|
|
|
#endif
|