Xref: utzoo comp.sys.ibm.pc:26127 comp.sources.wanted:6699 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!emcard!stiatl!todd From: todd@stiatl.UUCP (Todd Merriman) Newsgroups: comp.sys.ibm.pc,comp.sources.wanted Subject: Re: Is it possible to re-boot a PC from a program ? Keywords: reboot.exe Message-ID: <3785@stiatl.UUCP> Date: 15 Mar 89 13:12:23 GMT References: <830@psueea.UUCP> Reply-To: todd@stiatl.UUCP (Todd Merriman) Distribution: na Organization: Sales Technologies Inc., Atlanta, GA Lines: 112 In article <830@psueea.UUCP> alexc@psu-cs.cs.pdx.edu (Alex Chan) writes: > > Is it possible to write a program to reboot a PC ? ifdef DOCUMENTATION ; **************************************************************************** REBOOT.ASM 12/18/87 Todd Merriman .MODULE reboot .LIBRARY clib .TYPE function .APPLICATION system .SYSTEM msdos .AUTHOR Todd Merriman .LANGUAGE Assembly .DESCRIPTION Reboot the computer .ARGUMENTS void reboot(); .NARRATIVE The reboot function transfers program control to the CPU reset vector, and a system reset is performed. This could be used in a case where a device driver was modified. .CAUTION Be sure there are no open files, or any I/O not completed. .RETURNS void .NOTICE Copyright (c) 1987 Future Communications, Atlanta, Georgia .ENDOC END DOCUMENTATION ; **************************************************************************** endif .XLIST INCLUDE \HEADER\C.MAC ; symbols and macros for Microsoft .LIST ; **************************************************************************** ; data ; **************************************************************************** DSEG ; begin data section RES_VEC DW 0FFF0H,0F000H ; reset vector ENDDS ; end data section ; **************************************************************************** ; code ; **************************************************************************** PSEG ; begin program section CFUN reboot ; C function declaration PUSH BP MOV BP,SP LEA SI,RES_VEC ; load reset vector JMP DWORD PTR DS:[SI] ; jump there POP BP ; this code for good form only RET CFEND reboot ; end C function ENDPS ; end program section END ; end assembly ; **************************************************************************** ; reboot program ; this is a test for the reboot function ; **************************************************************************** PAGE 59,132 ; ; Outline for assembly programs to .COM files ; .XLIST INCLUDE \LAT\HEADER\CSUB.MAC .LIST CODE SEGMENT PUBLIC ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE ORG 100H ; .COM origin MAIN PROC FAR START: CCALL reboot INT 20H ; to DOS MAIN ENDP CODE ENDS END START ; **************************************************************************** ; End REBOOT.ASM ; **************************************************************************** ...!gatech!stiatl!todd Todd Merriman 404-377-TOFU Atlanta, GA