BASIC-DOS

A PCjs Retro-Programming Project

Project maintained by jeffpar

PC DOS Reimagined

Read the Blog, check out the Preview, see a few of the original Demos, and then Download the current release.

BASIC-DOS 1.00

Download

The current BASIC-DOS release diskette is a bootable 360K diskette with BASIC-DOS, a “basic” set of utilities, and a few demo programs (including DONKEY.BAS, from PC DOS 1.00). See it running on the BASIC-DOS Release page, or download BASICDOS-360K, a diskette image that most PC emulators can boot, or which can be written to a genuine 360K diskette.

When we say that BASIC-DOS comes with a “basic” set of utilities, we mean that both figuratively and literally, because while some are written in assembly language, many are in fact written in BASIC, including CHKDSK, FORMAT, MODE, and more. BASIC-DOS takes its commitment to BASIC integration, performance, and ease-of-use very seriously.

Project Status

BASIC-DOS began as a technology demo: a reimagining of what the first IBM PC operating system could have been, with a unified DOS and BASIC command interpreter, preemptive multitasking sessions, and other features that PC DOS wouldn’t offer for years (if ever). The goal now is to turn it into a usable product.

It is not a goal to provide every PC DOS function, or to be 100% compatible with PC DOS. BASIC-DOS implements what its own commands and BASIC programs need, plus enough of the PC DOS API to run typical DOS programs, so unchecked items below are possibilities, not commitments.

This section tracks what’s been completed ([x]) and what remains ([ ]). Items marked partial work, but with known gaps.

Boot and System Configuration

Device Drivers

Protected Mode

On an 80286 or later with sufficient memory (256K or more), BASIC-DOS runs in protected mode by default, unless CPU=8088 is present in CONFIG.SYS (or you press R immediately after the “System starting” message), which selects real mode, the most compatible mode (eg, for MZ EXE files). All BASIC-DOS components are designed to run in either mode. See Protected Mode for details, and try any PC AT or DeskPro 386 demo (eg, the Extended Memory demo).

Kernel: Processes, Memory, and Sessions

Kernel: File System

Command Interpreter: DOS Commands

Utilities

Utilities live in the EXT directory of every BASIC-DOS disk: assembly language programs in EXT\CMD, and BASIC programs in EXT\BAS. The filters, HELP, SLEEP, VI, and DEBUG are assembly language, but utilities that don’t need that speed are written in BASIC-DOS BASIC: clean, succinctly commented programs, with every line indented by a tab (after a line number only where one is needed as a label), the style in which BASIC-DOS lists programs. The interpreter is extended as needed to make them possible (eg, IOCTL #, and opening unformatted volumes, for FORMAT).

Command Interpreter: BASIC Language

Floating-Point

BASIC-DOS will support only one floating-point type: IEEE 754 64-bit (double-precision) values. It won’t use any MBF (Microsoft Binary Format) code.

BASIC Samples

The poster child for BASIC samples support is DONKEY.BAS, from the original IBM PC DOS 1.00 diskette. DONKEY.BAS was our initial test candidate for BASIC-DOS’s compatibility with IBM PC BASIC programs. These are the items it needed, followed by related work that remains. Originally, BASIC-DOS compiled an entire program before running it, so there was a startup delay, and every statement had to be recognized, even those that DONKEY.BAS did not immediately need (eg, PLAY and CHAIN). However, BASIC-DOS now performs incremental compilation, so those are no longer concerns.

Build, Tests, and Documentation

DOS Commands and BASIC Statements

COMMAND.COM is both a DOS shell and a BASIC compiler, and a line can mix DOS commands (internal ones, like DIR and COPY, and external ones, like FIND or any other program) with BASIC statements (eg, DIR *.BAS : PRINT "done"), at the prompt and in BAT and BAS files alike. The two kinds are meant to feel like one language, but they still differ in a few ways:

  DOS commands BASIC statements
Arguments Words, used as typed: a file name can be quoted or a string variable (eg, TYPE F$), but expressions aren’t evaluated Expressions, so a file name must be a string (eg, OPEN "DATA" + N$ FOR INPUT AS #1); see Command Arguments
Switches Start with the switch character (eg, DIR /W), and one that a command doesn’t accept displays the command’s usage None (/ is division)
Redirection <, >, and >> after a command’s arguments (eg, SORT < NAMES.TXT > SORTED.TXT) :> and :>> at the end of the line, for every statement on it, since > means “greater than” (eg, PRINT X :> F$), except that > @n (a session’s console) needs no colon, since @ can’t begin an expression; there’s no input redirection
Pipes Between commands, at the prompt and in BAT and BAS files (eg, DIR \| SORT) At the end of a line at the prompt only (eg, FOR I=1 TO 9:PRINT I:NEXT \| SORT /R)
Failures A command that fails displays its message, sets ERRORLEVEL to 1 (a BAS utility, to its runtime error number), and the program continues; a successful command sets ERRORLEVEL to 0 (or a program’s exit code) A runtime error ends the program, unless ON ERROR catches it; statements don’t change ERRORLEVEL (except END n), so IF ERRORLEVEL tests the last command; see Error Handling
Redirection failures A > that can’t be opened fails only that command A :> (or > @n, even after a DOS command) that can’t be opened ends the program, as CTRL-C does
Colons A colon that begins a word ends the command, so a colon after a drive letter (eg, DIR A:) is part of it, and :> needs a space before it (DIR :> FILES.TXT, since A:>FILE means drive A:) A colon separates statements

Non-features

These aren’t project goals:

Roadmap

These are the next steps, roughly in priority order:

  1. Remaining string and input/output features (comma print zones)
  2. The rest of runtime error handling (messages for numeric errors other than “Division by zero”, such as “Overflow”)
  3. Common BASICA features that BASIC-DOS lacks: BEEP and COMMON
  4. The rest of protected mode on an 80286 or 80386: ring 3 for the programs that still need RING=0 (interrupt hooks that DOS or the ROM BIOS calls, and CPUTESTS); see Limitations
  5. 80386 sessions: the rest of the BIOS for V86.COM’s V86 machine, and the rest of the DOS functions for 32-bit LE programs

For BROGUE, the next steps are more puzzles per rating, rooms with 3 or 4 doors, and more kinds of objects. See the BROGUE puzzle rooms.

Ring 3 Security

A ring 3 program shouldn’t be able to corrupt or damage the system, even as DEBUG.COM. These potential issues remain, and the questions in them are still open:

License

BASIC-DOS is an open-source project on GitHub released under the terms of an MIT License.

Copyright (c) 2020-2026 Jeff Parsons Released under MIT License