www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/24/05:45:16

From: dan AT no DOT spam
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Rebooting the PC
Message-ID: <3ae54611.6243137@news.earthlink.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010424094453 DOT 7426H-100000 AT is>
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 55
Date: Tue, 24 Apr 2001 09:34:17 GMT
NNTP-Posting-Host: 165.247.25.126
X-Complaints-To: abuse AT earthlink DOT net
X-Trace: newsread2.prod.itd.earthlink.net 988104857 165.247.25.126 (Tue, 24 Apr 2001 02:34:17 PDT)
NNTP-Posting-Date: Tue, 24 Apr 2001 02:34:17 PDT
Organization: EarthLink Inc. -- http://www.EarthLink.net
X-Received-Date: Tue, 24 Apr 2001 02:32:54 PDT (newsmaster1.prod.itd.earthlink.net)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

Hi.

Thanks for your reply. I'll try a couple of things out. But just under the
"neither here nor there" category, I found this:

Rebooting from Within a Batch File
http://support.microsoft.com/support/kb/articles/Q67/9/29.ASP

I'm not an assembler guru, so I can't say how it compares with the other methods
of rebooting. But I did test it out, and it works. Simple, and it's in the
Knowledge Base too... Comments? Can this be put into C easily?

Thanks,
Dan

>
>On Mon, 23 Apr 2001 dan AT no DOT spam wrote:
>
>> I'd like to reboot the PC:
>> - from a DJGPP program 
>> - running with DPMI 
>> - from DOS protected mode (Windows is not running; HIMEM is)
>> 
>> The reboot must:
>> - flush the disk cache first, and 
>> - do a cold restart (it must go through BIOS initialization on the way back up).
>> 
>> Yes, I have read the FAQ http://www.delorie.com/djgpp/v2faq/faq22_26.html. 
>> 
>> The problem is, it doesn't say whether the 3 methods meet my
>> requirements.
>
>You can flush the disk cache with a call to the library function
>`sync'.  As for cold reboot, I think the last method of those mentioned 
>in the FAQ supports that.
>
>> http://www.brokersys.com/snippets/REBOOT.ASM
>> 
>> It seems to do everything, but it's in Assembler - Intel assembler, which I
>> understand has to be converted to AT&T format for DJGPP. (arrrghhhh!!!!)
>> 
>> Can anyone help me either convert this to an assembler format that djgpp can
>> use, or convert it to C code using dpmi calls?
>
>Latest versions of Gas, the GNU Assembler, accept Intel-style
>assembly.  But your real problem is to convert this code to protected
>mode, not the assembly syntax.
>
>However, looking at REBOOT.ASM, it seems like it does exactly what the 
>last method in the FAQ (the one which sends the `FEh' command to the port 
>64h) does.  So simply following the FAQ should get you what you want.

The FAQ should really be updated with a little more detail.

- Raw text -


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