[comp.sys.apple] ProDOS block 0

krb20699@uxa.cso.uiuc.edu (08/04/89)

     I have a lot of software on 5.25" disks from my IIe that I use a lot on
my IIgs (fast!)  When I got my machine, I set the bootup slot to 6, and booted
up my old software nicely.  When there wasn't a disk in the drive, it would boot
up slot 5 (my 3.5" drive) automagically, after rattling the 5.25" drive.
     Later, I heard from someone on a local BBS that their machine did NOT poll
to slot 5 after finding an invalid/nonexistent disk in slot 6.  Could this be
a difference between the gs ROMsets (00/01) or something else?
     For this person, I decided to write some code to block 0 of a ProDOS disk
that would boot up slot 5 without having to change the Control Panel setting
from a slot 6 bootup to slot 5. I tried the following assembly at byte 0 of
block 0:

 LDA #05
 STA E102E8
 JMP FAA6

     On my gs with the boot slot set on 6, it completely ignores the code,
and automatically polls slot 5 as usual.  I've tried assigning $E1/02E8 values
from slot 6 to slot 3 to slot 255, and there was no change.  Is there something
I'm missing about the info in block 0, or is my machine warped?  (Unfortunately,
NOT TransWarped...}=
     I'd like some info on block 0 if anyone is willing.
     By the way, what is the physical location of the apple.com unix machine?
It's really fast here from the University of Illinois' UXA machine.  Sometimes
apple.com FTPs faster than our machine can push around data DIRECTLY!  {=
     Thanks a lot, in advance.


InterNet:        krb20699@uxa.cso.uiuc.edu        |    Ken Brownfield
PLATO:           ken brownfield/unialum/cerl      |    RR#4 Box 152
NovaNET, CERL:   brownfield/dialup                |    Champaign, IL, 61820.
AppleLinkPE:     ASA(I-can-afford-it)             |    1-217-643-7504
-------------------------------------------------------------------------------
I'm 16 years old, a Sophomore Computer Engineer at the University of Illinois,
  and proud of it.  "The company I work for didn't give me this signon, so
everything I say above is legal, if not correct, right, authorized, or poetic."

dlyons@Apple.COM (David Lyons) (08/06/89)

In article <113300095@uxa.cso.uiuc.edu> krb20699@uxa.cso.uiuc.edu writes:
>I have a lot of software on 5.25" disks from my IIe that I use a lot on
>my IIgs (fast!)  When I got my machine, I set the bootup slot to 6, and booted
>up my old software nicely.  When there wasn't a disk in the drive, it would
>boot up slot 5 (my 3.5" drive) automagically, after rattling the 5.25" drive.
>     Later, I heard from someone on a local BBS that their machine did NOT poll
>to slot 5 after finding an invalid/nonexistent disk in slot 6.  Could this be
>a difference between the gs ROMsets (00/01) or something else?

Does the other person's machine have a Disk II card in slot 6?  The ROM on those
never gives up...it just has faith that you'll eventually insert a bootable
disk.  The port 6 firmware in the GS (regardless of ROM version) gives up and
passes control to the next slot.

>For this person, I decided to write some code to block 0 of a ProDOS disk
>that would boot up slot 5 without having to change the Control Panel setting
>from a slot 6 bootup to slot 5. I tried the following assembly at byte 0 of
>block 0: [...]

You need to put a $01 at byte 0 and put your code starting at byte 1.  I
suggest simply JMP $FABA ("SLOOP," Disk controller slot search loop, as
guaranteed on page 234 of the Apple IIgs Firmware Reference).

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.

krb20699@UXA.CSO.UIUC.EDU ("Make up something.") (08/06/89)

     Sorry, I spoke too soon, i.e. before implementing your suggestion:
     My block 0 now looks like this:

00:01 4C BA FA

or

 01
 4C FA BA : JMP FABA

     The disk rattles, spins, and doesn't stop.  It apparently reads in block 0,
but after this, it just keeps spinning the disk.  Taking the disk out doesn't
stop it or make the drive rattle for lack of data.  It actually acts like the
old Disk IIs, except it won't boot a newly inserted disk.
     I then tried my old code:

00:01 A5 05 8F E8 02 E1 4C A6 FA

or

 01          : 
 A5 05       : LDA #05
 8F E8 02 E1 : STA E102E8
 4C A6 FA    : JMP FAA6

     This does what it's supposed to, however when FAA6 is called, the Battery-
RAM is rewritten into the RAM buffer, killing my hack.  So it just boots up the
default drive (6) again > infinite boot.  Why doesn't something this simple
work?  Sheesh, it's just my night...er, morning...

							        Ken.
							krb20699@uxa.cso.uiuc.edu
							     {Internet}

JerryK@cup.portal.com (Jerry E Kindall) (08/07/89)

Re: making a disk to put in slot 6, to automatically boot slot 5

There are a couple of tricks to this.  First, make sure that the first
byte of block 0 is a 1.  The actual code begins at relative byte 1 of
block 0.  (The 1 indicates how many sectors, that's right, SECTORS, to
read in.  The disk controller has the capability to read the entire track
into memory, on bootup, but Apple never used the capability for some
reason.)

Next, make sure you deactivate the 5.25" drive's motor with an access to
$C088,X.  (If you're always booting from slot 6 you can just access $C0E8.)
This might not be necessary on the IIgs, but it sure is on the IIc, because
the IIc waits for the 5.25" drive to turn off before it will turn on the 3.5.
(That's because both devices use the same softswitches for different purposes.)

After that, just jump to $C500, the PR#5 entry point.

So the complete code for block 0 should be:

00: 01
01: 2C E8 C0
04: 4C 00 C5

/\    Jerry Kindall      JerryK@cup.portal.com
  \/  Death to COBOL     GEnie: A2.JERRY   ALink: A2 Jerry

krb20699@UXA.CSO.UIUC.EDU ("Make up something.") (08/08/89)

     I tried BIT C0E8 and then JMP C500 after the 01, and it works great!
I haven't excluded the C058 bit yet, but that's trivial.
     I now know a lot more about block 0.  Thanks, folks.

								        Ken.
							krb20699@uxa.cso.uiuc.edu
							     {Internet}