Apple Disk Booster
This unusual program increases the amount of storage space on Apple disks in DOS 3.3. It runs on any Apple Il-series computer with a disk drive.
If you use a disk drive, you know that disk space is a precious commodity. One way to increase disk storage is to buy special hardware. But that's a costly proposition. "Apple Disk Booster" offers a simple, inexpensive alternative. It lets you format new disks with up to five extra tracks, creating more than 21,000 bytes of extra storage space per disk.
Type in Apple Disk Booster and save a copy before you run it. The program is written entirely in Applesoft BASIC. First the program prompts you to insert a blank disk in drive 1, and then it initializes the disk. Because different drives allow a different number of extra tracks, Apple Disk Booster will format only as many extra tracks as your drive can reliably use. The program automatically reads and verifies each extra track. If a track cannot be used, restart the initialization using the next lower track value. When it finishes the initialization, the program displays the number of tracks formatted on that disk.
Since Disk Booster is now the HELLO program on the disk, delete it by typing DELETE DISK BOOSTER, D1 and pressing RETURN. (This prevents you from accidentally running it again.) The disk is now ready for normal use.
As noted above, different drives may not be able to use the same number of extra tracks. If you want to use your modified disk on a different drive, it's a good idea to determine beforehand whether the drive can access the extra tracks. To do this, simply run Apple Disk Booster on the second drive and note the number of tracks displayed when the program ends. Once you know the number of tracks that both drives can access, substitute that number for 40 in line 60 of the program, and run it again as needed.
If you later need to transfer files to a normal disk, use the DOS FILEM utility on the Apple System Master disk.
Squeezing extra tracks onto an Apple disk is surprisingly easy to do. This program modifies values used by the DOS routines that initialize the disk and create its Volume Table Of Contents (VTOC). Apple disks are normally formatted with 35 tracks. The first POKE in line 130 forces DOS to format more tracks by substituting a larger number-of-tracks value.
|01||Track of first catalog sector|
|02||Sector of first catalog sector|
|03||DOS release number (3.3, etc.)|
|27||Max number of track/sector pairs|
|30||Last allocated track|
|31||Direction of allocation|
|34||Number of tracks per disk|
|35||Number of sectors per track|
|36–37||Number of bytes per sector|
|38–3B||Bit map of track 0|
|3C–3F||Bit map of track 1|
|40–43||Bit map of track 2|
|BC–BF||Bit map of track 33|
|C0–C3||Bit map of track 34|
|C4–FF||Bit maps of additional tracks (if desired)|
The remaining POKEs in that line adjust the VTOC and bitmap accordingly. The bitmap is a portion of the VTOC that shows where free sectors are located on the disk. Each track has four bytes in the bitmap (two bytes are never used), and each bit represents a corresponding sector in the track. If a bit is off (set to 0), the sector is already allocated. If a bit is on (1), the sector is free. Here is the general format of the VTOC and bitmap.
To ensure that the VTOC and bitmap accommodate the extra tracks, the last two POKE statements in line 130 set new values for the number of tracks on the disk and the size of the bitmap. If 40 tracks are formatted, the bit map is 160 (40 × 4) bytes in size. Of course, it's important to be sure the disk drive can use the extra tracks reliably. Lines 440–510 of Disk Booster contain data for a machine language routine that checks the new tracks. It reads a random sector from each extra track and checks for read-back errors. If an error occurs, we assume the track cannot be accessed and reinitialize the disk without that track.
Apple Disk Booster
For instructions on entering this listing, please refer to "COMPUTE!'s Guide to Typing In Programs" published bimonthly in COMPUTE!.
05 100 TRACKS = 40 : REM # OF TRACKS VALUE F5 110 BITMAPSZ = TRACKS * 4 : REM BIT MAP SIZE 53 120 FOR ML = 768 TO 829 : REM LOC OF ML ROUTINE 58 130 READ BYTE : POKE ML, BYTE: C HKSUM = CHKSUM + BYTE 0l 140 NEXT 61 150 IF CHKSUM < > 9911 THEN HOME : PRINT "ERROR IN DATA STATEMENTS" : GOTO 260 B8 160 POKE 216, 0 : ONERR GOTO 270: REM RESET ONERR FLAG A1 170 POKE 48894, TRACKS : POKE 46063, TRACKS : POKE 44725, BITMAPSZ E8 180 HOME : PRINT "FORMATTING"; TRACKS; " TRACKS…" F7 190 PRINT CHR$ (4); "INIT DISK BOOSTER, D1" C9 200 CALL 768: REM CAL VERIFY TRACKS ML ROUTINE AT $0300 5B 210 PRINT :"FORMATTING COMPLETE… " ; TRACKS; " TRACKS WRITTEN" E5 220 PRINT 8A 230 PRINT "DON'T FORGET TO LABEL" 8B 240 PRINT "YOUR NEW DISK WITH" 9F 250 PRINT "THE NUMBER OF TRACKS INITIALIZED!" 96 260 END 70 270 A = PEEK (222): REM ERROR CODE 76 280 ERRL = PEEK (218) + PEEK (219) * 256: REM ERROR LINE F5 290 IF A < > 8 THEN GOTO 350 B4 300 HOME : PRINT "ERROR DETECTED…" 78 310 PRINT "RESTTING NEW TRACK VALUE" EA 320 PRINT "PRESS < RETURN > TO CONTINUE" 0B 330 INPUT " "; IN$ : IF IN$ < > " " THEN GOTO 330 31 340 TRACKS = TRACKS - 1 : BITMA PSZ = TRACKS * 4 : GOTO 160 E3 350 PRINT "ERROR NUMBER ";A; " DETECTED IN LINE "; ERRL 83 360 PRINT " CHECK DOS PROGRAMMERS MANUAL" 65 370 PRINT " FOR ERROR TYPE " 95 380 PRINT " AND CORRECT IT ACCORDINGLY" 25 390 GOTO 260 E2 400 REM **(ERROR CODES FOR APPLE DOS 3.3** 87 410 REM 79 420 REM ERROR #4 = WRITE PROTECTED DISK (REMOVE PROTECT TAB) AE 430 REM ERROR #11 = SYNTAX ERROR (CORRECT TYPOS) AF 440 DATA 169, 0, 141, 235, 183, 141, 240, 183 AD 450 DATA 169, 1, 141, 244, 183, 169, 16, 141 0C 460 DATA 241, 183, 133, 209, 173, 254, 190 5E 470 DATA 141, 236, 183, 56, 233, 35, 144, 22, 133 94 480 DATA 210, 169, 183, 160, 232, 32, 181 1B 490 DATA 183, 176, 12, 206, 236, 183, 198 3F 500 DATA 210, 208, 240, 198, 209, 208, 224 8A 510 DATA 96, 169, 8, 141, 92, 170, 76, 213, 166