Date: Tue, 24 Apr 2001 09:51:15 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: Rebooting the PC In-Reply-To: <3ae4bc97.23562858@news.earthlink.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.