Added code to setup and build the IDT. Updated the Bochs' configuration file to allow break points to be set and did some general code clean-up.

This commit is contained in:
2020-08-06 15:20:45 -05:00
parent d8071c0eac
commit 9fe73abe53
15 changed files with 453 additions and 19 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef IDT_H
#define IDT_H
struct idt_entry
{
unsigned short base_lo;
unsigned short sel; /* Our kernel segment goes here. */
unsigned char always0;
unsigned char flags;
unsigned short base_hi;
} __attribute__((packed));
struct idt_ptr
{
unsigned short size;
struct idt_entry* idt_entries_start;
} __attribute__((packed));
void install_idt(void);
void idt_set_gate(struct idt_entry*, unsigned long, unsigned short, unsigned char);
void load_idt(struct idt_ptr*);
#endif