By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,498 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,498 IT Pros & Developers. It's quick & easy.

Reboot a PC with C++ code

P: n/a
Hi,
i would write a C program (with Microsoft VC) to reboot a win 98 pc. I found
this code but didn't work

Tnks.

#define MAGIC 0 /* for cold restart */
/* #define MAGIC 0x1234 /* for warm restart */

#define BOOT_SEG 0xffffL
#define BOOT_OFF 0x0000L
#define BOOT_ADR ((BOOT_SEG << 16) | BOOT_OFF)

#define DOS_SEG 0x0040L
#define RESET_FLAG 0x0072L
#define RESET_ADR ((DOS_SEG << 16) | RESET_FLAG)

main()
{
void ((far *fp)()) = (void (far *)()) BOOT_ADR;

*(int far *)RESET_ADR = MAGIC;
(*fp)();
}
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sat, 19 Nov 2005 01:45:07 +0100, "Antonio"
<an**************@NOSPAM.tin.it> wrote:
Hi,
i would write a C program (with Microsoft VC) to reboot a win 98 pc. I found
this code but didn't work

Tnks.

*snip ancient code*

That's because you're using code designed for DOS, and probably hasn't
been relevant for 10 years. You clearly had no idea what any of it did
- learn the language, instead of expecting people to explain entire
programs for you.

Furthermore, this is a C++ group.

Even if that was written in C++, it would have been off-topic. This
group is about the language, not general and platform specific
programming.
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.