Commit 64f3eeb7 by malcolm

Keyboard scancode support

parent 404da71e
Showing with 26 additions and 0 deletions
#include "io.h"
#include "pic.h"
#include "serial.h"
#include "idt.h"
void kbd_irq()
{
serial_hexword(inb(0x60));
pic_command(0, PIC_OCW2_EOI);
}
void io_init()
{
install_c_ir(33, kbd_irq);
}
#ifndef _IO_INC
#define _IO_INC
void kbd_irq();
void io_init();
#endif
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include "multiboot.h" #include "multiboot.h"
#include "pic.h" #include "pic.h"
#include "pit.h" #include "pit.h"
#include "io.h"
// The parameters passed here ultimately come through the bootloader // The parameters passed here ultimately come through the bootloader
void kernel_main(multiboot_info* mbt, uint32_t magic) void kernel_main(multiboot_info* mbt, uint32_t magic)
{ {
...@@ -29,6 +31,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic) ...@@ -29,6 +31,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
disable_int(); disable_int();
pic_init(0x20,0x28); pic_init(0x20,0x28);
pit_init(); pit_init();
io_init();
pit_start_counter(100, PIT_OCW_CONT_0, PIT_OCW_MODE_SQWVGEN); pit_start_counter(100, PIT_OCW_CONT_0, PIT_OCW_MODE_SQWVGEN);
enable_int(); enable_int();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment