[comp.os.msdos.programmer] rebooting by a command, not by Ctrl-Alt-del or power off/on

ping@cubmol.bio.columbia.edu (Shiping Zhang) (01/10/91)

I'm not sure if this group is the right one for my question. I want to
know how to reboot an IBM pc not by Ctrl-Alt-del, power off/on, or
pressing the reset button methods. In other words, is there a command
I can issue to reboot the machine, or is there way to write a command
in C to reboot the machine. Thanks for any information.

-ping   ping@cubmol.bio.columbia.edu (128.59.128.3)

bank@lea.ncsu.edu (Dave The DM) (01/19/91)

In article <1991Jan10.013850.3506@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes:
>I'm not sure if this group is the right one for my question. I want to
>know how to reboot an IBM pc not by Ctrl-Alt-del, power off/on, or
>pressing the reset button methods. In other words, is there a command
>I can issue to reboot the machine, or is there way to write a command
>in C to reboot the machine. Thanks for any information.
>
>-ping   ping@cubmol.bio.columbia.edu (128.59.128.3)

   If you want something "off-the-shelf" then check out PC Magazine's
DOS Powertools book. Has a program called WARMBOOT.COM that will do
exactly what you want. Also has COLDBOOT.COM to simulate a power-off

reboot.

   If you want to do-it-yourself, any good BIOS reference or PC
tech reference will give you the necessary information. I probably
have it somewhere around here, but its likely buried under a lot of
garbage and I'm too laze to look...:-) 

Dave the DM
bank@lea.csc.ncsu.edu

mhr@ccicpg.UUCP (MHR {who?}) (01/22/91)

In <1991Jan18.234616.18063@ncsuvx.ncsu.edu>, bank@lea.ncsu.edu writes:
> In article <1991Jan10.013850.3506@cubmol.bio.columbia.edu> ping@cubmol.bio.columbia.edu (Shiping Zhang) writes:
> >I'm not sure if this group is the right one for my question. I want to
> >know how to reboot an IBM pc not by Ctrl-Alt-del, power off/on, or
> >pressing the reset button methods. In other words, is there a command
> >I can issue to reboot the machine, or is there way to write a command
> >in C to reboot the machine. Thanks for any information.
> >
> >-ping   ping@cubmol.bio.columbia.edu (128.59.128.3)
> 
> Dave the DM
> bank@lea.csc.ncsu.edu

Here is the assembly language code for both warm and cold boot
simulators.  I trust that translating into C wouldn't be too difficult
for your particular compiler....

warm boot:
	MOV	AX,0040
	MOV	DS,AX
	MOV	AX,1234
	MOV	[0072],AX
	JMP	FFFF:0000

cold boot:
	JMP	FFFF:0000

This was posted not so long ago to one of these comp.os.msdos.* news
groups (thank you, whoever originally posted it) and I have both
assembled into .COM files, and they work.  You can even construct them
using DEBUG, if you know how (remember to set the CX register before
writing).

Have a nice day :-) !

-- 
Mark A. Hull-Richter    UUCP:     ccicpg!mhr    Clever remark stolen from
ICL North America       InterNet: [coming soon]      another netter:
9801 Muirlands Blvd                             Go ahead, flame me. I have
Irvine, CA  92713       (714)458-7282x4539      a /dev/null on my machine.

tbrown@lehi3b15.csee.Lehigh.EDU (Thomas Brown [901015]) (01/22/91)

I've uploaded COLD.COM and WARM.COM to the /pub directory of
wuarchive.wustl.edu.  They will execute a cold boot (with memory
test), or a warm (Ctl-Alt-Del) restart.

-Tom
--=--
Thomas Brown, KA2UGQ          BITNET: twb0@lehigh.bitnet
Lehigh University UC Box 855    ARPA: tbrown@lehi3b15.csee.Lehigh.EDU
Bethlehem, PA  18015            UUCP: ..!uunet!twb0@lehigh.bitnet
(215) 758-0093                 AX.25: ka2ugq@ka2ugq.nj.usa.na

'You can't have everything...where would you put it?' -S.W.

ts@uwasa.fi (Timo Salmi) (01/23/91)

In article <1357@lehi3b15.csee.Lehigh.EDU> tbrown@lehi3b15.csee.Lehigh.EDU (Thomas Brown [901015]) writes:
>I've uploaded COLD.COM and WARM.COM to the /pub directory of
>wuarchive.wustl.edu.  They will execute a cold boot (with memory
>test), or a warm (Ctl-Alt-Del) restart.
:
>'You can't have everything...where would you put it?' -S.W.

This one is in /pc/ts/tsutld18.arc at uwasa.fi archives.

WARMBOOT (Ver. 1.0)  Reboot without memory tests
===================

Reboot your PC as if alt-crtl-del had been pressed.

Usage: WARMBOOT [/b] [/e] [/n] [/t]
      batch mode -+    !    !    !
              execute -+    !    !
           no confirmation -+    !
test only, don't actually reboot-+

If there are errors, errorlevel is set to 1 for batch usage.

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

bsrdp@warwick.ac.uk (Hylton Boothroyd) (01/25/91)

In article <12503@ccicpg.UUCP> mhr@ccicpg.UUCP (MHR {who?}) writes:
> > > I want to know how to reboot an IBM pc not by Ctrl-Alt-del, power
> > > off/on, or pressing the reset button methods. In other words, is
> > > there a command I can issue to reboot the machine
> > > -ping   ping@cubmol.bio.columbia.edu (128.59.128.3)
> >
> > bank@lea.csc.ncsu.edu
>
> Here is the assembly language code for both warm and cold boot
> simulators.
>
> warm boot:
> 	MOV	AX,0040
> 	MOV	DS,AX
> 	MOV	AX,1234
> 	MOV	[0072],AX
> 	JMP	FFFF:0000
>
> cold boot:
> 	JMP	FFFF:0000

Note that this advice depends on having:
        * a true blue IBM PC,
	* a clone in which the manufacturer's implementatation of BIOS
	  code has emulated the true blue behaviour at FFFF:0000 .
There appears to have been a period when some manufacturers felt it
wiser not to emulate IBM warm boot too closely for fear of copyright
action. The clone I use falls into that category.
--
Hylton Boothroyd        Janet: h.boothroyd@uk.ac.warwick.cu
Warwick Business School Darpa: h.boothroyd%cu.warwick.ac.uk@relay-nsfnet.ac.uk
University of Warwick   Uucp:  h.boothroyd@warwick.uucp
COVENTRY, England       Earn/Bitnet: h.boothroyd%uk.ac.warwick.cu@UKACRL

ckaye@hemel.bull.co.uk (Chris Kaye) (01/26/91)

bsrdp@warwick.ac.uk (Hylton Boothroyd) writes:

>In article <12503@ccicpg.UUCP> mhr@ccicpg.UUCP (MHR {who?}) writes:
>> > > I want to know how to reboot an IBM pc not by Ctrl-Alt-del, power
>> > > off/on, or pressing the reset button methods. In other words, is
>> > > there a command I can issue to reboot the machine
>> > > -ping   ping@cubmol.bio.columbia.edu (128.59.128.3)
>> >
>> > bank@lea.csc.ncsu.edu
>>
>> Here is the assembly language code for both warm and cold boot
>> simulators.
>>
>> warm boot:
>> 	MOV	AX,0040
>> 	MOV	DS,AX
>> 	MOV	AX,1234
>> 	MOV	[0072],AX
>> 	JMP	FFFF:0000
>>
>> cold boot:
>> 	JMP	FFFF:0000

>Note that this advice depends on having:
>        * a true blue IBM PC,
>	* a clone in which the manufacturer's implementatation of BIOS
>	  code has emulated the true blue behaviour at FFFF:0000 .
>There appears to have been a period when some manufacturers felt it
>wiser not to emulate IBM warm boot too closely for fear of copyright
>action. The clone I use falls into that category.
>--
>Hylton Boothroyd        Janet: h.boothroyd@uk.ac.warwick.cu
>Warwick Business School Darpa: h.boothroyd%cu.warwick.ac.uk@relay-nsfnet.ac.uk
>University of Warwick   Uucp:  h.boothroyd@warwick.uucp
>COVENTRY, England       Earn/Bitnet: h.boothroyd%uk.ac.warwick.cu@UKACRL

Here is a 'C' version of a reboot program.
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  rb.c
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'rb.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rb.c'\"
else
echo shar: Extracting \"'rb.c'\" \(384 characters\)
sed "s/^X//" <<'END_OF_FILE' | ascbin >'rb.c'
X/*
X * Program to reboot PC.
X *
X * Arguments: nothing for cold reboot
X *            anything for warm reboot
X */
Xint far *loc = (int far *)0x472;
X
Xvoid (far *reboot)() = { (void (far *)()) 0xffff0000 };
X
Xvoid main(argc,argv)
Xchar **argv;
Xint argc;
X{
X	if (argc>1)
X		*loc = 0x1234; /* warm boot */
X	else
X		*loc = 0x0000; /* cold boot */
X	reboot();
X	/* Should not get here */
X	exit(0);
X}
END_OF_FILE
if test 384 -ne `wc -c <'rb.c'`; then
    echo shar: \"'rb.c'\" unpacked with wrong size!
fi
# end of 'rb.c'
fi
echo shar: End of shell archive.
exit 0
--
-----------------------------+
Chris.Kaye@hemel.bull.co.uk  |
Bull HN Ltd., Maxted Road,   |
Hemel Hempstead, HP2 7DZ, UK |
-----------------------------+

resnicks@netcom.UUCP (Steve Resnick) (01/29/91)

In article <1991Jan26.122142.9747@hemel.bull.co.uk> ckaye@hemel.bull.co.uk (Chris Kaye) writes:
>bsrdp@warwick.ac.uk (Hylton Boothroyd) writes:
>
>>In article <12503@ccicpg.UUCP> mhr@ccicpg.UUCP (MHR {who?}) writes:
>>> > > I want to know how to reboot an IBM pc not by Ctrl-Alt-del, power
>>> > > off/on, or pressing the reset button methods. In other words, is
>>> > > there a command I can issue to reboot the machine
>>> > > -ping   ping@cubmol.bio.columbia.edu (128.59.128.3)
>>> >
>>> > bank@lea.csc.ncsu.edu
>>>
>>> Here is the assembly language code for both warm and cold boot
>>> simulators.
>>>
>>> warm boot:
>>> 	MOV	AX,0040
>>> 	MOV	DS,AX
>>> 	MOV	AX,1234
>>> 	MOV	[0072],AX
>>> 	JMP	FFFF:0000
>>>
>>> cold boot:
>>> 	JMP	FFFF:0000
>
>>Note that this advice depends on having:
>>        * a true blue IBM PC,
>>	* a clone in which the manufacturer's implementatation of BIOS
>>	  code has emulated the true blue behaviour at FFFF:0000 .
>>There appears to have been a period when some manufacturers felt it
>>wiser not to emulate IBM warm boot too closely for fear of copyright
>>action. The clone I use falls into that category.

Waitaminit! The code at FFFF:0000 *HAS* to reboot the computer. This is
the address where the 8086 fetches the fisrt instruction on reset. 
If the code there cannot reboot the computer, something is *VERY* wrong
with the computer, or it is not an iAPX processor. 

By the way, folks, I have been reading this newsgroup for a number of years,
and this question comes up about once every 6 weeks. This information is
in the FAQ (Frequently Asked Questions) list and Ralf Brown's Interrupt List.
 
Steve

-- 
-------------------------------------------------------------------------------
resnicks@netcom.com, apple!camphq!105!steve.resnick, IFNA:	1:143/105.0, 
USNail: 530 Lawrence Expressway, Suite 374 
        Sunnyvale, Ca 94086
- In real life: Steve Resnick. Flames, grammar and spelling errors >/dev/null
0x2b |~ 0x2b, THAT is the question.
-------------------------------------------------------------------------------

bsrdp@warwick.ac.uk (Hylton Boothroyd) (01/29/91)

> > > [ assembly language code for both warm and cold boot ending
> > > 	JMP	FFFF:0000 ]
>
> > Note that this advice depends on having:
> >     * a true blue IBM PC,
> >	* a clone in which the manufacturer's implementatation of BIOS
> >	  code has emulated the true blue behaviour at FFFF:0000 .
> > There appears to have been a period when some manufacturers felt it
> > wiser not to emulate IBM warm boot too closely for fear of copyright
> > action.
>
> Waitaminit! The code at FFFF:0000 *HAS* to reboot the computer. This
> is the address where the 8086 fetches the first instruction on
> reset.  If the code there cannot reboot the computer, something is
> *VERY* wrong with the computer, or it is not an iAPX processor.

In effect, the true blue behaviour offers a method of avoiding full
cold boot at FFFF:0000 before going on to the required behaviour. Not all
clones offer the true blue avoidance mechanism. And although that is
occasionally annoying, there is nothing very wrong with them!

Hylton
--
Hylton Boothroyd        Janet: h.boothroyd@uk.ac.warwick.cu
Warwick Business School Darpa: h.boothroyd%cu.warwick.ac.uk@relay-nsfnet.ac.uk
University of Warwick   Uucp:  h.boothroyd@warwick.uucp
COVENTRY, England       Earn/Bitnet: h.boothroyd%uk.ac.warwick.cu@UKACRL