Mail Archives: djgpp/1998/05/02/01:16:07
At 12:32 5/1/1998 GMT, Grzegorz Adam Hankiewicz wrote:
>Hello.
>
>I've heard there's some asm code which can reboot the computer.
>Does someone have this code? Is ot possible to choose between a warm
>boot and a cold boot?
Under DOS, you can jump to real-mode address F000h:FFF0h. If you want a warm
boot, store 1234h in the word at address 0040h:0072h; otherwise store 0000h.
Or with DJGPP:
void reboot(int warm_boot)
{
__dpmi_regs r;
if (warm_boot)
_farpokew(_dos_ds, 0x00472, 0x1234);
else
_farpokew(_dos_ds, 0x00472, 0x0000);
r.x.cs = 0xf000;
r.x.ip = 0xfff0;
r.x.ss = r.x.sp = r.x.flags = 0;
__dpmi_simulate_real_mode_procedure_retf(&r);
}
I don't know whether this will work from a DOS box; I would suspect not, but
there's only one way to find out...
You can also do some low-level poking of the keyboard controller, which does
a cold reboot. But I don't know how offhand, though the ports.lst of the
Ralf Brown Interrupt List has the necessary data. Note that this is very
severe, could be dangerous, and also may not work under Windows 95.
Nate Eldredge
nate AT cartsys DOT com
- Raw text -