Mail Archives: djgpp/1997/07/07/18:00:02
Nate Eldredge wrote:
>
> At 07:28 7/4/1997 +0100, you wrote:
> >In message <199707041814 DOT LAA22009 AT adit DOT ap DOT net>, Nate Eldredge
> ><eldredge AT ap DOT net> wrote :
> >>So perhaps INT 19 is not the best way to reboot. Other solutions:
> >>The standard way to reboot has always been a real-mode jump to F000h:FFF0h.
> >>For a warm boot, store 1234h at 0040h:0072h first; for a cold boot, store
> 0000h.
>
> >Well, how do you do that from C?
> >I don't want to use TASM.
>
> How about this (untested)?
[code snipped]
Or this (takes care of buggy bioses, so long as windows doesn't trap
it).
#include <pc.h>
void reboot(void)
{
int k;
outportb(0x3f2,0x00);
outportb(0x64,0xfe);
for (k=0; k<4000; k++);
outportb(0x64,0xff);
asm("cli;hlt");
}
Bill
--
Leave others their otherness.
- Raw text -