home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
bchelp10.arj
/
TI708.ASC
< prev
next >
Wrap
Text File
|
1991-09-18
|
2KB
|
67 lines
PRODUCT : Borland C++ NUMBER : 708
VERSION : 2.0
OS : DOS
DATE : September 18, 1991 PAGE : 1/1
TITLE : How to Warm or Cold Boot Computer
/********************************************************************
This code will let the user specify whether to perform a cold or
warm boot based on the command line option (Warm boot: 'W' or
'S'; any other character results in a cold boot).
*********************************************************************/
#include <stdio.h>
#include <dos.h>
#include <ctype.h>
int main (int argc, char *argv[])
{
void (far *bootsystem) (void);
if ((toupper (argv[1][0]) == 'W')
|| (toupper (argv[1][0]) == 'S'))
{ /* Setting this memory location to this value will result
in memory not being checked a.k.a. Warm Boot */
unsigned far *warm;
/* Make a far pointer that points to the specified memory
location that is checked when the system is rebooted */
warm = MK_FP (0x0000, 0x0472);
/* Assign constant to farpointer indicating that memory is
not to be checked
*/
*warm = 0x1234;
puts ("\nWarm boot in progress...\n");
}
else /* memory will be checked a.k.a. Cold Boot */
puts ("\nCold boot in progress...\n");
/* Assign far function pointer to the required far pointer
for reboot */
bootsystem = MK_FP (0xFFFF, 0x0000);
/* Invoke the reboot process */
(*bootsystem) ();
return (0);
}