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
+14 -4
View File
@@ -1,7 +1,11 @@
#include "../includes/io.h"
#include "../includes/gdt.h"
#include "../includes/idt.h"
#include "../includes/serial.h"
#include "../includes/screen.h"
#include "../includes/loader.h"
struct multiboot_header header __attribute((section(".multiboot"))) = (struct multiboot_header) {.magic = 0x1BADB002, .flags = 0x1, .checksum = -464367619};
void kmain()
{
@@ -39,9 +43,15 @@ void kmain()
draw_string("Installing GDT...\n", 0xF, 0x0);
write_to_com(COM1_PORT, "Installing the GDT.\n");
gdt_install();
move_cursor(0, 4);
write_to_com(COM1_PORT, "GDT installed.\n");
draw_string("Installed GDT\n", 0xf, 0x0);
//move_cursor(0, 4);
//asm("xchg %bx, %bx");
//write_to_com(COM1_PORT, "GDT installed.\n");
//asm("xchg %bx, %bx"); // Boch's break point
//draw_string("Installed GDT\n", 0xf, 0x0);
//asm("xchg %bx, %bx");
idt_install();
write_to_com(COM1_PORT, "IDT installed.\n");
int i = 5 / 0;
asm("hlt");
}