[comp.sys.atari.st] How not to boot from your hard disk.

apratt@atari.UUCP (07/12/88)

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

klute%trillian.irb@unido.uucp (Rainer Klute) (07/19/88)

In article <1094@atari.UUCP> apratt@atari.UUCP (Allan Pratt) writes:
>*************************************************************************
>*									*
>* 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.					*
>*									*
>*************************************************************************

Why not simply set memvalid (0x0420) to zero and jump through 0x0004?

+---------------------------+------------------------------------------+
|   Rainer Klute            | UUCP:   klute@unido.uucp                 |
|   University of Dortmund  |            (...uunet!mcvax!unido!klute)  |
|   Dept. of CS             | BITNET: klute@unido.bitnet               |
|   P.O. Box 500500         |                                          |
| D-4600 Dortmund 50        |                                          |
+---------------------------+------------------------------------------+
|                     Federal Republic of Germany                      |
+----------------------------------------------------------------------+

braner@batcomputer.tn.cornell.edu (braner) (07/21/88)

[]

In article <489@laura.UUCP> klute%trillian.irb@unido.UUCP (Rainer Klute) writes:
>In article <1094@atari.UUCP> apratt@atari.UUCP (Allan Pratt) writes:
>>* COLD cold boot code: copy a bit of code to $8, then jump to it. [...]
>Why not simply set memvalid (0x0420) to zero and jump through 0x0004?

- the latter is (part of) what my "COLDBOOT" program, posted a while ago, does.
Since it is VERY short, here's a repost.

- Moshe Braner

--------------------

A utility was posted a while ago to make the RESET button do a COLD reset.
I don't like that (since I want to keep the reset-proof RAMdisk) but
occasionally I do need a cold boot.  Since HDB2.3 apparently does not
boot right if I leave the HD on and turn the ST off and on, I wrote the
following little ditty.  It asks for confirmation, then does a cold
reset (that redoes the memory size check, although it keeps the time...).

------------ cut here ------------
begin 644 coldboot.tos
M8!H   !\                             $AY    1#\\  E.05R//SP a
M 4Y!5(\,  !Y9PH,  !99P1"9TY!0J<_/  @3D%<CT*Y   $($*Y   $)B!Ya
M    !$[0#0H*"0=$;R!Y;W4@<F5A;&QY('=A;G0@=&\-"@D@9&\@82!#3TQ$a
6(')E<V5T/R H>2]N*2 '       "    a
 a
end

bammi@dsrgsun.ces.cwru.edu (Jwahar R. Bammi) (07/21/88)

Just FYI:
New (yet unposted) versions of Gulam have a reboot command.
 # reboot	does a warm reboot
 # rebbot -c    does a cold reboot
both commands save history if `history' is set before rebooting.
--
usenet: {decvax,sun}!mandrill!bammi	jwahar r. bammi
csnet:       bammi@mandrill.CWRU.edu
arpa:        bammi@mandrill.CWRU.edu
compuServe:  71515,155

usenet: {decvax,cbosgd,sun}!mandrill!bammi	jwahar r. bammi
csnet:       bammi@mandrill.CWRU.edu
arpa:        bammi@mandrill.CWRU.edu
compuServe:  71515,155

ge@hobbit.sci.kun.nl (Ge' Weijers) (07/26/88)

From article <489@laura.UUCP>, by klute%trillian.irb@unido.uucp (Rainer Klute):
> In article <1094@atari.UUCP> apratt@atari.UUCP (Allan Pratt) writes:
>>* 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.		*
> 
> Why not simply set memvalid (0x0420) to zero and jump through 0x0004?
> 
A virus conceivably might restore memvalid directly after the reset (or can
it? I'd have to check it with a disassembler)
-- 
Ge' Weijers, Informatics dept., Nijmegen University, the Netherlands
UUCP: {uunet!,}mcvax!kunivv1!hobbit!ge