Egghead.page Logo

How the Commodore 128 Handles Disk Swapping During Execution

This article explores the mechanics behind disk swapping on the Commodore 128 computer system. It examines the relationship between the Kernal ROM, the serial bus architecture, and the software loaders that necessitate physical media changes. Readers will gain insight into how programs manage memory and data retrieval when storage capacity exceeds a single diskette.

The Commodore 128 relies on its built-in Kernal ROM to manage input and output operations, including communication with floppy disk drives such as the 1541 or 1571. When a program executes, it does not inherently possess the ability to detect a physical disk change automatically. Instead, the software is programmed to pause execution at specific points where additional data is required. The program typically displays a message on the screen instructing the user to insert the next disk and press a key to continue. Once the user complies, the software resumes the loading process via the serial bus, transferring data from the new disk into the available RAM.

Memory management plays a critical role in this process because the Commodore 128 features 128 kilobytes of RAM, often exceeding the storage capacity of a single side of a 5.25-inch floppy disk. Developers utilized multi-load techniques to break large applications or games into segments. During execution, the current program segment might remain in memory while subsequent segments are loaded from swapped disks. In some cases, the initial loader occupies a specific memory bank, allowing other banks to be cleared and refilled with data from the newly inserted media without crashing the running code.

The hardware architecture influences the speed and reliability of this swapping process. The serial bus connection between the computer and the drive operates at a relatively slow speed compared to modern standards. When a disk swap occurs, the drive motor must spin up, and the read head must locate the specific track and sector requested by the software. The 1571 drive offered an advantage over the 1541 by supporting double-sided disks, which reduced the frequency of physical swaps for some software distributions. However, when the total data size surpassed even double-sided capacity, the manual swapping routine remained the standard solution for expanding storage availability during active sessions.

Ultimately, disk swapping on the Commodore 128 is a collaborative effort between the user, the software code, and the Kernal I/O routines. There is no hardware sensor to detect media insertion; the system relies entirely on the user following on-screen prompts to facilitate data continuity. This method allowed developers to create complex software experiences despite the physical limitations of floppy disk storage, defining the user experience of the 8-bit computing era.