Article View: comp.sys.ibm.pc.programmer
Article #1386Re: How to do a warm-boot from a C program
From: Jeff Pipkins
Date: Wed, 21 Feb 1990 14:59
Date: Wed, 21 Feb 1990 14:59
50 lines
2128 bytes
2128 bytes
In article <P#$#92_@rpi.edu> mcintyre@turing.cs.rpi.edu (David McIntyre) writes:
>jimmy writes:
>>Does anyone know how to do a boot from a C program?
>
>Yes, just do an Interrupt 25 (which is 19h). That will do it nicely.
No, you should never do that. If you do, sometimes it will work, but much
of the time it will hang. The proper way to simulate Ctrl-Alt-Del is to
use the same technique that the keyboard handler uses when it detects the
Ctrl-Alt-Del sequence.
Try something like this:
void warm_boot()
{
unsigned int far *reset_flag = (unsigned int far *) 0x00400072L;
void (far *boot)() = 0xFFFF0000L;
*reset_flag = 0x1234;
(*boot)();
}
void cold_boot()
{
[same definitions]
*reset_flag = 0;
(*boot)();
}
>One minor comment: rebooting a computer is a pretty harsh way to recover
>from a program error. In fact, with today's windowing systems, by rebooting
>the system you could cause a nasty problem for another program.
>[example deleted]
Good point. It is also not a very user-friendly kind of thing to do
anyway. If you want to create a robust, bullet-proof program, you can't
do it by barfing and leaving the user at the mercy of an MS-DOS prompt.
>Dave "mr question" McIntyre | "....say you're thinking about a plate
>mcintyre@turing.cs.rpi.edu | of shrimp.....and someone says to
>office : 518-276-8633 | you 'plate,' or 'shrimp'......"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Would you please explain the shrimp
thing?
Jeff Pipkins
pipkins@imagen.com
Technical Details
Message-ID:
<117@qmsseq.imagen.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!imagen!qmsseq!pipkinsReferences:
<2028@milton.acs.washington.edu> <P#$#92_@rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!imagen!qmsseq!pipkins From: pipkins@qmsseq.imagen.com (Jeff Pipkins) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: How to do a warm-boot from a C program Keywords: boot, C Message-ID: <117@qmsseq.imagen.com> Date: 21 Feb 90 14:59:35 GMT References: <2028@milton.acs.washington.edu> <P#$#92_@rpi.edu> Reply-To: pipkins@qmsseq.UUCP (Jeff Pipkins) Distribution: na Organization: QMS Inc., Mobile, Alabama Lines: 50