From 3625edddc34872317d613b35467f447fe683dbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 13 Aug 2015 16:51:40 +0000 Subject: [PATCH] [NTVDM] - Improve PS/2 keyboard initialization in BIOS POST. - Forgot two "breaks;" in error code paths. svn path=/trunk/; revision=68707 --- reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c | 6 ++++-- reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c b/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c index 19b621096e2..611e5c82099 100644 --- a/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c +++ b/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c @@ -779,11 +779,13 @@ static VOID BiosHwSetup(VOID) /* Initialize PS/2 keyboard port */ // Enable the port IOWriteB(PS2_CONTROL_PORT, 0xAE); - IOWriteB(PS2_CONTROL_PORT, 0x60); // Port interrupts and clock enabled, // enable keyboard scancode translation. // POST passed, force keyboard unlocking. - IOWriteB(PS2_DATA_PORT , 0x4D); + IOWriteB(PS2_CONTROL_PORT, 0x60); + IOWriteB(PS2_DATA_PORT , 0x6D); + // Enable data reporting + IOWriteB(PS2_DATA_PORT , 0xF4); EnableHwIRQ(0, BiosTimerIrq); } diff --git a/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c b/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c index 7d1a07cd0ad..8aff4f11846 100644 --- a/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c +++ b/reactos/subsystems/mvdm/ntvdm/bios/bios32/moubios32.c @@ -223,7 +223,7 @@ VOID BiosMousePs2Interface(LPWORD Stack) SendMouseCommand(0xFF); Answer = ReadMouseData(); - /* A "Resend" (0xFE) signal is sent if no mouse is attached */ + /* A "Resend" signal (0xFE) is sent if no mouse is attached */ if (Answer == 0xFE) { /* Resend */ @@ -376,6 +376,7 @@ VOID BiosMousePs2Interface(LPWORD Stack) /* Failure */ setAH(0x03); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + break; } setBL(ReadMouseData()); // Status @@ -399,6 +400,7 @@ VOID BiosMousePs2Interface(LPWORD Stack) /* Failure */ setAH(0x03); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + break; } /* Success */ @@ -490,7 +492,7 @@ VOID MouseBios32Post(VOID) /* Detect mouse presence by attempting a reset */ SendMouseCommand(0xFF); Answer = ReadMouseData(); - /* If no mouse attached, it will return RESEND (0xFE) */ + /* A "Resend" signal (0xFE) is sent if no mouse is attached */ if (Answer == 0xFE) { DPRINT1("No mouse present!\n");