Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 18:48:07 -0400 (EDT)
From:      Robert LaThanh <hybrid@ugrad.cs.jhu.edu>
To:        freebsd-questions@freebsd.org
Subject:   Rebooting CPU via Keyboard Controller
Message-ID:  <Pine.GSO.4.05.10105281846200.28707-100000@barley.cs.jhu.edu>

next in thread | raw e-mail | index | archive | help
I just spent about two days trying to figure out why my system would not
reset upon issuing a reboot command. That is, it would hang at
"Rebooting...". My system is an HP Brio 7113N, Intel Celeron 300a with
256MB RAM.

I tried all kinds of things, changing every setting in my BIOS, removing
devices (hard drives, NIC), and even whether different versions of
FreeBSD could reboot with different BIOS settings -- I used to be
running 4.1 and it could reboot fine, then I just did a fresh install of
4.3 and then it couldn't.

Kernel option BROKEN_KEYBOARD_RESET didn't help; the keyboard reset code
wasn't causing problems, it just wasn't working.

Two days of troubleshooting later, I decided to try the the Linux
approach of pulsing the keyboard reset line instead of just tapping it
once. In src/sys/i386/i386/vm_machdep.c::cpu_reset_real() instead of
hitting 0x64 once and waiting, I have it hit 100 times. Here's the
simple change I made and my computer now reboots instead of hanging at
"Rebooting...":

src/sys/i386/i386/vm_machdep.c
485d484
<       int i;
505,509c504,505
<       for (i=0; i<100; i++) { /* Pulse the keyboard reset line */
<               DELAY(50);
<               outb(IO_KBD + 4, 0xFE);
<               DELAY(50);
<       }
---
>       outb(IO_KBD + 4, 0xFE);
>       DELAY(500000);  /* wait 0.5 sec to see if that did it */

Is there any reason that this shouldn't be implemented in the FreeBSD
kernel, I don't see any potential harm it could cause and it may help at
least a few, if not many, people with reset problems.

Robert LaThanh


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.05.10105281846200.28707-100000>