diff options
Diffstat (limited to 'devices')
-rw-r--r-- | devices/pic.h | 1 | ||||
-rw-r--r-- | devices/pic_8259.c | 11 | ||||
-rw-r--r-- | devices/ps2_keyboard.c | 9 | ||||
-rw-r--r-- | devices/vga.c | 4 |
4 files changed, 23 insertions, 2 deletions
diff --git a/devices/pic.h b/devices/pic.h index 685a85b..c545c60 100644 --- a/devices/pic.h +++ b/devices/pic.h @@ -1,4 +1,5 @@ #pragma once void pic_init(); +void pic_enable(); void pic_clear(unsigned char irq); diff --git a/devices/pic_8259.c b/devices/pic_8259.c index 74c576a..62164d3 100644 --- a/devices/pic_8259.c +++ b/devices/pic_8259.c @@ -1,4 +1,5 @@ #include "pic.h" +#include <sys/control.h> #include <sys/io.h> #define PIC1 0x20 @@ -28,8 +29,18 @@ pic_init() outb(ICW4_8086, PIC2 + DATA); // PIC masks + outb(0xff, PIC1 + DATA); + outb(0xff, PIC2 + DATA); +} + +void +pic_enable() +{ + // PIC masks outb(0xfc, PIC1 + DATA); outb(0xff, PIC2 + DATA); + + enable_interrupts(); } void diff --git a/devices/ps2_keyboard.c b/devices/ps2_keyboard.c index e5af423..4ebcc65 100644 --- a/devices/ps2_keyboard.c +++ b/devices/ps2_keyboard.c @@ -1,4 +1,5 @@ #include "ps2_keyboard.h" +#include "vga.h" #include <stdint.h> #include <stdio.h> #include <sys/io.h> @@ -50,6 +51,14 @@ ps2_keyboard_irq_handler() case 0xb6: // right shift up shift_case = 0; return; + + case 0x5b: // left meta + case 0x5c: // right meta + return; + + case 0x58: // F12 + vga_clear(VGA_COLOR_LIGHT_BLUE, VGA_COLOR_LIGHT_GREY); + return; } if (key >= 0x80) return; diff --git a/devices/vga.c b/devices/vga.c index 908bd5e..93231ea 100644 --- a/devices/vga.c +++ b/devices/vga.c @@ -20,7 +20,7 @@ void vga_init() { buffer = (struct VGAEntry *)0xc03ff000; - // vga_enable_cursor(0, 15); + vga_enable_cursor(0, 15); vga_clear(VGA_COLOR_LIGHT_BLUE, VGA_COLOR_LIGHT_GREY); } @@ -35,7 +35,7 @@ vga_clear(enum vga_color foreground, enum vga_color background) buffer[index].background = background; } col = row = 0; - // vga_update_cursor(); + vga_update_cursor(); } void |