From fa29b378b4f02fc72b6f8fee7838800371f17297 Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Thu, 21 Feb 2002 20:26:48 +0000 Subject: [PATCH] - commit patch from Dave Poirier to fix Bug #490570: OUTB set and command 0xaa encountered --- bochs/iodev/keyboard.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bochs/iodev/keyboard.cc b/bochs/iodev/keyboard.cc index 7eaafd19a..593f81700 100644 --- a/bochs/iodev/keyboard.cc +++ b/bochs/iodev/keyboard.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: keyboard.cc,v 1.44 2002-01-29 17:20:11 vruppert Exp $ +// $Id: keyboard.cc,v 1.45 2002-02-21 20:26:48 bdenney Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -70,7 +70,7 @@ bx_keyb_c::bx_keyb_c(void) memset( &s, 0, sizeof(s) ); BX_KEY_THIS put("KBD"); BX_KEY_THIS settype(KBDLOG); - BX_DEBUG(("Init $Id: keyboard.cc,v 1.44 2002-01-29 17:20:11 vruppert Exp $")); + BX_DEBUG(("Init $Id: keyboard.cc,v 1.45 2002-02-21 20:26:48 bdenney Exp $")); } bx_keyb_c::~bx_keyb_c(void) @@ -110,7 +110,7 @@ bx_keyb_c::resetinternals(Boolean powerup) void bx_keyb_c::init(bx_devices_c *d, bx_cmos_c *cmos) { - BX_DEBUG(("Init $Id: keyboard.cc,v 1.44 2002-01-29 17:20:11 vruppert Exp $")); + BX_DEBUG(("Init $Id: keyboard.cc,v 1.45 2002-02-21 20:26:48 bdenney Exp $")); Bit32u i; BX_KEY_THIS devices = d; @@ -339,6 +339,7 @@ bx_keyb_c::write( Bit32u address, Bit32u value, unsigned io_len) UNUSED(this_ptr); #endif // !BX_USE_KEY_SMF Bit8u command_byte; + static int kbd_initialized=0; if (io_len > 1) BX_PANIC(("kbd: io write to address %08x, len=%u", @@ -479,6 +480,12 @@ bx_keyb_c::write( Bit32u address, Bit32u value, unsigned io_len) break; case 0xaa: // motherboard controller self test BX_DEBUG(("Self Test")); + if( kbd_initialized == 0 ) + { + BX_KEY_THIS s.controller_Qsize = 0; + BX_KEY_THIS s.kbd_controller.outb = 0; + kbd_initialized++; + } // controller output buffer must be empty if (BX_KEY_THIS s.kbd_controller.outb) { BX_ERROR(("kbd: OUTB set and command 0x%02x encountered", value));