BASIC-DOS consists of a boot sector and three files, which must be in the root directory of the startup diskette:
| File | Contents |
|---|---|
| (boot sector) | Loads the other files and starts the drivers |
| BASDEV.COM | Built-in device drivers, followed by their initialization code (devinit) |
| BASDOS.COM | The DOS kernel, followed by its initialization code (sysinit) |
| COMMAND.COM | The BASIC-DOS Command Processor (the default SHELL) |
The startup diskette may also contain CONFIG.SYS (see Configuring BASIC-DOS) and HELP.TXT (used by the HELP command).
Unlike PC DOS, there is no separate BIOS-level file (IO.SYS or IBMBIO.COM); BASIC-DOS relies on the ROM BIOS for low-level services, and its device drivers fill the role of IBMBIO.COM. The initialization code at the end of BASDEV.COM and BASDOS.COM is discarded once it’s done, and its memory is reused.
The boot sector runs in three parts:
Sysinit then:
Successive loads of the same program (eg, COMMAND.COM in several sessions) are served from a cached copy of the file, so the disk is read only once.
| Address | Contents |
|---|---|
| 0000h | Interrupt vector table |
| 0400h | ROM BIOS data area |
| 0500h | BASIC-DOS low memory data: drive info, device list head (50Ah), DPT (522h), BOOT_KEY (52Dh), DDINT entry points (530h) |
| 0540h | FAT sector buffer (header and 512-byte sector) |
| 0750h | Directory sector buffer (header and 512-byte sector) |
| 0960h | BIOS_END: device drivers (BASDEV.COM), followed by the DOS kernel (BASDOS.COM) |
| Resident tables: SCBs, SFBs, BPBs | |
| Memory arena: MCB chain (programs, COMMAND.COM blocks, and free memory) |
The memory arena is a chain of Memory Control Blocks (see MCB), as in PC DOS. DOS_MEM_ALLOC normally allocates from the bottom of the first free block that’s big enough, but with MCBTYPE_HIGH (80h) set in AL, it allocates from the top of the last one. COMMAND.COM allocates its code, text, variable, and string blocks from the top, so that the memory it frees before running a program stays contiguous.
Unlike PC DOS, BASIC-DOS doesn’t give a program all available memory: a COM program gets its file size plus a heap (at least MINHEAP, or 1K, or more if the program requests it; see COMDATA), and an EXE program gets its image size plus the minimum its header requests (EXE_PARASMIN), rather than the maximum (EXE_PARASMAX). This leaves memory available for other sessions.
Each session is described by a Session Control Block (see SCB), which records the session’s console context, standard file handles, current PSP, stack, DTA, CTRL-C and exit handlers, and wait state.
Sessions are scheduled preemptively: hardware interrupt handlers (eg, the CLOCK$ driver’s timer handler) exit through DDINT_LEAVE, which can switch to another runnable session. A session that’s waiting for something (eg, keyboard input or a timer) calls DOS_UTL_WAIT with a wait ID, which makes it non-runnable until a driver calls DOS_UTL_ENDWAIT with the same ID.
Code that must not be interrupted by a session switch can use DOS_UTL_LOCK and DOS_UTL_UNLOCK; a switch requested while the session is locked is deferred until it’s unlocked.
Each session has its own console context (if it was given one by a CONSOLE= line), and keyboard input goes to the context with focus (Shift-Tab switches the focus). Sessions without a console of their own (eg, the sessions that run the commands of a pipeline) use the handles supplied in their Session Parameter Block (see SPB).
| Vector | Use |
|---|---|
| 00h, 04h | Divide error and overflow: the program is terminated (exit types EXTYPE_DVERR and EXTYPE_OVERR) |
| 01h, 03h | Single-step and breakpoint (used by DEBUG builds) |
| 20h | Terminate program |
| 21h | DOS functions (see DOS Functions) |
| 22h | Exit address |
| 23h | CTRL-C handler address |
| 24h | Critical error handler address (critical error handling isn’t implemented yet) |
| 25h, 26h | Absolute disk read and write (not implemented yet) |
| 27h | Terminate and stay resident (not implemented yet) |
| 28h | Idle notification (default handler only) |
| 29h | Fast console output (installed by the CON driver) |
| 2Ah-2Fh | Reserved (default handlers only) |
| 30h | CALL 5 far jump (overlaps vector 31h) |
| 32h | BASIC-DOS utility functions (see Utility Functions) |
Programs should use DOS_MSC_SETVEC (25h) to set vectors 22h, 23h, and 24h, which BASIC-DOS stores in the current session’s SCB, rather than writing the vector table directly.
Copyright (c) 2020-2026 Jeff Parsons Released under MIT License