🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1311

Re: How to do a warm-boot from a C program

#1311
From: Keith Petersen
Date: Tue, 20 Feb 1990 16:31
46 lines
1900 bytes
The following message recently appeared in the Info-IBMPC digest.

[---forwarded message---]
Date: Thu Feb 15 18:05:39 GMT 1990
To: Info-IBMPC@WSMR-SIMTEL20.ARMY.MIL
From: Mike O'Carroll <lena!mike@relay.EU.net>
Subject: Reboot of PC

The program below works in TurboC (or MS C).  In some compilers, you
have to fold the address to 20 bits, but here the segment and offset
are separate.

Mike O'Carroll, Microsystems Unit, University of Leeds, LS2 9JT, UK
E-mail: @ukc.ac.uk:mike@ee.leeds.ac.uk
UUCP:   ...!mcsun!ukc!lena!mike or mike@lena.uucp

---cut-here---

#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)();
	return 0;	/* never gets here, but keeps compiler happy */
}

[---end forwarded message---]

Keith
-- 
Keith Petersen
Maintainer of SIMTEL20's CP/M, MSDOS, & MISC archives [IP address 26.2.0.74]
Internet: w8sdz@WSMR-SIMTEL20.Army.Mil, w8sdz@brl.arpa  BITNET: w8sdz@NDSUVM1
Uucp: {ames,decwrl,harvard,rutgers,ucbvax,uunet}!wsmr-simtel20.army.mil!w8sdz
Technical Details
Message-ID: <12190@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!rex!uflorida!haven!adm!smoke!w8sdz
References: <2028@milton.acs.washington.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!rex!uflorida!haven!adm!smoke!w8sdz
From: w8sdz@smoke.BRL.MIL (Keith Petersen)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: How to do a warm-boot from a C program
Keywords: boot, C
Message-ID: <12190@smoke.BRL.MIL>
Date: 20 Feb 90 16:31:53 GMT
References: <2028@milton.acs.washington.edu>
Reply-To: w8sdz@wsmr-simtel20.army.mil (Keith Petersen)
Distribution: na
Organization: The SIMTEL20 Archives
Lines: 46