July 19, 2004

Reboot.com file for rebooting from the dos prompt

WinDrivers Computer Tech Support Forums

Start DEBUG by typing the following at the MS-DOS command prompt: debug

At the dash prompt, enter the following sequence of commands, each followed by pressing ENTER. (Comments are preceded by ";".)
A 100 ; Debug instruction for assemble
MOV AH,0D ; Disk Reset
INT 21h ; causes SmartDrv 4.x to write cache
MOV AX, 40 ; set up segment addressing
MOV DS, AX
DS:
OR BYTE PTR [17],0C ; equivalent of pressing CTRL ALT
MOV AX,4F53 ; Issue a "DEL" (53h = DEL scan code)
INT 15h ; EMM386 sees this & shuts down
DS:
MOV WORD PTR [72],1234 ; Set REBOOT flag to Warm-Boot (0=cold)
JMP F000:FFF0 ; Execute the internal restart routine
; This line must be blank (just hit ENTER)
R CX
20 ; File size to be written to disk (in hex)
N REBOOT.COM ; Filename
W ; Write the file to disk
Q ; Quit Debug

NOTE: The REBOOT.COM file created with this debug script is compatible with SMARTDrive and its write-behind cache feature. The instructions in REBOOT.COM cause SMARTDrive to write (flush) its write-behind cache to disk before the computer is rebooted.

This procedure creates the file REBOOT.COM in the current directory. At this point, you can call the file in the same manner as any other executable file, either from the command line or within a batch file, and the system will reboot

Posted by jshare at July 19, 2004 05:05 PM
| TrackBack
Comments

a cisc. if the x86 was a risc, this would be 5x as long :)

Posted by: mike at July 19, 2004 05:18 PM
Post a comment









Remember personal info?