Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!andante!mit-eddie!bloom-beacon!bu-cs!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!portal!atari!apratt
From: apratt@atari.UUCP
Newsgroups: comp.sys.atari.st
Subject: Re: How not to boot from your hard disk.
Message-ID: <1094@atari.UUCP>
Date: 11 Jul 88 18:19:12 GMT
References: <8807021540.AA22916@ucbvax.Berkeley.EDU>
Organization: Atari Corp., Sunnyvale CA
Lines: 103

In article <8807021540.AA22916@ucbvax.Berkeley.EDU>,
wawers@DMZRZU71.BITNET writes:
>Question : How do you prevent the auto folder programs
>           from beeing executed ?
>
>           OR
>
>           How do you make your ST execute the floppy disk auto
>           folder instead of the hard disk auto folder ?
>
>                                  Theo

If you don't have a bootable hard disk, do this:

Put a disk in Drive A which DOESN'T have ahdi.prg in the auto folder.

Do a cold boot.  To get a cold boot, you have to turn off the power for
~10 sec (longer on a Mega), then turn it back on.  Alternatively,
you can assemble and run the program below.

Now find a disk with AHDI on it (the one that comes with your hard disk
will do) and double-click AHDI from the desktop.  You have to install
Drive C manually on the desktop (see your owner's manual).

************************************************************

If you have a bootable hard disk, do this:

Do a cold boot (see above).

After you turn on the power, your drive A light will come on (perhaps 1
sec or more from the time you turn on the power).  Hit the Alternate key
now, and hold it down.  Your drive A light will go out, then come back
on, and the hard disk won't boot. 

************************************************************

CUT HERE FOR PROGRAM COLDBOOT.S

*************************************************************************
*									*
* COLD cold boot code: copy a bit of code to $8, then jump to it.	*
* The bit of code clears RAM starting from its own end, until it	*
* gets a bus error.  Then it jumps to the start of the ROM.		*
*									*
* This will obliterate any eternal RAM disks, caches, auto-booting	*
* hard disks, etc., and give you the coldest boot you can get without	*
* turning off the power.  Colder, on a Mega, because the RAM holds	*
* its contents for >10sec sometimes.					*
*									*
*************************************************************************

coldboot:
	; get Supervisor mode.

	clr.l	-(sp)
	move.w	#$20,-(sp)
	trap	#1

	move.w	#$2700,sr		; disable all interrupts
	lea.l	cstart(PC),a0		; move my code to address 8
	move.w	#$f,d0			; move 64 bytes (should be enough)
	move.l	#$8,a1
rloop:	move.l	(a0)+,(a1)+
	dbra	d0,rloop
	jmp	$8			; jump to my routine.

* this routine is position-independent, and gets executed 
* at absolute address 8.

cstart:
	lea.l	berr(PC),a0		; a0 -> my bus-error handler
	move.l	a0,$8			; set bus-error vector
	lea.l	cend(PC),a0		; start clearing from my end
	moveq.l	#0,d0			; clear a bunch of registers
	move.l	d0,d1
	move.l	d0,d2
	move.l	d0,d3
	move.l	d0,d4
	move.l	d0,d5
	move.l	d0,d6
	move.l	d0,d7

* loop forever (until bus error)

cloop:	movem.l	d0-d7,(a0)
	add.w	#(4*8),a0
	bra	cloop

*
* my bus error handler: load reset PC value from absolute address 4
* and jump there.
*

berr:	move.l	$4,a0
	jmp	(a0)
cend:	dc.w	0

	.end

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt