Initialization commands
Programming Features - Drive Initialization Commands
This section is a summary of different drive init commands that seem to work best for a variety of disk drive devices. A drive init command is simply a command that tells the disk drive to prepare for access, and a method by which you can specify which partition (LU and USER for Lt. Kernal users) or subdirectory to use on 1581, RamLink, or Hard Drive systems.
Since some devices may require multiple commands, you can separate individual commands with the exclamation point "!" character. Also, since (as far as I know) the initialize command is universal to all Commodore drives, you can also change the drive number used by Color 64 by following an "i" command with the drive number of your choice. Thus, to select drive number 13 (perhaps on a CMD HD), you would include an "i13" command somewhere in the init command. This will change the variable DR$ (drive number) to reflect the current drive number in use. Note that if you DO use the "i" command in a drive init string, this WILL override the drive number (0 or 1) you used in SETUP. Note that the "i" command does NOT change the drive number for init commands entered in the bootmaker programs (bootmaker, bm ram, and bm small).
Here are the different init commands:
- 1541 or compatible disk drive: a simple "i0" command should suffice.
- SFD 1001, CBM 2031, CBM 9060, CBM 9090, or other single drive devices: use the "i0" command.
- MSD-SD2, CBM 4040, CBM 8050, CBM 8250, or other dual drive devices: you can use "i0" to select drive 0, or "i1" to select drive 1.
1571 or Compatible Disk Drives
This disk drive can behave in 3 different ways: 1541 single drive mode, 1571 double capacity mode, or 1571 dual side mode. If you want to use the 1571 in 1541 mode, single sided, 664 blocks per disk, then you can just use "i0" just like a 1541. But since the 1571 is a double-sided drive, it can store 1328 blocks in one directory in 1571 mode, or 664 blocks in separate directories on each side of the disk. I recommend the latter arrangement, since you will have twice the space in the directory (144 files on each side) and it has been found that 1571s run more reliably in this mode. Anyway, if you want to have one directory of 144 files/1328 blocks free, use "u0>m1!i0". If you want to have two directories of 144 files/664 blocks each, use "u0>h0!i0" for the normal side, or "u0>h1!i0" for the second side. Also, when using a 1571 in one of these modes, make sure you have a properly formatted diskette. If you don't already have a diskette formatted, you can use the DOS wedge in the JiffyDos, MSG EDITOR, or the BBS and enter in the same drive command followed by the command to format the disk. Example:
- 1571 mode - u0>m1 then n0:diskname,id
- 1541 mode side 0 - u0>h0 then n0:diskname,id
- 1541 mode side 1 - u0>h1 then n0:diskname,id
Note that a 1571 emulation mode partition on a CMD HD does not accept any of these commands, because it is simply a simulation of the double sided 144 files/1328 blocks mode. Use a 1541 emulation mode partition if you need to use something as a single side 1571 disk, because a 1541 mode partition supports 1571 burst commands.
1581 Disk Drives
This disk drive has a few special features of its own. This 3.5" disk drive already uses both sides of the diskette, so you do not need to concern yourself with this element. However, the 1581 does support partitions, but it is not necessary to use this feature. If you do not wish to use partitions, a simple "i0" command will suffice.
If you do wish to use partitions on the 1581, you must follow instructions in your disk drive manual to create the partition, or you can use a 1581 utility program to create the partition for you. The command you should use to select the partition is "i0!/!/0:PARTITION NAME". The "i0" is to initialize the drive, the "/" is to make sure the root directory is selected, and the "/0:PARTITION NAME" is to select the partition. You can omit the "/" that is all by itself if you wish, because the "i0" command should automatically select the root directory. If you notice errors, though, you should put the extra command back in to ensure proper partition use. If you need to select a partition within another partition, simply tack on another "!/0:PARTITION NAME" to the end of the init command. And finally, if you need to select the root directory, a "i0!/" command or a simple "i0" command should do the trick.
The stock 1581 drive produced by Commodore has a few bugs in it that make it very unreliable for use on a BBS system. If you must store anything on a 1581 drive, be sure to limit it to public messages or downloads or something that is not vital to BBS operations. You should avoid running your overlays on a 1581 drive. However, if you are using JiffyDos on your 1581, the original Commodore bugs should be fixed, and it should be fine to use a JiffyDos drive. Also, a 1581 emulation mode partition on a CMD HD behaves exactly like a 1581, but without the bugs. See the CMD HD section on how to properly use a 1581 emulation mode partition.
CMD Hard Drive and CMD RamLink
The first thing you need to do is select the proper partition. This is accomplished by using the "cp" and "i" commands. For example, to select partition 2 you would use the command "cp2!i2". This applies to ANY partition, regardless of its type. For 1541 or 1571 emulation mode partitions on the CMD HD, no additional commands are necessary. For 1581 emulation mode partitions, you may need to add a "/0:PARTITION NAME" command to select a 1581 style partition.
For native mode partitions on the CMD HD, you can also use subdirectories. This is accomplished through the "cd" command. For example, to select the subdirectory "games" in native mode partition 5, you would use "cp5!i5!cd//games". Note you need to include the "i5" command to ensure that the BBS system knows to use drive number 5.
CMD FD series drives
As of this writing, I have not had a chance to use one of these advanced 3.5" floppy drives. However, since the FD drives are supposed to be compatible with standard 1581 disks, it should accept the same commands for initialization and partition selection. See your drive manual for information on other commands.
Lt. Kernal Hard Drive
The Lt. Kernal HD divides its storage up into LU's (logical units) and USERs. A logical unit can be compared to a separate partition of storage space, independent of the other LU's. A USER can be compared to a subdirectory, sharing the common space of the LU with all the other USERs. LU's can have a number from 0 to 9, while USERs are numbered from 0 to 15.
On the Lt. Kernal HD, the "l" command is used to select the LU and USER, and is in the form l<device><LU><USER>, where device is the device number of the Lt. Kernal HD (usually 8), LU is the logical unit number (0 to 9), and USER is a hexadecimal number from 0 to F (the letters A through F correspond to the numbers 10 through 15, respectively).
You also need to include an "i" command to set the drive number (LU number) on the Lt. Kernal. For example, to select LU 2, USER 11, you would use the command "l82b!i2". To select LU 0, user 5, you would use "l805!i0". Just remember that for the USER number, the letters A, B, C, D, E, and F are used to mean 10, 11, 12, 13, 14, and 15, respectively.
In testing with 8.1/8.1a and LT Kernal, the above is a crucial point for disk access. However, it still can get confusing.
When in +SETUP, select device as “8” as specified, then on Drive Init command prompt, enter in this format (example shown: LU 2 User 2).
| LU 0 / User 0 | LU 1 / User 0 |
![]() |
![]() |
| LU 2 / User 3 | LU 2 / User 10 |
![]() |
![]() |
ICT Hard Drive
The ICT HD has two parts, the built-in floppy disk drive, and a hard drive. You should not use the "i" command in the init commands for an ICT HD, because this could confuse the HD. Rather, set the drive number to 0 in allcases in SETUP. Here is a summary of commands: "h0" selects the built-in floppy drive. "h" followed by a number greater than 0 will select the appropriate HD partition. For example, "h2" will select partition 2. The "hm4" command is the partition chain command. For example, to chain partitions 5 to 7, you would use "hm4 5 7". If you are going to use partition chains, you must have the special ICT merges installed in your BBS. See the section on the using the ICT HD with Color 64 for more information.
Ram Expansion Unit
Although the 17XX series REU is not a true disk device, it nevertheless simulates the operation of a disk device. A simple "i0" command should be fine.
Next Section: Programming How-to



