mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-04-01 09:50:29 +08:00
显示键盘按下
This commit is contained in:
14
07_day/int.c
14
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)
|
||||
|
||||
Reference in New Issue
Block a user