[comp.sys.apple] Booting Ram5 from Assembly

L77@TAUNOS.BITNET (Yoram Ney) (09/27/89)

Right.Since nothing's come in yet,and I can NOT believe no one had tackled
this problem before,I'm rephrasing and remailing my problem of last friday:

I have an Apple IIgs.
..(That's only part of the problem,there's more coming)...
It has an Apple 5.25" drive daisy-chaind to an Apple 3.5" drive.
+ a 1 MB filled-up Apple memory expansion card.

I've written an assembly program that's placed on a disk as the startup
system file (XXX.SYSTEM,TYPE $FF),and on booting copies the entire disk it
resides on into /Ram5.

Next I want to run the copied program files *FROM /RAM5,BY +BOOTING+ /RAM5*!!

Question is,what do I place at the end of my program,that will boot Ram5?
I expected there will be a JMP to S5 D2's device driver,some kind of JMP/JSR
Cn00 for /Ram5.
I read ProDos Tech Ref + Beneath Apple ProDos,where it states that the
address for the device driver for S5 D2 is at $BF2A-$BF2B.But this address
points to $C50A ehich is the device driver for slot 5 drive *ONE* (and indeed
the 3.5 drive instead of the Ram disk starts whenever calling this
address!!!).

So,in short,where do you JMP/JSR in order to boot /Ram5 ??????????

wooohh! I hope it's clearer now.
Please,direct-email,or email direct as well as to the net etc..

L77@TAUNOS.Bitnet

greyelf@wpi.wpi.edu (Michael J Pender) (09/29/89)

In article <8909271621.aa29960@ADM.BRL.MIL> L77@TAUNOS.BITNET (Yoram Ney) writes:
>Next I want to run the copied program files *FROM /RAM5,BY +BOOTING+ /RAM5*!!
>
>Question is,what do I place at the end of my program,that will boot Ram5?
>
>L77@TAUNOS.Bitnet

Well, if the RAMdisk acts like the one in slot 5 of my Laser, and 
if the disk is properly formatted to give it boot code, instead of
just the setup Prodos gives ramdisks on starting.

In short, if you could just type PR#5 and get it to work, then on any
other apple II you would just 

LDA #slotnumber
JMP $FE95

(I think...)

mdavis@pro-sol.cts.com (Morgan Davis) (09/29/89)

Network Comment: to #11532 by L77%TAUNOS.BITNET@cunyvm.cuny.edu

> So in short where do you JMP/JSR in order to boot /RAM5 ?????????

You don't.  And you can't.

Slot booting requires bootable media being mapped to drive #1 of a slot.
Since the RAM disk on the IIGS is mapped to a second drive (usually slot 5,
drive 2), you can't jump into peripheral RAM space (via JMP or a higher call
like PR#n or n-Control-P in the monitor).

An elegant way to do it is to change the battery RAM settings to make the
RAMdisk the boot disk.  Then munge the power-up compliment at $3F4 (increment
or decrement it), and do a JMP to $FA62, the reset handler.  The handler, upon
seeing $3F4 munged will cause the computer to reboot as if
Control-Command-Reset were pressed.

The only drawback to this is that it makes a change to battery RAM which you
might not always want.

My instincts tell me that if the IIGS firmware can cause the RAMdisk to boot,
then you should be able to do it yourself.  I suspect you would have to write
your own bootstrap routine to set up zero page locations (MSLOT and all that),
read in block #0 of the RAMdisk, set up registers and flags appropriately, and
call the boot block code you loaded into memory.

UUCP: crash!pnet01!pro-sol!mdavis		ProLine:  mdavis@pro-sol
ARPA: crash!pnet01!pro-sol!mdavis@nosc.mil	MCI Mail: 137-6036
INET: mdavis@pro-sol.cts.com			ALPE|BIX: mdavis