Mail Archives: djgpp/2001/04/24/05:45:16
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 -