Path: utzoo!attcan!uunet!lll-winken!ames!oliveb!stratus!gbs From: gbs@stratus.UUCP (George B. Smith) Newsgroups: comp.sys.ibm.pc Subject: Re: How could I force a CTRL-ALT-DEL from a program? Message-ID: <1524@stratus.UUCP> Date: 24 Jan 89 07:00:49 GMT References: <4567@bunker.UUCP> <86397@sun.uucp> Reply-To: gbs@stratus.UUCP (George B. Smith) Organization: Stratus Computer, Inc. Western Development Center Lines: 59 In article <86397@sun.uucp> jborza%burgundy@Sun.COM (Jim_Borza) writes: >In article <4567@bunker.UUCP>, rha@bunker.UUCP (Robert H. Averack) writes: >> I am investigating how one can remotely cause a PC to reboot. Getting >> the stimulus to the PC is clearly not the problem. The problem is getting >> the software which recognizes the stimulus to issue a CTRL-ALT-DEL to MSDOS, >> resulting in the reset and reboot. >> > >You can reboot a PC with the following code. >Assemble with MASM and convert to .COM via EXE2BIN. ... assembly lanuage program deleted >Jim Borza - Sun Microsystems Here is a Turbo C program to do the same thing: /* ** boot.c ** ** This small program will reboot an IBM PC or clone. If there are no ** command line arguments or there is a single argument of "warm", then ** a warm boot is performed. If there is a single argument of "cold", ** then a cold boot is performed. ** ** The mechanics of this feat result from the following convention ** supported by virtually every BIOS: ** ** If you jump into the BIOS with location 0040:0072H set to the ** magic quatity of 1234H, and jump to the entry point of the BIOS ** at location FFFF:0000h, the system will perform a warm boot ** (i.e., no power-on self-test, etc.). Putting anything else in ** that memory location will force a cold boot. */ #include main(argc, argv) int argc; char *argv[]; { void (far *bye) (); int far *pt; pt = (int far *) 0x00000472L; /* location in memory for */ /* boot magic number */ if (argc < 2) *pt = 0x1234; /* warm boot magic number */ else if (argc == 2 && !strcmp("warm", argv[1])) *pt = 0x1234; /* warm boot magic number */ else if (argc == 2 && !strcmp("cold", argv[1])) *pt = 0x0000; /* cold boot magic number */ else { fprintf(stderr, "Usage: boot [warm | cold]\n"); exit(1); } bye = (void far *) 0x0ffff0000L; /* boot code in ROM BIOS */ (*bye)(); }