[comp.sys.atari.st] Cold Start

themod@blake.acs.washington.edu (Chris Hinton) (11/27/89)

  Help!  I have search high and low, through every manual I could lay my 
grubby paws on, and yet I can find no documentation on how to perform a 
cold start from software.  If some kind soul out there can send me code
(C or Assembly preferable) I would be most appreciative.

  Thanks for your help.

 Chris Hinton
 themod@blake.acs.washington.edu

hcj@lzaz.ATT.COM (HC Johnson) (11/28/89)

In article <4642@blake.acs.washington.edu>, themod@blake.acs.washington.edu (Chris Hinton) writes:
> 
>   Help!  I have search high and low, through every manual I could lay my 
> grubby paws on, and yet I can find no documentation on how to perform a 
> cold start from software.  If some kind soul out there can send me code

From mtune!decvax.UUCP!minow Sun Sep 20 15:04:56 1987
Path: lzaz!mtune!whuts!homxb!mhuxt!mhuxm!mhuxh!mhuxo!ulysses!faline!bellcore!rutgers!mcnc!gatech!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbvax!decvax!minow
From: minow@decvax.UUCP (Martin Minow)
Newsgroups: comp.sys.atari.st
Subject: Simple program to reboot an Atari ST
Message-ID: <152@decvax.UUCP>
Date: 20 Sep 87 19:04:56 GMT
Reply-To: minow@decvax.UUCP (Martin Minow)
Distribution: world
Organization: Digital Eq. Corp. - Merrimack NH.
Lines: 40

#if 0
This illustrates how to emulate the white button (warmstart) or
power-switch on an Atari.  It *should* be compatible with the new roms.
Normally, you would add the guts to an existing program.

Martin Minow
decvax!minow
#endif

/*
 * Reboot an Atari ST.  This program is in the public-domain.
 * Martin Minow, Arlington MA 02174, USA.
 */

#include <osbind.h>
#include <linea.h>

#define OS_memvalid	(*((long *) 0x420L))
#define	OS_memval2	(*((long *) 0x43AL))
#define OS_resvalid	(*((long *) 0x426L))
#define OS_restart	(*((int(*)()) 0xFC0000L))

main()
{
	int		hardboot;
	long		oldstack;

	hidemouse();
	Cconws("\033EX or x to hardboot, anything else to softboot: ");
	hardboot = Cconin() & 0xFF;
	oldstack = Super(0L);			/* Get into super mode	*/
	if (hardboot == 'X'
	 || hardboot == 'x') {
	    OS_memvalid = 0L;			/* Invalidate the OS	*/
	    OS_memval2  = 0L;			/* "up and running"	*/
	    OS_resvalid = 0L;			/* flags.		*/
	}	    	
	OS_restart();				/* Imitate system reset	*/
	Super(oldstack);			/* We never get here	*/
}



Howard C. Johnson
ATT Bell Labs
att!lzaz!hcj
hcj@lzaz.att.com

glk3593@uxf.cso.uiuc.edu (11/29/89)

	From ST-Praxis Winter '88/89---

	This is in Omikron Basic, but it is pretty simple to understand...
	Three memory locations (I assume long words) have to be set to
	0.

	100 rem Reset resident program turn off
	110 rem
	120 lpoke $420,0	' memvalid
	130 lpoke $426,0	' resvalid
	140 lpoke $43a,0	' memval2 
	150 rem
	160 rem at the next reset, a cold start will be invoked

	-Spieu!

	Gregory Mathias Lemperle-Kerr
	'Looks like the University of Illinois...'

hase@netmbx.UUCP (Hartmut Semken) (11/30/89)

In article <4642@blake.acs.washington.edu> themod@blake.acs.washington.edu (Chris Hinton) writes:
>  Help!  I have search high and low, through every manual I could lay my 
>grubby paws on, and yet I can find no documentation on how to perform a 
>cold start from software.  If some kind soul out there can send me code
>(C or Assembly preferable) I would be most appreciative.

Alan Pratt (@atari) poste one program a while back.

As far as I recall, it made the BUERR vector point to the same place,
the RESET vector points to and then started to write 0L to any RAM
adress from the first longword behind the program code (start of BSS?)
up to 4M+1. Writing to this adress will cause a BUSERR, and BUSERR
points to the coldstart routine (pointed to by RESET)...

Any virus (or ramdisk) will die fromm the NULLs :-)

hase


-- 
Hartmut Semken, Lupsteiner Weg 67, 1000 Berlin 37 hase@netmbx.UUCP
Dennis had stepped up into the top seat whet its founder had died of a
lethal overdose of brick wall, taken while under the influence of a
Ferrari and a bottle of tequila. (Douglas Adams; the long dark teatime...)