[comp.binaries.ibm.pc.d] Program needed

eretherf@mcs.kent.edu (Eric Von Retherford) (06/03/91)

Hello,     
     I am in need of a program that will reboot my machine via a dos command.
     Is there one that is avail ftp? Is it so small that someone can send me
     the source?

     Thanks for your help

     Eric Von Retherford

     Please reply by E-mail.

raymond@math.berkeley.edu (Raymond Chen) (06/04/91)

A quick search of the SIMTEL20 index (searching for the word `reboot')
yields

Directory PD1:<MSDOS.C>
REBOOT.C      A     995  900218  How to do a warm or cold boot in 'C' language
Directory PD1:<MSDOS.SYSUTL>
REBOOT.ARC    B    5394  880214  Forces system reset
TMBOOTV2.ARC  B   10358  891210  Reboots computer at a specified time

This output was extracted from the email you would have received by
sending the message `lookup /reboot/i' to the comp.sys.ibm.pc.misc
server at rjc@math.princeton.edu; please consult the monthly
Frequently Asked Questions file (coming soon) for instructions.

Note also that the topic of software-induced reboots is discussed
in question 2.3 of the Frequently Asked Questions file.

ralphs@seattleu.edu (Ralph Sims) (06/04/91)

eretherf@mcs.kent.edu (Eric Von Retherford) writes:


> I am in need of a program that will reboot my machine via a dos command.

Would a statement in a batch file work?  Or, make a batch file containing:

echo g=ffff:0 |debug >nul

Give it a try.
--
  The 23:00 News and Mail Service - +1 206 292 9048 - Seattle, WA USA
                           PEP, V.32, V.42
                  +++ A Waffle Iron, Model 1.64 +++

rickc@agora.rain.com (Rick Coates) (06/04/91)

In article <Zu0y33w164w@halcyon.uucp> halcyon!ralphs@seattleu.edu (Ralph Sims) writes:
>eretherf@mcs.kent.edu (Eric Von Retherford) writes:
>
>
>> I am in need of a program that will reboot my machine via a dos command.
>
>Would a statement in a batch file work?  Or, make a batch file containing:
>
>echo g=ffff:0 |debug >nul
>
>Give it a try.
>--
>  The 23:00 News and Mail Service - +1 206 292 9048 - Seattle, WA USA
>                           PEP, V.32, V.42
>                  +++ A Waffle Iron, Model 1.64 +++

This works, but it does a cold boot (reset).  Does anyone out there know
the magic to cause a warm boot?  It's the same thing, except if a certain
memory location has the right contents, the memory test, etc. is bypassed.
This bit of PC lore was on the net once, but I managed to lose it.

Many thanks in advance,

Rick Coates    rickc@agora.rain.com   ...!tektronix!tessi!agora!rickc
Contract HW/SW engineer (Graphics - Sun - ASIC design - imbedded systems)

ts@uwasa.fi (Timo Salmi) (06/04/91)

In article <1991Jun3.155821.10694@mcs.kent.edu> eretherf@mcs.kent.edu (Eric Von Retherford) writes:
:
>     I am in need of a program that will reboot my machine via a dos command.
>     Is there one that is avail ftp? Is it so small that someone can send me

/pc/ts/tsutld18.arc

...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

valley@gsbsun.uchicago.edu (Doug Dougherty) (06/04/91)

rickc@agora.rain.com (Rick Coates) writes
	(in regard to ways of causing a jump to FFFF:0) :

>This works, but it does a cold boot (reset).  Does anyone out there know
>the magic to cause a warm boot?  It's the same thing, except if a certain
>memory location has the right contents, the memory test, etc. is bypassed.
>This bit of PC lore was on the net once, but I managed to lose it.

You (Rick) should probably follow up on the various utility packages
that people have suggested, since they contain the answers to these and
many many more questions.  However, for a warm boot, I favor the
following implementation:

	pop ds
	mov word [472],1234
	jmp ffff:0
--

	(Another fine mess brought to you by valley@gsbsun.uchicago.edu)

iisakkil@vipunen.hut.fi (Mika R Iisakkila) (06/05/91)

rickc@agora.rain.com (Rick Coates) writes:

> This works, but it does a cold boot (reset).  Does anyone out there know
> the magic to cause a warm boot?  It's the same thing, except if a certain

Here's a small Turbo C program I wrote a long time ago. No assembler.

#include <dos.h>
#include <string.h>
#include <stdio.h>

void far (*boot)() = MK_FP(0xffff,0x0000);

void usage(void) {

    puts("Usage: boot [/c] [/w]");
    puts("Options:  /c  cold boot");
    puts("          /w  warm boot (default)");
    exit(1);
}

main(int argc, char **argv) {

    char coldboot = 0;

    while(argc > 1) {
        switch(*argv[1]) {
          case '/':
          case '-':
            switch(argv[1][1]) {
              case 'c':
              case 'C':
                coldboot = 1;
                break;
              case 'w':
              case 'W':
                coldboot = 0;
                break;
              default:
                usage();
            }
            break;
          default:
            usage();
        }
        argc--;
        argv++;
    }

    *((unsigned int far *)(MK_FP(0x0040, 0x0072))) = coldboot ? 0 : 0x1234;
    boot();
}

campbell@cutmcvax.cs.curtin.edu.au (Trevor George Campbell CC361) (06/07/91)

valley@gsbsun.uchicago.edu (Doug Dougherty) writes:

>rickc@agora.rain.com (Rick Coates) writes
>	(in regard to ways of causing a jump to FFFF:0) :

>>This works, but it does a cold boot (reset).  Does anyone out there know
>>the magic to cause a warm boot?  It's the same thing, except if a certain
>>memory location has the right contents, the memory test, etc. is bypassed.
>>This bit of PC lore was on the net once, but I managed to lose it.

>You (Rick) should probably follow up on the various utility packages

>	pop ds
>	mov word [472],1234
>	jmp ffff:0
>--

>	(Another fine mess brought to you by valley@gsbsun.uchicago.edu)

Don't you think you have left out some code (ie: what the hell is pop ds going
to achieve ?????)

and the memory location that you wish the MAGIC NUMBER  1234  to go into is
Seg:Off of 40:72  ( both in hex ) and [472] is not the same without ds
being set to 0000 first .......


--
Trevor          alias  <**<TOMCAT>**>

tuo em tel esaelP ,lanimret siht edisni kcuts m`I pleH



(
for all of you out there who can't read backwards.....
Help i'm stuck inside this terminal, Please let me out
)

raymond@math.berkeley.edu (Raymond Chen) (06/07/91)

In article <campbell.676287660@cutmcvax>, campbell@cutmcvax (Trevor George Campbell CC361) writes:
>Don't you think you have left out some code (ie: what the hell is pop ds going
>to achieve ?????)

Tee hee.  POP DS sets DS=0.  Try to figure out why.

valley@gsbsun.uchicago.edu (Doug Dougherty) (06/08/91)

raymond@math.berkeley.edu (Raymond Chen) writes:

>In article <campbell.676287660@cutmcvax>, campbell@cutmcvax (Trevor George Campbell CC361) writes:
>>Don't you think you have left out some code (ie: what the hell is pop ds going
>>to achieve ?????)

>Tee hee.  POP DS sets DS=0.  Try to figure out why.

Heh heh heh.  The jaws of the newuser trap are open wide...
--

	(Another fine mess brought to you by valley@gsbsun.uchicago.edu)