home *** CD-ROM | disk | FTP | other *** search
-
- REBOOTING YOUR COMPUTER IN SOFTWARE
-
- Sometimes it is convenient to reboot your computer from a batch file. Like
- when you need a certain version of AUTOEXEC.BAT and CONFIG.SYS to run a
- particular program, but don't want to do all the copy statements and then
- reboot by hand every time.
-
- Here are two programs I wrote (although I'm sure many have written identical
- programs in the past) that will do a warm or cold boot on any IBM or clone
- from the 8088 to the 80486. Maybe they're not the best computer company
- around, but they sure have backward compatibility down!
-
- The assembler listing for COLDBOOT.COM is shown below.
-
- TITLE COLDBOOT
- _TEXT SEGMENT
- ASSUME CS:_TEXT,DS:_TEXT,SS:_TEXT
- ORG 100H
- BEGIN:
- JMP 0FFFFH:0000 ; EA 00 00 FF FF
- _TEXT ENDS
- END BEGIN
-
- Many assemblers will not handle a direct intersegment jump. The easiest way
- to make this into a *.COM file is to use DEBUG and write the program directly
- in machine code. Enter the following commands:
-
- debug
- -e cs:100 ;type in the hex codes shown above at cs:100
- ;hit <enter> when finished
- -u 100 ;check and make sure you typed correctly
- -r cx ;set cx register to number of bytes in program
- cx:0000 ;debug responds with the current value in cx
- :5 ;set it to 5
- -n coldboot.com ;name the program COLDBOOT.COM
- -w ;write the file
- -q ;exit debug
-
- Running COLDBOOT.COM is exactly like cycling the power switch. If you just
- want the equivalent of <CTRL><ALT><DEL>, you have to set memory location
- 0000:0472 to 1234, then do the direct intersegment jump to FFFF:0000. The
- following program does just that.
-
-
-
- TITLE WARMBOOT
- _TEXT SEGMENT
- ASSUME CS:_TEXT,DS:_TEXT,SS:_TEXT
- ORG 100H
- BEGIN:
- SUB AX,AX ; 2B C0
- MOV DS,AX ; 8E D8
- ADD AX,1234 ; 05 34 12
- MOV [0472],AX ; A3 72 04
- JMP 0FFFFH:0000 ; EA 00 00 FF FF
- _TEXT ENDS
- END BEGIN
-
- Use DEBUG just like before, except for
-
- -r cx
- cx:0000
- :f
- -n warmboot.com
-
- It's a great program to put at the end of your boss's AUTOEXEC.BAT file!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- William D. "Dev" Palmer, Ph.D.
- Dev Palmer Electronics Consulting
- 1313 Vickers Avenue
- Durham, NC 27707
- wdp@ee.egr.duke.edu
-
-