Initialization commands

Programming Features - Drive Initialization Commands

Drive Initialization Commands Overview

This section summarizes drive initialization commands that work well with a variety of Commodore-compatible storage devices.

A drive initialization command is a command string sent to the disk device that prepares it for access. These commands are also commonly used to select partitions, logical units (LU), users, or subdirectories depending on the device being used.

Some devices require more than one command. Multiple commands can be chained together using the exclamation point (!) character.

Since the initialize command is supported by virtually all Commodore-compatible drives, it is commonly included in initialization strings. The i command may also be used to change the drive number used internally by Color 64.

For example, to select drive number 13 (such as on a CMD HD), the following command could be used:

i13

This updates the variable DR$ so that Color 64 knows the current drive number in use.

Note that if an i command is used in a drive initialization string, it will override the drive number (0 or 1) specified in +SETUP.

Also note that the i command does not change the drive number for initialization commands used in the Bootmaker utilities (bootmaker, bm ram, and bm small).

Common initialization commands:

  • 1541 or compatible drives
 Use: i0
  • SFD-1001, CBM 2031, CBM 9060, CBM 9090, or other single-drive devices
 Use: i0
  • MSD-SD2, CBM 4040, CBM 8050, CBM 8250, or other dual-drive devices
 Use i0 for drive 0 or i1 for drive 1.



1571 or Compatible Disk Drives

The Commodore 1571 can operate in three modes:

  • 1541 single-sided compatibility mode
  • 1571 double-capacity mode
  • 1571 dual-side mode

If operating the 1571 in standard 1541 compatibility mode (single-sided, ~664 blocks), the initialization command:

i0

works the same as with a 1541 drive.

However, because the 1571 is a double-sided drive, it can store:

  • 1328 blocks in a single directory in full 1571 mode, or
  • 664 blocks per side using two separate directories.

The second configuration is generally recommended because it provides two directories of 144 files each and has historically proven to be more reliable.

Initialization commands:

  • Single directory (1328 blocks):
u0>m1!i0
  • Side 0 (664 blocks):
u0>h0!i0
  • Side 1 (664 blocks):
u0>h1!i0

When using these modes, ensure the diskette is formatted properly.

You can format disks using the DOS wedge in JiffyDOS, the Message Editor, or from within the BBS.

Examples:

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 partition on a CMD HD automatically behaves as the double-sided 1328-block format and will not accept these mode commands.

If you need a single-side layout, use a 1541 emulation partition instead.



1581 Disk Drives

The Commodore 1581 is a double-sided 3.5″ disk drive, so both disk sides are always used automatically.

The drive also supports partitions, although they are optional.

If you are not using partitions, a simple initialization command is sufficient:

i0

If partitions are used, they must first be created using either:

  • the 1581 drive utilities, or
  • a partition management utility program.

To select a partition:

i0!/!/0:PARTITION NAME

Where:

  • i0 initializes the drive
  • / ensures the root directory is selected
  • /0:PARTITION NAME selects the partition

The standalone / command can often be omitted because i0 usually returns to the root directory automatically. If directory errors occur, restoring the extra / command may resolve them.

Nested partitions can be selected by adding additional commands:

!/0:PARTITION NAME

Selecting the root directory again can be done with either:

i0!/

or

i0

The stock Commodore 1581 firmware contains several bugs that can cause reliability problems in BBS environments. For this reason, it is recommended that critical system files (such as overlays) not be stored on a stock 1581 drive.

If JiffyDOS is installed in the 1581, these firmware issues are corrected and the drive can be used more safely.

A 1581 emulation partition on a CMD HD behaves exactly like a 1581 drive but without the firmware bugs.



CMD Hard Drive and CMD RamLink

When using CMD storage devices, the first step is selecting the appropriate partition.

This is done using the cp and i commands.

Example:

cp2!i2

This selects partition 2 and updates the active drive number accordingly.

This procedure works for all partition types.

For 1541 or 1571 emulation partitions, no additional commands are normally required.

For 1581 emulation partitions, you may also need to select the directory using:

/0:PARTITION NAME

For native mode partitions, subdirectories can be used. These are selected with the cd command.

Example:

cp5!i5!cd//games

This selects:

  • partition 5
  • drive number 5
  • the games subdirectory

The i5 portion ensures that Color 64 correctly updates its internal drive number.



CMD FD Series Drives

At the time of writing, the CMD FD series drives had not been fully tested with Color 64. However, because these drives are designed to be compatible with standard 1581 disks, they should accept the same initialization and partition commands used for the 1581.

Consult your drive manual for additional device-specific commands.



Lt. Kernal Hard Drive

The Lt. Kernal hard drive organizes storage into:

  • LU (Logical Units) — comparable to partitions
  • USER areas — comparable to subdirectories within an LU

LU numbers range from 0–9. USER numbers range from 0–15 and are expressed in hexadecimal:

  • A = 10
  • B = 11
  • C = 12
  • D = 13
  • E = 14
  • F = 15

The Lt. Kernal command used to select LU and USER is:

l<device><LU><USER>

Example:

To select LU 2, USER 11:

l82b!i2

To select LU 0, USER 5:

l805!i0

The additional i command is required so Color 64 updates the drive number internally.

Testing with Color 64 v8.1 / v8.1a confirmed that proper LU selection is essential for reliable disk access.

When configuring the drive in +SETUP, choose device 8 and enter the initialization string for the desired LU and USER.

Example configurations:

LT Kernal Setup Examples
LU 0 / USER 0 LU 1 / USER 0
 
 
LU 2 / USER 3 LU 2 / USER 10
 
 



ICT Hard Drive

The ICT hard drive system contains both:

  • a built-in floppy disk drive
  • a hard drive partition system

Do not use the i command in ICT initialization strings, as this can confuse the device.

Instead, configure the drive number as 0 in +SETUP.

Common commands:

  • h0 — Select built-in floppy drive
  • hN — Select hard drive partition N

Example:

h2 selects partition 2.

The command:

hm4

enables partition chaining.

Example:

hm4 5 7

chains partitions 5 through 7 together.

If partition chaining is used, special ICT merges must be installed in the BBS. See the section covering ICT HD integration with Color 64 for additional details.



Ram Expansion Unit (REU)

Although the Commodore 17xx series REU is not technically a disk device, it can emulate disk-like behavior for storage purposes.

A simple initialization command is usually sufficient:

i0

Next Section: Programming How-to

Programming Features