[comp.binaries.ibm.pc.d] using DOS interrupts

proud@cbnewsc.ATT.COM (jeff.alltop) (09/07/89)

I have been trying to write a program in TurboC to reboot the machine by
using interrupt 0x19.  This interrupt, according to the documentation I
have will reboot the system.  I know I could just hit cntrl-alt-delete and
do the same thing, but software control might come in handy.  Right now
all I do is call int 0x19.  All this does is seem to start the bootstrap
but then seems to get lost.  I am forced to hit the hard reset button to
get my system back.  My question to you net.programmers is, what else do
I have to do besides call int 0x19?  If you try to email me, use the address
below as going through cbnewsc is not reliable.

						Thanks!

 

   ____   _______   _____   _______     -------      Jeff T. Alltop
  / __ \ |__   __| /   _ \ |__   __|  -====------    AT&T Bell Labs 
 | (__) |   | |    \  \ \_\   | |    -======------   Naperville, IL
 |  __  |   | |    /   \ __   | |    --====-------   Department 55637
 | |  | |   | |   |  (\ / /   | |     -----------    312-979-6863
 |_|  |_|   |_|    \_____/    |_|       -------      proud@ihlpy.ATT.COM
TRAPEZOID - A device used to catch zoids.

brown@astroatc.UUCP (Vidiot) (09/07/89)

In article <2978@cbnewsc.ATT.COM> proud@cbnewsc.ATT.COM (jeff.alltop) writes:
<
<I have been trying to write a program in TurboC to reboot the machine by
<using interrupt 0x19.  This interrupt, according to the documentation I
<have will reboot the system.  I know I could just hit cntrl-alt-delete and
<do the same thing, but software control might come in handy.  Right now
<all I do is call int 0x19.  All this does is seem to start the bootstrap
<but then seems to get lost.  I am forced to hit the hard reset button to
<get my system back.  My question to you net.programmers is, what else do
<I have to do besides call int 0x19?  If you try to email me, use the address
<below as going through cbnewsc is not reliable.

I have posted this before and I'll post it again here, but attached below is
an assembly language program that will reboot the system.  It is written so
that it can also be assembled and the .obj file used with other programs.
I have used it as a standalone program and with a QuickBASIC program that
I have done.  It works both ways without any trouble.  The code can be fixed
so that it either does a warm or cold reboot.  See the code for details.


***** CUT HERE *****
                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
***** CUT HERE *****
-- 
	        harvard\     att!nicmad\
Vidiot            ucbvax!uwvax..........!astroatc!brown
	        rutgers/  decvax!nicmad/
	ARPA/INTERNET: brown%astroatc.UUCP@spool.cs.wisc.edu