*BSD News Article 13930


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: my bug list
Message-ID: <1993Apr2.183806.28616@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <DERAADT.93Mar25200858@newt.fsa.ca> <1993Mar30.003656.2601@fcom.cc.utah.edu> <CGD.93Mar30021341@erewhon.CS.Berkeley.EDU>
Date: Fri, 2 Apr 93 18:38:06 GMT
Lines: 73

In article <CGD.93Mar30021341@erewhon.CS.Berkeley.EDU> cgd@erewhon.CS.Berkeley.EDU (Chris G. Demetriou) writes:
>just a couple of questions...
>
>In article <1993Mar30.003656.2601@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
>>You can't do a device/slot reset on an ISA bus.  In order to cause a real
>>reset, you have to drop out of protected mode and hit the keyboard soft
>>reset code.  This is not necessarily possible on all ISA machines due to
>>the way one has to drop out of protected mode generally causes a reset --
>>and the BIOS is relied upon (incorrectly, for your machine) to issue a
>>bus reset as part of this.
>
>i don't understand this.  _what_ about dropping out of protected mode
>causes a reset?  (that's what your statement says, unless i misread it...)

The method most frequently used to drop out of protected mode *also*
frequently (but not always!) causes a reset.  In 386BSD, this is apparently
used *as if* it were actually reset code.

>i've yet to understand why 386bsd doesn't use the standard
>keyboard-controller method of resetting the CPU.

This should probably be used in the case of a successful drop-out, but is
apparently not used in the current implementation.  This is only a half
soloution to the problem of resetting, since only in the case of the
blow-up-to-drop-out method not causing a reset will a useful reset actually
occur.  Bletch!

>things like windows (obviously) can drop out of protected mode,
>without causing a reset, and i think that it *IS* valid to be able to expect
>386bsd to be able to do the same.   should be possible, at worst,
>by making the physical and virtual mappings of some part of the kernel
>match, being in that part, dropping out of protected mode, and then
>immediately using the keyboard controller reset method.
>this double mapping could take place right before reboot,
>or could even be done (as a hack) for *everything* -- a process's
>zero-page shouldn't be accessible to it anyway, and this would
>be a reasonable thing to put it in, if necessary...

Right; this is what I arrived at.  It would take disassembly of either a
portion of Windows or HighSoft C's crt0 for me to personally arrive at,
something I have little incentive to do right now.  Obviously, it *is*
possible to be reasonable about dropping out of protected mode.

One potential bottleneck is that we have to save the locore info from
DOS/BIOS to enable us to run the keyboard reset.  This is already done
on Linux to facilitate their DOS emulator; right now 386BSD doesn't
standardly load above 1M, so locore vectors and potential BIOS shadowing
needed for DOS mulation (actually, simply an 8086 virtual machine), *and*
the keyboard reset on some machines are not saved.  Basically, without a
soft reset vector in locore, you don't get to do a soft reset.  Makes
sense, really.

>regardless of other points (i think that device shutdown routines
>are a good idea), the keyboard controller method is IMO (i make no
>claims of humility 8-) the correct way to reboot a PC, and causing
>the CPU to fault itself it death isn't...

Agreed; that it would incidently buy us DOS (8086) emulation (if we had
an 8086 BIOS lying around; there's a PD one somewhere on the net) and the
ability to load larger kernels is bonus.  The fault-to-reset is grim.


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------