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:
+14
-4
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user