[ros-diffs] [fireball] 24744: Dmitry G. Gorbachev: After kbd controller init, the System Flag should be set to 1. Fixes rebooting on real hardware (famous "Flushing cache" hang). See issue #1842 for more details.

fireball at svn.reactos.org fireball at svn.reactos.org
Mon Nov 13 13:40:03 CET 2006


Author: fireball
Date: Mon Nov 13 15:40:02 2006
New Revision: 24744

URL: http://svn.reactos.org/svn/reactos?rev=24744&view=rev
Log:
Dmitry G. Gorbachev: After kbd controller init, the System Flag should be set to 1.

Fixes rebooting on real hardware (famous "Flushing cache" hang).
See issue #1842 for more details.

Modified:
    trunk/reactos/drivers/input/i8042prt/i8042prt.c

Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/i8042prt.c?rev=24744&r1=24743&r2=24744&view=diff
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/i8042prt.c (original)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.c Mon Nov 13 15:40:02 2006
@@ -599,6 +599,7 @@
 static NTSTATUS STDCALL I8042Initialize(PDEVICE_EXTENSION DevExt)
 {
 	NTSTATUS Status;
+	UCHAR Value = 0;
 
 	Status = I8042BasicDetect(DevExt);
 	if (!NT_SUCCESS(Status)) {
@@ -630,6 +631,32 @@
 	if (DevExt->MouseExists) {
 		DPRINT("Mouse detected\n");
 		I8042MouseEnable(DevExt);
+	}
+
+	/*
+	 * Some machines do not reboot if SF is not set.
+	 */
+	if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_READ_MODE)) {
+		DPRINT1("Can't read i8042 mode\n");
+		return Status;
+	}
+
+	Status = I8042ReadDataWait(DevExt, &Value);
+	if (!NT_SUCCESS(Status)) {
+		DPRINT1("No response after read i8042 mode\n");
+		return Status;
+	}
+
+	Value |= CCB_SYSTEM_FLAG;
+
+	if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
+		DPRINT1("Can't set i8042 mode\n");
+		return Status;
+	}
+
+	if (!I8042Write(DevExt, I8042_DATA_PORT, Value)) {
+		DPRINT1("Can't send i8042 mode\n");
+		return Status;
 	}
 
 	return STATUS_SUCCESS;




More information about the Ros-diffs mailing list