Re: reBoot code: can we detect if there is an AT keyboard controller?



John Baldwin wrote:
On Wednesday 14 November 2007 02:53:01 pm Billy Newsom wrote:
AFAIK, the FreeBSD kernel still relies on a 90s codebase for rebooting... It uses the keyboard controller reset method to do a warm reboot.

I have had trouble with this method over the years... a Pentium Pro and more recently a Mac Pro with no keyboard controller. I have speculated that Mac laptops and blade servers would also lack the KBC. If Intel continues their progress of dropping deprecated hardware, the KBC could disappear in the next 3 to 5 years.

So could there be some intelligent software code to check the presence of this device, and if not present, use the alternate reboot? The ACPI reboot sequence, for example, works for FreeBSD 6.2 and later, on my Mac Pro quad Xeon, amd64.

Unfortunately, although the kernel detects the presence of a KBC during boot, it doesn't seem that this information gets stored as a global variable for later use. (I made this assertion a few times at freebsd-stable.) It seems like the logical course is to only reboot the keyboard controller if such a thing exists!!

Looking back at my notes and my previous research, it appears that the code is around where you can find the cpu_reset code near...

/* "good night, sweet prince .... <THUNK!>" */

Setting hw.acpi.handle_reboot=1 must bypass that. Could we force the use of this tunable when it's obvious that the KBC is missing?

Actually, I recently updated the reboot code to try several other sequences
besides just the keyboard controller such as flipping reset bits in I/O
ports 0xcf9 and 0x92. Also, when I did the update I also fixed a bug in
the triple-fault last-effort that had caused it to not actually cause a
triple-fault. As a result, you might be able to reboot just fine now on
newer stable w/o the tunable if you have this commit:

revision 1.259.2.6
date: 2007/04/30 17:45:44; author: jhb; state: Exp; lines: +40 -6
MFC: Various fixes to cpu_reset_real()
- Try to use the reset control register (I/O port 0xcf9) and the fast a20
and init register (I/O port 0x92) if the keyboard reset fails.
- Fix the triple fault to actually work when PGE is enabled.

Great. Thanks John for working on this code... It was looking pretty grungy after about 10 years! Wouldn't William Shakespeare be proud.

I will do an update to 6.2-stable and put that drive back into my Mac Pro and see what happens without the kernel tunable. My Mac Pro, is, um, well, running another operating system or two right now. <sheepish grin>

One comment is that my Mac system wasn't FAILING to reboot, it was panicking with a Trap 12, I believe. My last attempt on that system was around 2/20/2007 perhaps, so my memory lapses.

Billy

_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: avi file wont delete
    ... Pro) have used the "unlock" program to see if the file is locked but all ... success with that on older Windows boxes where delete didn't work.) ... The router works as expected and even the Dell XP Pro box works ... It didn't just not delete it on reboot but informed me that it could not be deleted even before the reboot. ...
    (rec.video.desktop)
  • RE: Jump Drive not recognized as drive on laptop, using XP Pro
    ... where others offered assistance, and somebody found the solution for me. ... then "saw" the devices and asked me to reboot again afterwhich everything ... Yesterday, I asked a question on how to upgrade XP Home to XP Pro, because ...
    (microsoft.public.windowsxp.hardware)
  • Re: reBoot code: can we detect if there is an AT keyboard controller?
    ... keyboard controller reset method to do a warm reboot. ... the KBC could disappear in the next 3 to 5 years. ... besides just the keyboard controller such as flipping reset bits in I/O ...
    (freebsd-arch)
  • Re: Frustrated: Promise Controller wont work on motherboard
    ... :> the XP Pro has CD disc errors. ... just download an ISO of XP Pro and burn that and use that. ... Then XP proceeded to "repair" and reboot. ... Home and install XP there and had XP reformat that partition. ...
    (comp.sys.ibm.pc.hardware.storage)
  • Re: Spontaneous Rebooting XP: Error Codes included
    ... > Any thoughts as to why an XP Pro SP 2 system would start to ... > My daughter's system started to spontaneously reboot itself ... > Logs\SUKURA.ldb" was corrupt and has been copied to ... > Alarm Pro Security Center. ...
    (microsoft.public.windowsxp.general)

Loading