Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rebooting machine

0 views
Skip to first unread message

grae...@vms.cis.pitt.edu

unread,
May 17, 1996, 3:00:00 AM5/17/96
to


Okay, I'm sure this is all oldhat for you, but I'm trying to find the DOS
command to reboot a machine. Does it exist for 6.x?

Thanks,

Stacey

Alexander J Russell

unread,
May 18, 1996, 3:00:00 AM5/18/96
to

In article <4nid4i$h...@usenet.srv.cis.pitt.edu>, grae...@vms.cis.pitt.edu
says...
/*

reboot.c

Internet: ale...@icebox.iceonline.com
Copyright 1994, September 18 by Alec Russell, ALL rights reserved

Created - 1994/9/18

History:
New file - stolen from the internet

*/

#define TEST 0

/* #define MAGIC 0 /* for cold restart */
#define MAGIC 0x1234 /* for warm restart */

#define BOOT_SEG 0xffffL
#define BOOT_OFF 0x0000L
#define BOOT_ADR ((BOOT_SEG << 16) | BOOT_OFF)

#define DOS_SEG 0x0040L
#define RESET_FLAG 0x0072L
#define RESET_ADR ((DOS_SEG << 16) | RESET_FLAG)

void reboot(void)
{
void ((far *fp)()) = (void (far *)()) BOOT_ADR;

*(int far *)RESET_ADR = MAGIC;
(*fp)();

}


#if TEST


/* ---------------------- main() --------------------- September 18,1994 */
void main(void)
{
printf("Press a key to WARM BOOT\n");
getch();

reboot();
}

#endif

/* ------------------------------ EOF -------------------------------- */

--
The AnArChIsT! Anarchy! Not Chaos!
aka
Alex Russell
ale...@iceonline.com


Timo Salmi

unread,
May 18, 1996, 3:00:00 AM5/18/96
to

In article <4nid4i$h...@usenet.srv.cis.pitt.edu>,
<grae...@vms.cis.pitt.edu> wrote:
:Okay, I'm sure this is all oldhat for you, but I'm trying to find the DOS
:command to reboot a machine. Does it exist for 6.x?

57716 Mar 29 1996 ftp://garbo.uwasa.fi/pc/doc-net/dosfv206.zip
dosfv206.zip comp.os.msdos.programmer Frequently Asked Questions, J.Carlyle

98471 Apr 28 1996 ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
tsfaqp.zip Common Turbo Pascal Questions and Timo's answers

87050 Oct 5 1994 ftp://garbo.uwasa.fi/pc/ts/tsutld22.zip
tsutld22.zip Timo's 4th utility set (bigcurs,keyrate,caps,today,warmboot,...)

All the best, Timo

....................................................................
Prof. Timo Salmi Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
t...@uwasa.fi http://uwasa.fi/~ts BBS 961-3170972; FIN-65101, Finland

Phil Majtan

unread,
May 19, 1996, 3:00:00 AM5/19/96
to

In <4nid4i$h...@usenet.srv.cis.pitt.edu> grae...@vms.cis.pitt.edu
writes:
>
>
>
>Okay, I'm sure this is all oldhat for you, but I'm trying to find the
DOS
>command to reboot a machine. Does it exist for 6.x?
>
>Thanks,
>
>Stacey

I have never seen a reboot 'command' for any version of MS-DOS. You
could write a program to do that for you - that's easy. You can evendo
it in DEBUG. Maybe other brands came with one.

Phil


Charles Dye

unread,
May 19, 1996, 3:00:00 AM5/19/96
to
>Okay, I'm sure this is all oldhat for you, but I'm trying to find the DOS
>command to reboot a machine. Does it exist for 6.x?

To the best of my knowledge, there has never been an official MS- or IBM
DOS command to reboot the system. Here's a DEBUG script you can use
to create such a command. Type in the lines below, between the double
bars, as a file named RBOOT.SCR. Don't leave out the blank line before
"R CX" -- it's important. Assemble this little program by typing
DEBUG <RBOOT.SCR. The program will successfully reboot most
IBM-compatible machines, and it will correctly flush the disk buffers
and cache to avoid corrupting your hard drive.

ras...@indirect.com

========================================
a 100
mov ah,0d ; dos function 0d: flush disk buffers
int 21 ; this will also dump smartdrive cache
mov bx,1234
mov ax,0040
mov es,ax
es:
mov [0072],bx ; set for warm boot
mov al,fe
out 64,al ; attempt to pulse hardware reset line
mov ax,0000
; 0118:
dec ax ; delay loop: wait for reset signal
cmp ax,0000
jnz 0118 ; still going? hardware reset failed,
jmp f000:fff0 ; jump to bios reset code

r cx
0023
n rboot.com
w
q
========================================

Henrik Bäärnhielm

unread,
May 19, 1996, 3:00:00 AM5/19/96
to

> In article <4nid4i$h...@usenet.srv.cis.pitt.edu>, grae...@vms.cis.pitt.edu wrote:
> >
> >Okay, I'm sure this is all oldhat for you, but I'm trying to find the DOS
> >command to reboot a machine. Does it exist for 6.x?

Well, it's very easy to write a program that makes a warmboot. At least,
in assembly language. I don't know exactly how to do in c/c++ or pascal
butI think it's the same routine. You just call interrupt 19h (hex).
here is a short asm-source that reboots the computer. Assemble and link
it and see what happens.

DOSSEG
.MODEL TINY
.STACK 5h
.CODE
START:
int 19h
END START

--
***************************************
Internet : Henrik.B...@abc.se
Fidonet : Henrik Baarnhielm, 2:201/235
***************************************

Gertjan Klein

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

In article <319F8F...@abc.se>,

Henrik Bäärnhielm <Henrik.B...@abc.se> wrote:
> In article <4nid4i$h...@usenet.srv.cis.pitt.edu>,
> grae...@vms.cis.pitt.edu wrote:

>> Okay, I'm sure this is all oldhat for
>> you, but I'm trying to find the DOS command to reboot a machine. Does it
>> exist for 6.x?

> Well, it's very easy to write a program that makes a warmboot. At least,
> in assembly language. I don't know exactly how to do in c/c++ or pascal
> butI think it's the same routine. You just call interrupt 19h (hex).

Here we go again. Why doesn't anybody bother to read the FAQ _before_
posting either questions that are answered there, or incorrect nonsense
in response to these questions? Int 19h does _not_ reboot the machine,
it merely reloads the OS, which is not the same. Read the FAQ on why it
shouldn't be used, and how you _can_ reboot the machine.

Gertjan.

--
Gertjan Klein <gkl...@xs4all.nl>

Gertjan Klein

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

In article <4nq98e$2...@news.xs4all.nl>, Gertjan Klein <gkl...@xs4all.nl> wrote:

> Here we go again. Why doesn't anybody bother to read the FAQ _before_
> posting either questions that are answered there, or incorrect nonsense
> in response to these questions? Int 19h does _not_ reboot the machine,
> it merely reloads the OS, which is not the same. Read the FAQ on why it
> shouldn't be used, and how you _can_ reboot the machine.

Oops - I should have looked better at the newsgroup header, as the
comp FAQ, although it _does_ explain how to reboot a PC properly,
doesn't go into the problems with int 19h. Sorry about that. The
comp.lang.asm.x86 and alt.lang.asm FAQ sais the following:

31.4 JUST USING INT 19H

Using this interrupt alone will only reload the operating system onto a
computer system that may not be properly initialized for it. The interrupt
vectors are not reset but the TSRs that have hooks into the interrupt table
may be overwritten. Obviously, this can lead to the system hanging if one
of these hooked and overwritten interrupts is called. Other problems can
be timers not reset or add-on cards not reinitialized properly. So, do NOT
use int 19h to reboot the computer.

Laszlo

unread,
May 21, 1996, 3:00:00 AM5/21/96
to lasz...@verifone.com

From 1988 Ziff Communications Co. in uuencoded format. It decodes to
128 bytes of which most are the prompt and copyright notice.
The program displays:
Warm or Cold boot (W/C)? -- or Esc to abort:

It has worked on DOS 3.3 through DOS 6.x

end

Ziv

unread,
May 21, 1996, 3:00:00 AM5/21/96
to

On 17 May 96 13:30:49 EDT, grae...@vms.cis.pitt.edu wrote:

>
>
>Okay, I'm sure this is all oldhat for you, but I'm trying to find the DOS
>command to reboot a machine. Does it exist for 6.x?
>

>Thanks,
>
>Stacey

Hi
PCMagazine collection of utilities include coldboot and warmboot
( I believe these are .com files)
I'm sure you can find these and many more in simtel and the like.
Ziv

Simon Hosie

unread,
May 24, 1996, 3:00:00 AM5/24/96
to

Phil Majtan:

> I have never seen a reboot 'command' for any version of MS-DOS. You
> could write a program to do that for you - that's easy. You can evendo
> it in DEBUG. Maybe other brands came with one.

You can write one from the command line:

echo <Alt-234><space><space><Alt-253><Alt-253> >REBOOT.COM

but it'll be lacking in a few vital features (flushing disk cache, etc).

Toni Antero Tiainen

unread,
May 27, 1996, 3:00:00 AM5/27/96
to

In article <4o3elj$f...@airdmhor.gen.nz>,
Simon Hosie <gum...@airdmhor.gen.nz> wrote:

> You can write one from the command line:
>
> echo <Alt-234><space><space><Alt-253><Alt-253> >REBOOT.COM
>
>but it'll be lacking in a few vital features (flushing disk cache, etc).

Alternately, you can use int 19h to perform a warm boot without reset.
It reads the boot sector into memory and continues the boot process
from that point on.

--
--Toni Tiainen tit...@tukki.jyu.fi
' The light at the end of the tunnel is an ongoing train '
- Terry Pratchett

James Vahn

unread,
May 27, 1996, 3:00:00 AM5/27/96
to

Toni Antero Tiainen (tit...@kanto.cc.jyu.fi) wrote:
: > You can write one from the command line:
: > echo <Alt-234><space><space><Alt-253><Alt-253> >REBOOT.COM
:
: Alternately, you can use int 19h to perform a warm boot without reset.


No! Too Simple!! Memory is cheap- USE IT!!


;-------------------------
; REBOOT.ASM v2317.56.1beta
; Flush routines from T.Arheit, 'oh no!!' routine from D.Kirschbaum ;-)

cseg segment
assume cs:cseg,ds:cseg
org 100h

Begin:
mov ah,9 ;say goodbye..
mov dx,offset msg
int 21h

mov cx,100d ;close everything in sight
Close_Lup: ;Loop to close first 100 possible
mov ah,03Eh ;open files.
mov bx,cx
int 21h
loop Close_Lup

mov ax,5D01h ;Flush buffers and update directory
mov dx,offset Params ;entries. This call may have problems
int 21h ;under OS/2 and DR-DOS..

mov ah,0Dh ;DOS flush file buffers.
int 21h ;Most cache programs catch this call.

mov ah,21h ;flush for QCASHE
int 13h

mov ah,0A1h ;flush for PC Kwik, PC-Cache v5
mov si,4358h ;Qcache v4
int 13h

mov ax,0FFA5h ;flush for PC-Cache v6+
mov cx,0DDDDh
int 16h

mov ax,0FE03h ;flush for Norton Utilities NCACHE
mov di,"NU"
mov si,"CF"
int 2Fh

mov ax,4A10h ;flush for SMARTDRV v4.00+ -API
mov bx,0002h
int 2Fh

mov ax,0DE0Ch ;attempt to shutdown QEMM
int 67h
;-----------------
; Flushed. On with the resetting..
;
mov ax,40h ;Set ES to BIOS data area.
mov es,ax
mov word ptr es:[72h],1234h ;Remove this for cold boot.

;-----------------
; First attempt at a reset. If 15/4F isn't supported, hopefully
; no harm will come.
;
mov dl,byte ptr es:[17h]
or byte ptr es:[17h],0Ch ;Simulates CTRL-ALT-DEL
mov ax,4F53h ;on some machines. PS/2?
int 15h
mov byte ptr es:[17h],dl

;-----------------
; Second attempt. This jumps to 'Beep' via the CMOS shutdown byte
; and resets via the 8042 keyboard interface chip if present.
;
mov word ptr es:[69h],ax ;Prepare BIOS for PM
mov word ptr es:[67h],offset Beep ; style reset.
mov al,0Fh
out 70h,al
call Delay
mov al,0Ah ;Set CMOS for BIOS JMP.
out 71h,al
call Delay
mov al,0FEh ;Reset via 8042
out 64h,al
call Delay

;------------------
; Failed.. No 8042! Ye olde standard reboot. If CMOS is present,
; this will also jump to Beep.

db 0EAh,0h,0h,0FFh,0FFh ;jmp FFFF:0000

;------------------
; Delay routine
;
Delay:

out 4Fh,al
ret

;------------------
; If successful, the CMOS shutdown byte will cause a jump to here,
; making a tone and resetting via a triple exception error.
;
Beep:

mov ax,0E07h ; Make a Beep.
int 10h

mov al,0B6h ; Make another Beep.
out 43h,al
in al,61h
or al,3h
out 61h,al
mov al,82h
out 42h,al
mov al,9h
out 42h,al
mov cx, 02000h
lo2: out 4Fh,al
loop lo2
.286p
lidt fword ptr cs:Table ; Triple fault CPU reset
int 0
Table df 0
msg db 'Oh no!!!$'
Params db 0 ; Dynamic, 22 bytes.

cseg ends
end Begin

---eof---

Bernardo Reino

unread,
May 28, 1996, 3:00:00 AM5/28/96
to

On 27 May 1996, Toni Antero Tiainen wrote:

> In article <4o3elj$f...@airdmhor.gen.nz>,
> Simon Hosie <gum...@airdmhor.gen.nz> wrote:
>

[ ... ]


>
> Alternately, you can use int 19h to perform a warm boot without reset.

> It reads the boot sector into memory and continues the boot process
> from that point on.
>
> --
> --Toni Tiainen tit...@tukki.jyu.fi
> ' The light at the end of the tunnel is an ongoing train '
> - Terry Pratchett
>

int 19h will work only if you have your system in a clean state,
without memory managers, or resident programs that could activate while
rebooting. This is because int 19h, doesn't initialize interrupts, so
your int 8 handler (for example) could activate, and jump to a place in
memory that doesn't contain the ISR anymore. Anyway, it is not
recommended.

Bernardo Reino <uc...@cclx1.unican.es>

PS: Of course, if your memory manager is able to detect int 19h, and
change it to a soft reboot or something similar, it will actually work;
but this method is particular to your system and you cannot expect it to
work on different config's.


Steve Jones

unread,
May 28, 1996, 3:00:00 AM5/28/96
to tit...@kanto.cc.jyu.fi

tit...@kanto.cc.jyu.fi (Toni Antero Tiainen) wrote:
>In article <4o3elj$f...@airdmhor.gen.nz>,
>Simon Hosie <gum...@airdmhor.gen.nz> wrote:
>
>> You can write one from the command line:
>>
>> echo <Alt-234><space><space><Alt-253><Alt-253> >REBOOT.COM

Geez that's slick.

> Alternately, you can use int 19h to perform a warm boot without reset.
> It reads the boot sector into memory and continues the boot process
> from that point on.
>

I caution strongly against using INT 19h as a "reboot" service. INT 19h
is not a reboot service. It is a hook, called by the BIOS, to execute
ROM extensions that have hooked it. There are situations where these
ROM extensions are not prepared to receive control twice from INT 19h,
or are not prepared to do so after the system has achieved steady state.

While this may work on plenty of desktop machines, there are systems out
there with ROM extensions on them that will not reboot when you issue an
INT 19h, but will hang or do something random like INT 13h's instead.
Avoid the technique and use a far JMP to F000:FFF0, with interrupt disabled,
and a proper boot indicator in the BIOS data area. Or, on machines with
port 92h, toggle bit 0 from a 0 to a 1 to reboot the machine.

--
Steve Jones
GENERAL SOFTWARE, INC.
ste...@gensw.com | http://www.gensw.com/general
"Award winning system software for embedded and consumer electronics"

Simon Hosie

unread,
May 31, 1996, 3:00:00 AM5/31/96
to

Simon Hosie <gum...@airdmhor.gen.nz> wrote:
> You can write one from the command line:
>
> echo <Alt-234><space><space><Alt-253><Alt-253> >REBOOT.COM

Steve Jones:
> Geez that's slick.

'twas part of an escape sequence that I stuck in somebody's AUTOEXEC at
Polytech last year.

echo ESC["q";27;"prompt $e[0;30m$e[2J";13;"echo <blarg>";13;"reboot";13pESC[A

If that's correct (and I can't be bothered verifying it), then it'll
reboot their machine every time they type a lowercase Q at the DOS prompt.

tit...@kanto.cc.jyu.fi (Toni Antero Tiainen) wrote:
> Alternately, you can use int 19h to perform a warm boot without reset.
> It reads the boot sector into memory and continues the boot process
> from that point on.

Damn, just when I thought that I'd told every single individual on the net
_NOT_TO_USE_INT_19_TO_REBOOT_THE_COMPUTER_BECAUSE_IT'S_NOT_RELIABLE_
somebody else suggests it.


Steve Jones:

Charles Dye

unread,
Jun 2, 1996, 3:00:00 AM6/2/96
to

In article <4odvht$5...@short.circuit.com>, jv...@short.circuit.com (James Vahn) wrote:
>
>No! Too Simple!! Memory is cheap- USE IT!!
>
>;-------------------------
>; REBOOT.ASM v2317.56.1beta
>; Flush routines from T.Arheit, 'oh no!!' routine from D.Kirschbaum ;-)
>
> [trim]

>
> mov cx,100d ;close everything in sight
>Close_Lup: ;Loop to close first 100 possible
> mov ah,03Eh ;open files.
> mov bx,cx
> int 21h
> loop Close_Lup
> [clip]

Very nice; much more portable than the more simplistic answers
I've seen here. But what do you hope to accomplish by closing
file handles you've never opened? (I don't believe you can close
other program's files this way; the handles refer to your own JFT,
right?)

ras...@indirect.com

0 new messages