[comp.sys.ibm.pc] reboot program

vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn) (08/07/88)

Could someone please mail me C source for a warm boot program, or tell
me how to roll my own?  I assume it's easy enough to do.

Thanks.


-- 
O---------------------------------------------------------------------->
| Cliff Joslyn, Cybernetician at Large
| Systems Science, SUNY Binghamton, vu0112@bingvaxu.cc.binghamton.edu
V All the world is biscuit shaped. . .

hollen@tsunami.megatek.uucp (Dion Hollenbeck) (08/08/88)

From article <1355@bingvaxu.cc.binghamton.edu>, by vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn):
> 
> Could someone please mail me C source for a warm boot program, or tell
> me how to roll my own?  I assume it's easy enough to do.
> 
It is not real easy in C (maybe even impossible), however, in the debugger,
it is real simple.  Enter debug and assemble in memory

- a100


MOV  AX,0ffffh		B8ffff
PUSH AX			50
MOV  AX,0		B80000
PUSH AX			50

stop assembling at this point because the next instruction
cannot be assembled in, use the 'enter' function of debug.


- e108      (this is the next available location)

cb <RETURN>

now name the file and save to disk

- rcx
9 <RETURN>

- reboot.com
- w
- q

The result is an executable which will fool the '86 into jumping form
where it is to the cold boot jump and absolute address 0ffff0.  You could
do all this with an assembler, but with debug is the most time-efficient.
If you do it with an assembler BE SURE to use a FAR PROCEDURE to get
the assembler to generate a FAR return which will pluck both the CS and
IP off the stack and effectively do the fFAR jump.



	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

                                seismo!s3sun!megatek!hollen
                                ames!scubed/

daveg@hpcvlx.HP.COM (Dave Guggisberg) (08/09/88)

I guess it is not too hard to do it in C.  Although I
think it is more efficient to do it in assembler or
through debug as previously shown.

main ()
{
  void (far *bye) ();
  int far *pt;

  pt = ((int far *) (0x0000472L);
  *pt = 0x1234;                    /* for warm boot */
  /*  *pt = 0x0000;  */           /* for cold boot */

  bye = (void far *) 0x0ffff0000L;
  (*bye) ();
}

daveg@hp-pcd

davidsen@steinmetz.ge.com (William E. Davidsen Jr) (08/10/88)

In article <1355@bingvaxu.cc.binghamton.edu> vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn) writes:
| 
| Could someone please mail me C source for a warm boot program, or tell
| me how to roll my own?  I assume it's easy enough to do.

  Since you haven't gotten an answer, let me give you a quick way to get
a cold boot as a program. I'm not sure why you want this...

C>debug
-A100
xxxx:100 JMP FFFF:0
xxxx:105
-RCX
CX 0000 5
-ncoldboot.com
-w
Writing 5 bytes
-q
C>coldboot

This will create a file called coldboot which will do a boot of the
machine when called. There's a jump vector for warm boot, but I can't
find it. Hope this helps until someone else digs out the correct
vector or address.

-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

alvidrez@heathcliff (Jeff Alvidrez) (08/11/88)

In article <1355@bingvaxu.cc.binghamton.edu> vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn) writes:
> 
> Could someone please mail me C source for a warm boot program, or tell
> me how to roll my own?  I assume it's easy enough to do.
>

I noticed that a lot of people followed up with a COLD boot program, while
the request was for a WARM boot program.

I assume that by warm boot you mean that you do not want to go through the
POST (Power On Self Test) process, so you should use the bootstrap
interrupt:

#include <dos.h>

main()
{
	geninterrupt(0x19);
}

In Turbo C; I assume MSC has a similar macro.

If you know MASM then you can avoid all the C program initialization code
and generate a 2 byte .COM file.  I am not sure if Turbo C's Tiny memory
model achieves the same thing.

/jra

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Jeff Alvidrez
alvidrez@heathcliff.cs.columbia.edu

The opinions expressed in this article are fictional.  Any resemblence
they may bear to real opinions (especially those of Columbia University)
is purely coincidental.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

svirsky@ttidca.TTI.COM (William Svirsky) (08/13/88)

In article <1355@bingvaxu.cc.binghamton.edu> vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn) writes:
>
>Could someone please mail me C source for a warm boot program, or tell
>me how to roll my own?  I assume it's easy enough to do.
>

Posted earlier this year:

From: wtm@neoucom.UUCP (Bill Mayhew)
Subject: Re: ???=>reBoot from a batch file?????
Summary: The BIOS warm boot magic-cookie trick

If you jump into the the BIOS with location 0040:0072H set to the
magic quatity of 1234H, and jump to the entry point of the BIOS,
the system will perform a warm boot (i.e., no power-on self-test,
etc.).  Putting anything else in that memory location will force a
cold boot.

You can use DEBUG to enter the following sequence and save the
result as WARMBOOT.COM:

The blank line in the script below is necessary to get out of
assemble mode!

---------------------- cut here -------------------------
a 0
mov ax,0040
mov ds,ax
mov ax,1234
mov [0072],ax
jmp f000:fff0

r cx
16
n warmboot.com
w
q
---------------------- end of script ---------------------


Clip the above section out and save it in a text file.  Then, redirect
the text file into DEBUG thusly:  debug < file.txt.  This will
automatically feed the commands in and create warmboot.com.  Of
course, you can always type the same sequence manually from your
keyboard.  INT 19H is brain damaged on most clone computers.  I've
yet to find a machine that the above method won't work on.

--Bill
  wtm@neouocm.UUCP
-- 
Bill Svirsky, Citicorp+TTI, 3100 Ocean Park Blvd., Santa Monica, CA 90405
Work phone: 213-450-9111 x2597
svirsky@ttidca.tti.com | ...!{csun,psivax,rdlvax,retix}!ttidca!svirsky

vu0112@bingvaxu.cc.binghamton.edu (Cliff Joslyn) (08/14/88)

Thanks to all.  I eventually used Dave Guggisbergs C source which works
fine compiled in Turbo.  Jeff Alvidrez suggested using
'geninterrupt(0x19)' by itself, which generated strange behavior.  I got
what appeared to be the beginning of a warm boot (floppy light on for
what appeared to be a reasonable length of time), but without a cleared
screen or ROM message.  Then the machine hanged. 

-- 
O---------------------------------------------------------------------->
| Cliff Joslyn, Cybernetician at Large
| Systems Science, SUNY Binghamton, vu0112@bingvaxu.cc.binghamton.edu
V All the world is biscuit shaped. . .