How to Warm or Cold Boot Computer
PRODUCT : Borland C++ NUMBER : 708
VERSION : 2.0
OS : DOS
DATE : September 3, 1992 PAGE : 1/2
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);
}
PRODUCT : Borland C++ NUMBER : 708
VERSION : 2.0
OS : DOS
DATE : September 3, 1992 PAGE : 2/2
TITLE : How to Warm or Cold Boot Computer
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.
Comments
Post a Comment