MSX-DOS
MSX-DOS is a disk operating system designed for the MSX family of 8-bit home computers, serving as a Z80-optimized port of Microsoft's MS-DOS 1.25 that provided file management, command-line interface, and compatibility with CP/M applications on MSX hardware.[1][2] Developed primarily by Tim Paterson under contract from Microsoft in 1983, with collaboration from ASCII Corporation's Jey Suzuki, MSX-DOS originated as an adaptation of 16-bit MS-DOS code manually translated to Z80 assembly using an emulator, enabling disk-based operations on MSX systems that previously relied on cassette tapes or cartridges.[1] The project began with a beta delivery on October 26, 1983, and achieved final acceptance on April 23, 1984, culminating in the initial public release of version 1.00 on June 20, 1984.[1] Early versions supported basic file operations via File Control Blocks (FCBs), FAT file system compatibility with MS-DOS, and up to eight disk drives, while requiring a minimum of 64 KB RAM and integrating with MSX-DOS's internal commands such as DIR, COPY, FORMAT, and TYPE.[2] It also featured an I/O system layer for direct disk access and an Easter egg crediting Paterson and Suzuki in the code.[1] Subsequent updates refined stability, with version 1.02 released on November 14, 1984, and 1.03 on December 15, 1984, addressing bugs like disk formatting issues.[1] The major evolution came with MSX-DOS 2, released in July 1988 in Japan and mid-1989 in Europe, developed solely by ASCII after Microsoft's reduced involvement following the MSX2 launch.[3] This version introduced subdirectories, environment variables, memory mapper support for up to 16 MB RAM, temporary pipe files, and peripheral redirection, while requiring 128 KB RAM and bundling with Disk BASIC 2.0.[3][2] Later patches by the MSX community extended it to versions like 2.4x for enhanced compatibility with MSX turbo R machines.[3] Overall, MSX-DOS facilitated the transition of MSX computers from ROM-based BASIC environments to versatile disk operating systems, supporting productivity software, games, and development tools while maintaining binary compatibility with many CP/M programs through system calls for file access, search, and device handling.[2] Its command structure mirrored early MS-DOS, including batch files (.BAT) and executable files (.COM), and it operated via components like MSXDOS.SYS (the BDOS kernel) and COMMAND.COM (the command interpreter), loaded into memory upon boot.[2] Despite the MSX platform's regional popularity, particularly in Japan and Europe during the 1980s, MSX-DOS's legacy endures in retro computing communities through emulators and reproductions.[3]Overview
Definition and Purpose
MSX-DOS is a discontinued disk operating system developed by Microsoft in collaboration with ASCII Corporation, specifically for the 8-bit MSX home computer standard.[1] It was created as a Z80-based adaptation of MS-DOS 1.25, enabling reliable disk operations on MSX hardware while maintaining compatibility with the platform's cartridge-centric design.[1] The primary purpose of MSX-DOS was to facilitate file management, program loading, and basic input/output (I/O) operations tailored to the MSX's Z80 processor and its emphasis on modular cartridges for software distribution.[1] Initially released in 1984 to support floppy disk usage on MSX systems, it provided a single-user command-line interface akin to early versions of PC DOS, allowing users to store, retrieve, and execute programs from removable media.[4] In its role, MSX-DOS served as an intermediary between the MSX-BIOS firmware and user applications, managing disk access through an abstracted I/O layer to prevent direct hardware conflicts and ensure stable operation across diverse MSX implementations.[1] This design bridged the gap between the low-level BIOS routines and higher-level software needs, optimizing resource use in the constrained 8-bit environment.Relationship to MSX Hardware and Standard
The MSX standard, introduced in autumn 1983 by ASCII Corporation in collaboration with Microsoft, defined an 8-bit home computer architecture based on the Zilog Z80A microprocessor running at 3.58 MHz, aiming to unify the fragmented home computing market similar to the VHS standard for video.[5] This architecture incorporated the MSX-BIOS as a core hardware abstraction layer, providing device independence and plug-and-play functionality through standardized routines that allowed software to interact with varying hardware implementations without direct port access, ensuring extensibility across manufacturers like Sony, Philips, and Yamaha.[5] MSX-DOS integrates deeply with this standard by leveraging MSX-BIOS calls for input/output operations, enabling support for peripherals such as floppy disk drives (including 3.5-inch 1DD/2DD formats with 8 or 9 sectors per track), ROM/RAM cartridges via expansion slots, and devices like printers (via LST/PRN device files), joysticks, and RS-232C interfaces through the system's 8255 PPI and dedicated ports.[2][6] The operating system employs interslot calls to access the BIOS from its kernel in the disk interface ROM, treating consoles (CON), null devices (NUL), and auxiliary ports (AUX) as file-like entities accessible via BDOS system calls at address 0005H, which abstract hardware differences like slot configurations and memory mapping across the platform's up to 16 expandable slots.[2][6] As a unique adaptation, MSX-DOS represents a hybrid influenced by MS-DOS 1.25—sharing file formats, commands, and disk compatibility for seamless upgrades to 16-bit systems—and CP/M, with BDOS calls allowing unmodified execution of most CP/M applications, all tailored to the MSX's base 64 KB RAM (expandable to 1024 KB via slots) and Z80-specific interrupt handling via system calls that differ from the IBM PC's 8086-based vectors.[2] This design uses a transient program area (TPA) starting at 0100H for user programs and a system scratch area at 00H-FFH, ensuring efficient memory allocation while maintaining hardware abstraction.[2] MSX-DOS requires MSX-BIOS version 1.0 or higher, corresponding to the foundational MSX1 specification, to guarantee compatibility across MSX1, MSX2, and subsequent models without necessitating hardware modifications, provided a disk interface ROM and at least 64 KB RAM are present.[5][2][6]History and Development
Origins and Early Development
MSX-DOS was conceived in the early 1980s as an integral component of Microsoft's collaboration on the MSX standard, aimed at fostering a unified software ecosystem across diverse hardware from Japanese manufacturers like Sony, Yamaha, and Toshiba.[4] This initiative, driven by Kazuhiko Nishi—vice president of Microsoft Japan and co-founder of ASCII Corporation—sought to standardize 8-bit home computing in Japan following the IBM PC's influence, ensuring compatibility for software distribution amid a fragmented market.[4] The MSX standard was formally announced by Microsoft on June 16, 1983, with initial machines launching later that year, but lacking native disk operating system support, which highlighted the need for a dedicated OS to expand beyond cassette and cartridge media.[4] Development of MSX-DOS began in 1983, shortly after the MSX launch, under a contract from Microsoft to American programmer Tim Paterson, the original author of 86-DOS and early MS-DOS versions.[1] On August 10, 1983, Paul Allen, Microsoft's co-founder, commissioned Paterson to create a Z80-based port of MS-DOS 1.25 specifically for the MSX platform, with an agreement signed on August 17 for $100,000; Paterson completed a beta version by October 26, 1983.[1] The project was led by Microsoft Japan's team in collaboration with ASCII, which handled adaptations for the Japanese market; code was shipped to ASCII in October 1983, and Paterson visited Tokyo on January 28, 1984, to address integration issues with local engineers, including Jey Suzuki, who contributed to the I/O system.[1] MSX-DOS drew directly from the MS-DOS 1.25 codebase, utilizing Paterson's TRANS tool for Z80-to-8086 translation to ensure efficiency on the MSX's Z80 processor, while incorporating CP/M-like elements for better compatibility and resource management in an 8-bit environment.[1] Early challenges included adapting the PC-oriented MS-DOS architecture to the MSX's cartridge-dominant design, where software was primarily distributed via ROM cartridges rather than disks, and managing limited RAM—typically 16 to 64 KB in MSX1 machines, with MSX-DOS requiring at least 64 KB for operation.[1] Additional hurdles involved supporting single-density floppy drives common in early MSX peripherals, resolving disk-trashing bugs during testing, and reconciling codebase discrepancies between the U.S. and Japanese teams due to limited access to MSX hardware in Seattle.[1] These efforts culminated in the final delivery accepted by Microsoft on April 23, 1984, enabling a more robust disk-based software ecosystem for MSX users.[1]Release and Evolution
MSX-DOS 1 was finalized in 1984 but became publicly available in spring 1985, exclusively bundled with MSX disk drive peripherals for the MSX1 standard, marking the first official operating system for disk-based operations on these 8-bit home computers.[7] The system's evolution continued with the launch of MSX-DOS 2 in July 1988 by ASCII Corporation in Japan, coinciding with the maturing MSX2 hardware ecosystem to provide enhanced compatibility and features for the platform's growing software library.[3] European releases of MSX-DOS 2 followed in mid-1989, starting in the Netherlands, further extending its availability beyond the Japanese market.[3] This progression enabled broader adoption, including disk-based software libraries from various developers, fostering a niche ecosystem of third-party tools and utilities.[8] However, constrained by the MSX platform's limited global market penetration, official support for MSX-DOS effectively ended in the early 1990s alongside the discontinuation of MSX hardware production around 1993.[1]Technical Features
Boot Process
The boot process of MSX-DOS commences upon powering on the MSX computer, with the Z80 microprocessor initiating execution from address 0000h in the BIOS ROM of the primary slot. The MSX-BIOS conducts a cold boot initialization, configuring core hardware elements such as the Video Display Processor (VDP) for graphics, the Programmable Sound Generator (PSG) for audio, and the Parallel Input/Output (PIO) interface for peripherals, while displaying the characteristic MSX logo during this setup.[2] The BIOS then systematically scans all available memory slots to detect expansion ROMs, prioritizing cartridges before disk-based systems. For MSX-DOS to load from a disk, a disk interface ROM must be present and recognized by specific identifier bytes (41h and 42h) at the ROM's entry point; upon detection, the ROM's initialization routine executes to allocate work areas for attached drives, such as floppy disk controllers. This step integrates MSX-DOS with the MSX hardware standard, leveraging BIOS interrupts like INT 5 for subsequent disk I/O operations to abstract low-level hardware access.[2][9] With hardware prepared, the disk ROM reads the boot sector—logical sector 0 from the boot device (typically a 3.5-inch floppy in drive A:), consisting of 512 bytes—directly into memory at address C000h. This sector houses the initial bootloader code, which checks for a valid signature (such as EBh or E9h at the start) to confirm a bootable MSX-DOS volume. If the read encounters errors like "DRIVE NOT READY" or "READ ERROR," or if no valid boot sector is found (e.g., empty drive), the process aborts with an error message and defaults to loading Disk BASIC, providing essential error handling for boot failures. MSX-DOS uniquely supports both disk and ROM-based booting; in the latter case, a cartridge ROM can intercept the process earlier via slot priority.[2][10][9] Upon successful boot sector loading, the simple loader—particularly minimalist in MSX-DOS 1, often comprising just a conditional return instruction at offset C01Eh—prepares page 0 of memory for RAM mapping (carry flag set) and proceeds to load the MSXDOS.SYS kernel file from the disk root directory into RAM at address 0100h, the start of the Transient Program Area (TPA). Execution then transfers to 0100h, where MSXDOS.SYS relocates itself to a higher memory address to free the TPA, initializes core DOS structures including interrupt vectors and I/O redirection (routing disk calls through the BIOS INT 5 for compatibility), and sets up slot-switching routines to manage the MSX's memory mapper. This relocation ensures efficient use of the system's 64 KB or more of RAM, mandatory for MSX-DOS operation.[2][11] Finally, MSXDOS.SYS loads the COMMAND.COM shell into the now-available TPA at 0100h, relocates it as needed, and invokes it to complete file system initialization, including directory caching and drive assignment (up to eight drives supported). COMMAND.COM displays the MSX-DOS version banner and issues the command prompt (e.g., "A>"), ready for user input; if an AUTOEXEC.BAT file exists in the root, it executes automatically post-prompt. The entire sequence, from power-on to prompt, typically completes in under 10 seconds on standard MSX hardware with a functional floppy drive.[2][11]File System and Memory Management
MSX-DOS 1 employs a flat file system structure based on an early variant of the File Allocation Table (FAT) format, utilizing 512-byte sectors organized into clusters without support for subdirectories, limiting organization to a single root directory per volume.[2] This design accommodates single-sided disks primarily, with a maximum of 112 files per disk and no hierarchical path navigation beyond drive letters (A: through H:).[2] In contrast, MSX-DOS 2 introduces a more advanced FAT12-like file system that supports subdirectories, enabling tree-structured organization and full path specifications including drive, directory, and filename components in ASCIIZ format.[12] It also extends compatibility to double-sided disks (2DD format), using media descriptors such as 0F9H for 2DD with 9 sectors per track, while maintaining 512-byte sectors and cluster sizes typically set to 2 sectors to optimize space allocation.[2][12] Both versions incorporate file attributes to manage access and visibility, including read-only (bit 0 set in the File Control Block) and system/hidden flags (bit 1 for invisibility, bit 2 for system files), which prevent unintended modifications or listings.[2][13] Volume labels are supported, stored in the root directory as special entries with the volume attribute bit set; in MSX-DOS 2, these are modifiable via functions like 40h and occupy bytes 20-23 in the disk parameter block.[12] Cluster allocation relies on the FAT to chain sectors dynamically, starting from cluster 2, with 12-bit entries indicating next clusters or end-of-file (FFFH); this mechanism minimizes fragmentation by allocating contiguous clusters where possible and supports up to two FAT copies for redundancy.[2][12] Memory management in MSX-DOS begins with the base 64 KB RAM configuration required for all MSX systems, where the operating system kernel and resident components, including MSXDOS.SYS and COMMAND.COM, occupy approximately 8 KB in the upper memory area, leaving a Transient Program Area (TPA) of around 53 KB starting at address 0100H for user programs.[2][14] MSX-DOS 1 operates solely within this 64 KB limit without mapper support, relying on slot switching for ROM access but providing no expanded RAM handling.[2] MSX-DOS 2 enhances this through bank switching via mapper hardware, allowing access to up to 4 MB of total RAM by dividing it into 16 KB segments; these segments host file handles (up to 63), sector buffers, and a dedicated 16 KB data segment for environment strings and overlays outside the TPA.[12][14] A notable advancement in MSX-DOS 2 is the use of environment strings for configurable paths, such as the "PATH" variable defining search directories for executables and the "APPEND" item for additional locations, enabling flexible navigation beyond the fixed root-only access of MSX-DOS 1.[14] These strings, managed via functions 6BH (get), 6CH (set), and 6DH (find), support up to 255 characters and are initialized by COMMAND2.COM, contrasting with MSX-DOS 1's rigid drive-based file resolution.[14][12]Built-in Commands
MSX-DOS provides a collection of built-in commands integrated into the COMMAND.COM file for version 1 and COMMAND2.COM for version 2, enabling users to perform fundamental file management and system tasks directly from the command prompt without loading external executables. These commands are executed from RAM for rapid performance and form the core interface for interacting with the file system and peripherals. Approximately 15 such commands are available in MSX-DOS 1, expanding to more than 30 in MSX-DOS 2, which introduces enhanced wildcard support and rudimentary batch file capabilities for automating sequences of operations.[15][2][16] The built-in commands emphasize simplicity and compatibility with MSX hardware, supporting operations like file listing, copying, deletion, renaming, disk formatting, and content display. Wildcards such as* (matching any sequence of characters) and ? (matching a single character) are supported in many commands for pattern-based file handling, allowing users to target groups of files efficiently—for instance, *.BAS to specify all BASIC program files. Error handling includes standardized codes, such as error 02 for "File not found," which is returned when a specified file or path does not exist during operations like deletion or copying. Batch file support, limited to MSX-DOS 2, enables scripting via .BAT files with basic parameter substitution (e.g., %0 to %9) and commands like PAUSE for user interaction, though advanced control structures like IF-THEN are version-specific enhancements.[16][15]
Key built-in commands include:
-
DIR: Displays a list of files and directories in the current or specified path.
Syntax:DIR [filespec] [/W] [/P]
The/Woption shows files in wide format across multiple columns, while/Ppauses the output after each screenful.
Example:DIR *.BASlists all files with the .BAS extension, filtering for BASIC programs; if no matching files exist, it reports error 02 ("File not found").[16][2] -
COPY: Duplicates one or more files from a source to a destination, supporting device redirection.
Syntax:COPY [source] [destination] [/A] [/B]
The/Aflag treats files as ASCII (adding end-of-file markers), and/Bas binary. Wildcards are permitted for bulk operations.
Example:COPY A:*.COM B:transfers all .COM executable files from drive A to B, preserving their attributes unless overridden.[16][15] -
DEL (also known as ERASE): Removes specified files from storage.
Syntax:DEL [filespec] [/P]
The/Poption prompts for confirmation on each file to prevent accidental deletion. Wildcards enable mass deletion.
Example:DEL *.TMPdeletes all temporary files matching the pattern; attempting to delete a non-existent file triggers error 02.[16][2] -
REN (RENAME): Changes the name of an existing file without altering its content or location.
Syntax:REN [oldname] [newname]
Wildcards can rename multiple files by pattern, but the new name must not include drive or path specifiers.
Example:REN *.BAS *.TXTrenames all .BAS files to .TXT extensions in the current directory.[16][15] -
FORMAT: Initializes a disk for use with MSX-DOS, erasing all data and setting up the file system structure.
Syntax:FORMAT [drivename] [/S]
The/Soption copies system files (MSXDOS.SYS and COMMAND.COM) to the newly formatted disk for bootability. It prompts for confirmation to avoid data loss.
Example:FORMAT B:prepares drive B as a bootable MSX-DOS volume, displaying progress and any errors like insufficient space.[16][2] -
TYPE: Outputs the contents of a text file to the console.
Syntax:TYPE [filespec] [/P]
The/Pflag pauses at each screenful for long files. It is intended for ASCII files and may display binary data garbled. Wildcards are not supported.
Example:TYPE README.TXTshows the file's text; if the file is absent, error 02 is reported.[16][15]