[comp.os.msdos.misc] Warm or cold boot?

np4@prism.gatech.EDU (POMPONIO,NICHOLAS A) (01/31/91)

How can a program determine whether the latest boot was warm or cold?



-- 
POMPONIO,NICHOLAS A
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!np4
Internet: np4@prism.gatech.edu

cd5340@mars.njit.edu (Charlap) (01/31/91)

In article <20816@hydra.gatech.EDU> np4@prism.gatech.EDU (POMPONIO,NICHOLAS A) writes:
>How can a program determine whether the latest boot was warm or cold?
>
>
 
Well, mine can.  When the mouse driver is loaded, my modem dies completely,
requiring a hard-reset to fix it.  So, I can just try to communicate with
the modem.  If it fails, it wasn't a coldboot.  (of course, if I load the
mouse driver after a coldboot, the modem is still dead...)

--- David Charlap (cd5340@mars.njit.edu)

hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg) (02/02/91)

cd5340@mars.njit.edu (Charlap) writes:

>In article <20816@hydra.gatech.EDU> np4@prism.gatech.EDU (POMPONIO,NICHOLAS A) writes:
>>How can a program determine whether the latest boot was warm or cold?
> 
>Well, mine can.  When the mouse driver is loaded, my modem dies completely,
>requiring a hard-reset to fix it.  So, I can just try to communicate with
>the modem.  If it fails, it wasn't a coldboot.  (of course, if I load the
>mouse driver after a coldboot, the modem is still dead...)

A ram disk driver that I have can determine this too.
When it was a cold boot it installs the ram disk. When not
I get a message there is not enough memory available.

I guess that the driver notices that the extended memory is already
in use because it was not cleared by the memory test that runs
at cold-boot. 

Hs perhaps gives us a hint: write something to a memory location
where it does not disturb important things and is not overwritten
by other programs either. What about installing a TSR that searches 
for a copy of itself when being installed and returning an error
code when it finds one. If someone finds an easier solution please
let me know.
-- 
---------------------------------------------------------------
Klaus Hartnegg, Kleist-Str. 7, D-7835 Teningen, Germany
Bitnet : HAKL@DFRRUF1, Internet : HAKL@ibm.ruf.uni-freiburg.de
X.400  : G=klaus;S=hartnegg;OU=ibm;OU=ruf;P=uni-freiburg;A=dbp;C=de