delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/07/18:00:02

Date: Tue, 08 Jul 1997 10:01:17 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: CWSDPMI halting interrupt 19 (reboot)
To: Nate Eldredge <eldredge AT ap DOT net>
Cc: James MacDonald <trill AT xnetbook DOT demon DOT co DOT uk>, djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <33C20FED.5443@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <199707051506 DOT IAA24406 AT adit DOT ap DOT net>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019