home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / bootutil / boot.zoo / boot.doc next >
Encoding:
Text File  |  1991-09-19  |  2.5 KB  |  90 lines

  1.  
  2.         REBOOTING YOUR COMPUTER IN SOFTWARE
  3.  
  4. Sometimes it is convenient to reboot your computer from a batch file.  Like 
  5. when you need a certain version of AUTOEXEC.BAT and CONFIG.SYS to run a 
  6. particular program, but don't want to do all the copy statements and then 
  7. reboot by hand every time.
  8.  
  9. Here are two programs I wrote (although I'm sure many have written identical 
  10. programs in the past) that will do a warm or cold boot on any IBM or clone 
  11. from the 8088 to the 80486.  Maybe they're not the best computer company 
  12. around, but they sure have backward compatibility down!
  13.  
  14. The assembler listing for COLDBOOT.COM is shown below.
  15.  
  16.         TITLE   COLDBOOT
  17. _TEXT   SEGMENT
  18.         ASSUME  CS:_TEXT,DS:_TEXT,SS:_TEXT
  19.         ORG     100H
  20. BEGIN:
  21.         JMP     0FFFFH:0000     ; EA 00 00 FF FF
  22. _TEXT   ENDS
  23.         END     BEGIN
  24.  
  25. Many assemblers will not handle a direct intersegment jump.  The easiest way 
  26. to make this into a *.COM file is to use DEBUG and write the program directly 
  27. in machine code.  Enter the following commands:
  28.  
  29.         debug
  30.         -e cs:100       ;type in the hex codes shown above at cs:100
  31.                         ;hit <enter> when finished
  32.         -u 100          ;check and make sure you typed correctly
  33.         -r cx           ;set cx register to number of bytes in program
  34.         cx:0000         ;debug responds with the current value in cx
  35.           :5            ;set it to 5
  36.         -n coldboot.com ;name the program COLDBOOT.COM
  37.         -w              ;write the file
  38.         -q              ;exit debug
  39.  
  40. Running COLDBOOT.COM is exactly like cycling the power switch.  If you just 
  41. want the equivalent of <CTRL><ALT><DEL>, you have to set memory location 
  42. 0000:0472 to 1234, then do the direct intersegment jump to FFFF:0000.  The 
  43. following program does just that. 
  44.  
  45.  
  46.  
  47.         TITLE   WARMBOOT
  48. _TEXT   SEGMENT
  49.         ASSUME  CS:_TEXT,DS:_TEXT,SS:_TEXT
  50.         ORG     100H
  51. BEGIN:
  52.         SUB     AX,AX           ; 2B C0
  53.         MOV     DS,AX           ; 8E D8
  54.         ADD     AX,1234         ; 05 34 12
  55.         MOV     [0472],AX       ; A3 72 04
  56.         JMP     0FFFFH:0000     ; EA 00 00 FF FF
  57. _TEXT   ENDS
  58.         END     BEGIN
  59.  
  60. Use DEBUG just like before, except for
  61.  
  62.         -r cx
  63.         cx:0000
  64.           :f
  65.         -n warmboot.com
  66.  
  67. It's a great program to put at the end of your boss's AUTOEXEC.BAT file!
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. William D. "Dev" Palmer, Ph.D.
  85. Dev Palmer Electronics Consulting
  86. 1313 Vickers Avenue
  87. Durham, NC  27707
  88. wdp@ee.egr.duke.edu
  89.  
  90.