[comp.binaries.ibm.pc.d] Warm-boot program

larned@uhccux.uhcc.hawaii.edu (Paul Larned) (01/04/90)

Does anyone know where I can locate a warm-boot program?
I understand this is a small .COM program which is very
useful in batch files where, for example, you switch
CONFIG.SYS files.  Thanks very much for any help.

feuling@astroatc.UUCP (Lindsay Feuling) (01/04/90)

>From: larned@uhccux.uhcc.hawaii.edu (Paul Larned)
>Subject: Warm-boot program
>Keywords: Warm-boot
>Message-ID: <5894@uhccux.uhcc.hawaii.edu>
>Date: 3 Jan 90 20:04:26 GMT
>Organization: University of Hawaii
>Lines: 5
>
>
>Does anyone know where I can locate a warm-boot program?
>I understand this is a small .COM program which is very
>useful in batch files where, for example, you switch
>CONFIG.SYS files.  Thanks very much for any help.
>

The method for creating such a program is very simple.  All 
you need is the program DEBUG.COM, or SYMDEB.COM (available from
Microsoft Macro Assembler), or even the Macro Assembler!

The assembly code for a warmboot is as follows:
	mov	ax,0
	mov	ds,ax
	mov	si,0472
	mov	word ptr [si],0034
	mov	word ptr [si+01],0012
	jmp	f000:fff0

Even simpler is the code for a coldboot:
	jmp	f000:fff0

These assembler instructions may be entered as code in
DEBUG or SYMDEB (using the 'a' option), and saving them as
'WARMBOOT.COM' and 'COLDBOOT.COM' respectively. 

	Good luck q:-)

bobmon@iuvax.cs.indiana.edu (RAMontante) (01/04/90)

Here's one, the uuencoded executable (all 15 bytes) followed by the
original article it came from:

section 1 of uuencode 2.13 of file reboot.com    by R.E.M.

begin 644 reboot.com
/,<".V,<&<@0T$NH``/__#
``
end
size      15
______________________________________________________________________

  Date: Mon, 16 Feb 87 15:27:48 EST
  From: John.Brennen@VI.RI.CMU.EDU
  Subject: Reboot
----
  a100
  xor ax,ax
  mov ds,ax
  mov [472],wo 1234
  jmp ffff:0

  nreboot.com
  rcx
  f
  w
  q
----------------------------------------

  The storage of 1234 in absolute memory location 00472 avoids the
  memory check.

  If you have an AT, AT clone, AT compatible or whatever, you can pulse
  the RESET line through software control:
----------------------------------------
  a100
  xor ax,ax
  mov ds,ax
  mov [472],wo 1234
  mov al,fe
  out 64,al
  jmp 10e

  nreboot.com
  rcx
  10
  w
  q
          John Brennen            CMU Visual Inspection Lab
          jfb@vi.ri.cmu.edu       Pittsburgh, PA

andrew@tvcent.uucp (Andrew Cowie) (01/04/90)

What you need is to use the same interrupt that is generated when you
type Ctrl-Alt-DEL. This interrupt is interrupt 19 hex, 25 in decimal.
This can be generated with the assembly command INT 19.

A small file can be made by using DEBUG. (comes with DOS) A full
assembler could be used, but is unnecessary.

The following is a short transcript of a session with DEBUG. Note that case
is not significant. I have shown all text entered by the user as lower case.
My comments will appear on the right side of the screen. XXXX represents some
segment number. This is chosen by debug.



C> debug
-                                         The DEBUG prompt.
-a 0100                                   Assemble code, offset 0100.
XXXX:0100  int 19
XXXX:0102
-u 0100 0100                              Display the code at offset 0100.
XXXX:0100 CD19       INT    19            CD19 is the actual machine code.
-r bx
BX YYYY                                   (current value of the BX register)
: 0000                                    Set BX to 0000
-r cx
CX YYYY                                   (current value of the CX register)
: 0002                                    Set CX to 0002
-n boot.com
-w
WRITING 0002 BYTES
-q                                        Quit.

C> boot                                   Hey Presto! It works!



The idea is to create one two byte machine code instruction, CD19, and write it
to disk with the name BOOT.COM This works on my machine. I hope it works on
yours.

--
Andrew F. Cowie at TVC Enterprises, Toronto, Canada.
uunet!mnetor!lethe!tvcent!andrew  andrew@tvcent.uucp

brown@vidiot.UUCP (Vidiot) (01/06/90)

In article <1990Jan4.124333.25943@tvcent.uucp> andrew@tvcent.UUCP (Andrew Cowie) writes:
<
<What you need is to use the same interrupt that is generated when you
<type Ctrl-Alt-DEL. This interrupt is interrupt 19 hex, 25 in decimal.
<This can be generated with the assembly command INT 19.
<
<A small file can be made by using DEBUG. (comes with DOS) A full
<assembler could be used, but is unnecessary.

While it is true that a full assembler is not needed, it is if you want to
but it into a library and incorporate it into a program that you are writing.
The following assembly code will compile to back a standalone reboot program
and a .obj that can be used to be placed into a library.  I have used it with
QuickBASIC.


                page    60,132
                title   REBOOT.ASM = Performs a Warm System Boot =

                PUBLIC REBOOT

;=======================================================================;
;                                                                       ;
;       This segment is used to reference a "JMP" instruction in        ;
;       ROM which branch to the reboot code in ROM.                     ;
;                                                                       ;
;=======================================================================;

rom_seg         segment at 0ffffH
boot_jmp        label   far
rom_seg         ends

;=======================================================================;
;                                                                       ;
;       This segment is used to reference a word in the BIOS data       ;
;       area which is used to determine if a WARM or COLD reboot        ;
;       should be performed by the reboot code in ROM.                  ;
;                                                                       ;
;=======================================================================;

bios_seg        segment at 0040H
                org     bios_seg+72H
boot_flags      label   word
bios_seg        ends

cold_boot       equ     0000H           ;Value to indicate COLD reboot
warm_boot       equ     1234H           ;Value to indicate WARM reboot


                page
;=======================================================================;
;                                                                       ;
;       The following lines set the boot flags in the BIOS Data         ;
;       Area and then invoke the boot code in the BIOS ROM.             ;
;                                                                       ;
;=======================================================================;

code_seg        segment
                assume  CS:code_seg, DS:code_seg
                org     code_seg+100H

reboot          proc
                mov     AX,bios_seg
                mov     DS,AX           ;Point to BIOS Data Area
                assume  DS:bios_seg
                mov     boot_flags,warm_boot

                assume  DS:rom_seg
                jmp     boot_jmp        ;Jump to Reboot Code
reboot          endp

code_seg        ends

                end
-- 
      harvard\     att!nicmad\              cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/   INTERNET:<@cs.wisc.edu,@astroatc:brown@vidiot>