Path: news1.icaen!news.uiowa.edu!news1.chicago.iagnet.net!iagnet.net!newsfeed.internetmci.com!192.48.96.126!in2.uu.net!munnari.OZ.AU!comp.vuw.ac.nz!news.actrix.gen.nz!dempson From: dempson@actrix.gen.nz (David Empson) Newsgroups: comp.sys.apple2 Subject: Re: ][+ auto-boot from hard drive? Date: Fri, 14 Nov 1997 22:37:55 +1300 Organization: Empsoft Lines: 132 Message-ID: <19971114223755195458@dempson.actrix.gen.nz> References: <3468bcab.2518513@129.3.17.35> NNTP-Posting-Host: news2.actrix.gen.nz X-Newsreader: MacSOUP 2.2.1 Edhel Iaur, Esq. wrote: > On Tue, 11 Nov 1997 00:15:31 -0600, swithrow@ccrtc.com (Scott A. > Withrow) wrote: > > >One question, though. Can the Apple ][+ automatically boot from the hard > >drive? When I power the computer on, it instantly starts accessing the > >floppy drive in slot 6. > > Well, you could have a disk in the floppy drive that has a little > program on it that boots slot 7. A real fast way of doing this would > be to sector-edit sector 0, track 0, so that it started with 01 4C 00 > C7. This small change would allow you to have a practically unchanged > disk, so you could still save stuff to it. One problem with this suggestion is that it will leave the drive motor running (unless you happen to be booting something that turns it off again). A better chunk of code is: 01 AD E8 C0 4C 00 C7 This will turn off the drive motor then boot slot 7. Note that this code assumes the disk being booted initially is in slot 6. To be _really_ safe, use this: 01 BD 88 C0 4C 00 C7 This does a "LDA $C088,X", which turns off the drive motor for the slot that is being booted (relying on X containing the boot slot times 16, as it does for the standard Disk ][ firmware and all derivatives), then it jumps to the slot 7 entry point. (If you want to make it boot another slot, change the last byte from C7 to Cn, where n is the desired slot number.) Now, as to how you can set this up: use ZAP from Bag of Tricks, or the Sector Editor in Copy II+'s 5.25" bit copier (_not_ the "Nibble Editor"). If you don't have either of those, or don't know how to use them (they are quite complex), the following sequence of instructions should do the trick, as long as you can use ProDOS. 1. Initialize a blank 5.25" disk using your favourite disk formatting utility. 2. Get into BASIC.SYSTEM. 3. Make sure your newly formatted disk is in slot 6, drive 1. If you have any other disk drives, make sure there is no disk in them. If you have a hard drive, switch it off. (This is to prevent you from accidentally damaging the disk contents if you make a typo.) (If your disk drive is not in slot 6, E-Mail me for details of what you need to change, or see below and work it out for yourself.) 4. Type in CALL-151. This will put you in the monitor, and the prompt character should now be "*" instead of "]". 5. Type in the following sequence of commands, exactly as shown here. Press Return at the end of each line. 300:20 00 BF 81 20 03 60 320:03 60 00 10 00 00 1000:01 BD 88 C0 4C 00 C7 300G 3D0G Note: if you are reading this with a font that doesn't distinguish the letter "O" ("oh") and the digit "0" (zero), note that all of the "0"s above are zeros. Similarly, all "1"s are the digit one, not the letter "ell". After the "300G" line, the 5.25" drive will be activated briefly. This is writing the new boot block. The "3D0G" line will take you back to BASIC. Turn your hard drive back on, and try rebooting the machine by typing PR#6. This will boot the 5.25" drive, which should then boot the hard drive and turn off the 5.25" drive motor. As Edhel noted, you can still use this blank disk to store data files. This technique should work with either a DOS 3.3 or ProDOS disk, but do _NOT_ attempt to use the above sequence of commands under DOS 3.3. It will crash! For the slightly more technically inclined, the above lines are performing the following actions: 300:20 00 BF 81 20 03 60 This is setting up a small subroutine at location $0300 that will call the ProDOS-8 Machine Language Interface (MLI) to perform a block write call (call number $81). The parameter block is at location $0320. The MLI entry point is at $BF00, so the first three bytes are a JSR $BF00. The next three bytes are the ProDOS MLI call number and parameter block address. The "60" on the end is an RTS instruction. 320:03 60 00 10 00 00 This is setting up the parameter block for the call. The "03" is the parameter count, "60" is the unit number (slot 6, drive 1), "00 10" is the buffer address ($1000, in the usual 6502 reversed byte order) and "00 00" is the block number ($0000). 1000:01 BD 88 C0 4C 00 C7 This is setting up the code to be placed at the start of block 0 of the disk. We don't care what the rest of the boot block contains, as it will not be used. 300G Call the subroutine at $0300, which will call ProDOS and tell it to write the 512 bytes of memory starting at location $1000 to block $0000 of the disk in slot 6, drive 1. After ProDOS has done this and returned, the subroutine will return to the monitor. 3D0G Warm start BASIC. -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand