Added code to support getting interrupts from the PIC. Can now get some data from the keyboard, however, it's not quite working yet.
This commit is contained in:
+15
-3
@@ -4,6 +4,8 @@
|
||||
#include "../includes/serial.h"
|
||||
#include "../includes/screen.h"
|
||||
#include "../includes/loader.h"
|
||||
#include "../includes/pic.h"
|
||||
#include "../includes/kb.h"
|
||||
|
||||
struct multiboot_header header __attribute((section(".multiboot"))) = (struct multiboot_header) {.magic = 0x1BADB002, .flags = 0x1, .checksum = -464367619};
|
||||
|
||||
@@ -26,9 +28,14 @@ void kmain()
|
||||
print_message("Installing IDT...\n", 0xF, 0x0);
|
||||
idt_install();
|
||||
print_message("IDT installed.\n", 0xF, 0x0);
|
||||
|
||||
int i = 5 / 0;
|
||||
asm("hlt");
|
||||
//asm("xchg %bx, %bx"); // Boch's break point
|
||||
setup_pics();
|
||||
//kb
|
||||
init_kb();
|
||||
//asm("xchg %bx, %bx");
|
||||
asm("sti");
|
||||
//for(;;);
|
||||
idle();
|
||||
}
|
||||
|
||||
void print_message(unsigned char* msg, unsigned char fg, unsigned char bg)
|
||||
@@ -36,3 +43,8 @@ void print_message(unsigned char* msg, unsigned char fg, unsigned char bg)
|
||||
write_to_com(COM1_PORT, msg);
|
||||
draw_string(msg, fg, bg);
|
||||
}
|
||||
|
||||
void idle()
|
||||
{
|
||||
for(;;) asm("hlt");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user