From 0b6ab8416e50dcbf790163282f461647e180dbc6 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Sun, 3 Sep 2006 17:34:09 +0000 Subject: don't send keyboard interrupts to the second cpu, if we have only one cpu. xv6 seems to work fine on uniprocessor now. --- console.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'console.c') diff --git a/console.c b/console.c index 1a64122..438e332 100644 --- a/console.c +++ b/console.c @@ -365,8 +365,9 @@ console_read(int minor, char *dst, int n) acquire(&kbd_lock); - while(kbd_w == kbd_r) + while(kbd_w == kbd_r) { sleep(&kbd_r, &kbd_lock); + } while(n > 0 && kbd_w != kbd_r){ *dst = (kbd_buf[kbd_r]) & 0xff; @@ -392,7 +393,7 @@ console_init() devsw[CONSOLE].d_write = console_write; devsw[CONSOLE].d_read = console_read; - ioapic_enable (IRQ_KBD, 1); + ioapic_enable (IRQ_KBD, 0); use_console_lock = 1; } -- cgit v1.2.3