From d933d9b5816ddaaa72b572285f24153a470abd66 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Wed, 17 Sep 2014 10:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=AE=E7=9B=98=E6=8C=89?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07_day/int.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/07_day/int.c b/07_day/int.c index ad7176e..708d97d 100644 --- a/07_day/int.c +++ b/07_day/int.c @@ -28,11 +28,15 @@ void inthandler21(int *esp) /* 来自PS/2键盘的中断 */ { struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; - boxfill8(binfo->vram, binfo->scrnx, COL8_000000, 0, 0, 32 * 8 - 1, 15); - putfonts8_asc(binfo->vram, binfo->scrnx, 0, 0, COL8_FFFFFF, "INT 21 (IRQ-1) : PS/2 keyboard"); - for (;;) { - io_hlt(); - } + unsigned char data, s[4]; + io_out8(PIC0_OCW2, 0x61); /* IRQ-01受付完了をPICに通知 */ + data = io_in8(PORT_KEYDAT); + + sprintf(s, "%02X", data); + boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); + putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16, COL8_FFFFFF, s); + + return; } void inthandler2c(int *esp)