OS65D V3.3 ROM DOS Manual

OS-65D 3.3 rewritten to run from EEPROM on the HobbyPCB 65C02 SBC: what's new, memory map, disk format and a full command manual.

The disk operating system for the HobbyPCB 65C02 SBC and Floppy Disk Interface no longer has to be booted from disk. The whole of OS-65D 3.3 has been rewritten to live in the EEPROM, so it is there the moment the board is powered up. Along the way it has picked up 14-character filenames, a sorted directory, a set of new file and memory commands, and a FORTH interpreter with disk access.

It runs on the standard 65C02 SBC with the Floppy Disk IF, using real Shugart-type 5.25" drives or Gotek / FlashFloppy emulators with .HFE images.

What has changed

  • DOS resident in ROM. The DOS kernel is in EEPROM, not loaded from disk. This frees the RAM the disk-based DOS used to occupy and frees the DOS tracks on every disk image for your own files. The extra free RAM is especially useful for assembling bigger programs with the OSI Assembler.
  • Stock compatible. Stock entry points and addresses are kept, so BASIC, the Assembler (AS), the Extended Monitor (EM) and stock utilities such as BEXEC* still load and run from your existing disks. Existing disk images do not need to be modified.
  • 14-character filenames. The directory holds 16-byte entries: a 14-character name plus start and end track (see OS65DV3 Long Filenames).
  • Sorted directory. DI lists files in start-track order and shows the free tracks on the disk.
  • New commands for saving machine code by name, Intel HEX loading, copying tracks, renaming and typing files, verifying tracks, and memory dump / fill / move.
  • FORTH in ROM at $A000 with disk routines, started with FT.
  • Faster disk timings tuned for Gotek / SD-card emulators. The D9 (disable error 9) command has been removed as it is no longer needed.
  • Drive select fixed for drives A–D (74LS138 decode from PA6/PB5), with a new PX diagnostic that shows the PIA values for each drive.
  • Network terminal. The SBC->Network Bridge lets you reach the SBC console over your local network with a telnet client such as PuTTY, including a remote reset.

Memory map

The ROM DOS uses a 32K EEPROM (28C256) covering $8000–$FFFF, with the I/O areas decoded out of it.

Address Use
$0000 - $7FFF 32K RAM
$8000 Console ACIA (6850) – serial terminal
$9000 VIA (6522) – decode restricted to its registers, rest of $9000 block free
$A000 - $BFFF FORTH interpreter with disk routines (ROM)
$C000 - $C003 Disk PIA (6821)
$C010 - $C011 Disk ACIA (6850)
$D000 - $DFFF DOS extension commands (ROM) – replaces the old VDU area
$E000 - $FFFF OS-65D 3.3 DOS kernel, command interpreter and reset vectors (ROM)

Note: with $D000–$DFFF used by the ROM, the 32x64 VDU cannot be fitted at $D000 at the same time. The console is the serial terminal.

Disk format

Disks are single-sided 40-track (tracks 00–39). The directory is on track 12, sectors 1 and 2, exactly where stock OS-65D keeps it, but each entry is now 16 bytes:

Bytes Contents
0 - 13 Filename, 14 characters, space padded
14 Start track
15 End track

Older disks with the stock 8-byte directory (6-character names) can be converted to the new format with Dircnv3.3.asm, which converts the currently logged-on disk. Always try it on a copy of the .HFE image first.

Download Dircnv3.3.asm

Getting started

  1. Program the 32K ROM image (download EEPROM_8000-FFFF.bin) into a 28C256 EEPROM and fit it to the SBC.
  2. Connect the Floppy Disk Interface (PIA at $C000, ACIA at $C010) and a drive or Gotek.
  3. Connect a serial terminal (PuTTY, TeraTerm etc.) to the console port. CAPS LOCK ON!
  4. Press reset. The DOS signs on and shows the drive prompt, e.g. A*
A*DI
A*BASIC
A*SE B
B*

The prompt letter is the currently selected drive (A–D). Commands are typed after the * and ended with RETURN. As in stock OS-65D, only the first two letters of a command are significant, so SELECT B and SE B are the same. Addresses and data are in hexadecimal; track numbers are 00–39.

Instruction manual

Commands marked NEW are additions in the ROM DOS. Commands marked stock behave as described in the OS-65D Tutorial and Reference Manual, with any differences noted.

In the syntax below, NNNN is a 4-digit hex address, TT a 2-digit track, S a sector, FILENAME a name of up to 14 characters and D a drive letter.

1. Directory and files

DI – NEW Lists the directory of the selected drive with full 14-character names, sorted into start-track order, followed by a list of the free tracks.

DI TT – stock Lists the sectors on track TT (the stock OS-65D sector map), as before.

A*DI
A*DI 12

LO FILENAME or LO TT – stock Loads a BASIC program or Assembler source file into the workspace by name or by track.

PU FILENAME or PU TT – NEW Saves the current BASIC program or Assembler source under a 14-character filename. If the file already exists it is overwritten in place.

A*PU MYPROG

MS NNNN MMMM FILENAME@LLLL – NEW Saves machine code from NNNN to MMMM to disk by name, recording LLLL as the load address. A new directory entry is created on free tracks.

A*MS 7A00 7FFF FRED.MC@7A00

XQ FILENAME – stock Loads a file and executes it.

RN OLDNAME NEWNAME – NEW Renames a file in the directory. The tracks it occupies are not changed.

TY FILENAME – NEW Types a text file (BASIC or Assembler source) to the terminal without loading it into the workspace. It also types FORTH .fth files, showing which screen each part comes from.

VE ST ET – NEW Verifies the disk from start track ST to end track ET by reading every sector and reporting any read errors.

A*VE 00 39

CO TT TT D – NEW Copies a range of tracks (first track, last track) from the selected drive to drive D. Useful for backing up a disk image to a second Gotek.

2. Drives

SE D – stock Selects drive A, B, C or D. The prompt changes to show the selected drive, and DI and all file commands act on it.

PX – NEW Drive diagnostic. Selects each drive in turn and prints the disk PIA port values, so you can check the drive-select lines (SEL1–SEL4, decoded by the 74LS138 from PA6/PB5) and the drive status signals.

HO – stock Steps the head of the selected drive back to track 00.

IN or IN TT – stock Initialises (formats) the whole disk, or just track TT. This destroys data.

3. Track and memory transfers

CA NNNN=TT,S – stock Loads sector S of track TT into memory starting at NNNN.

A*CA 7800=28,1

SA TT,S=NNNN/P – stock Saves P pages (256 bytes each) of memory starting at NNNN to track TT, sector S.

EX NNNN=TT – stock Reads the whole of track TT raw into memory at NNNN.

GO NNNN – stock Runs machine code at address NNNN.

4. Memory utilities

MD NNNN MMMM – NEW Memory dump: displays memory from NNNN to MMMM in hex and ASCII.

A*MD 7800 787F

MF NNNN MMMM VV – NEW Memory fill: fills NNNN to MMMM with the byte VV.

MM NNNN MMMM DDDD – NEW Memory move: copies the block NNNN–MMMM to destination DDDD. Overlapping blocks are handled correctly.

HL – NEW Intel HEX load. After typing HL, send an Intel HEX file from your terminal program (as a text file or paste). Each record is written to memory at its own address; loading ends at the end-of-file record. Assemble on the PC, send it over, then save it with MS.

5. Languages and programs

  • BA – stock – loads BASIC from disk.
  • AS – stock – loads the OSI Assembler/Editor from disk.
  • EM – stock – loads the Extended Monitor from disk.
  • RE B / RE A / RE E / RE M – stock – re-enters BASIC, Assembler, Extended Monitor or Monitor without reloading.

All three programs run unchanged, and because the DOS is in ROM there is more free RAM available to them. Return to the DOS from BASIC with EXIT and from the Assembler with !EXIT as usual.

FT – NEW Starts the FORTH interpreter in ROM at $A000. FORTH has its own disk routines for reading and writing blocks, so FORTH source and programs can be kept on the same disks.

SY, SY N or SY V – NEW Lists the Assembler's symbol table after an assembly, sorted by name (N) or by value (V).

6. I/O

  • IO NN,MM – stock – sets the input (NN) and output (MM) device flags.
  • ME NNNN,MMMM – stock – sets the memory I/O input and output pointers.

Removed

D9 – disable error 9. Not needed with the faster disk timings, so it has been removed.

Command quick reference

Cmd Syntax Action
AS AS Load Assembler/Editor stock
BA BA Load BASIC stock
CA CA NNNN=TT,S Load sector into memory stock
CO CO TT TT D Copy tracks to another drive new
DI DI Sorted directory + free tracks new
DI DI TT List sectors on track TT stock
EM EM Load Extended Monitor stock
EX EX NNNN=TT Read whole track into memory stock
FT FT Start FORTH at $A000 new
GO GO NNNN Run machine code stock
HL HL Load Intel HEX from terminal new
HO HO Home head to track 00 stock
IN IN [TT] Initialise disk or track stock
IO IO NN,MM Set I/O device flags stock
LO LO FILENAME / LO TT Load source file stock
MD MD NNNN MMMM Memory dump new
ME ME NNNN,MMMM Set memory I/O pointers stock
MF MF NNNN MMMM VV Memory fill new
MM MM NNNN MMMM DDDD Memory move new
MS MS NNNN MMMM FILENAME@LLLL Save machine code by name new
PU PU FILENAME / PU TT Save source file (14-char names) new
PX PX Drive / PIA diagnostic new
RE RE A/B/E/M Re-enter Assembler/BASIC/EM/Monitor stock
RN RN OLDNAME NEWNAME Rename file new
SA SA TT,S=NNNN/P Save memory to track stock
SE SE A/B/C/D Select drive stock
SY SY [N/V] List assembler symbol table new
TY TY FILENAME Type text file (incl. .fth by screen) new
VE VE ST ET Verify tracks ST to ET new
XQ XQ FILENAME Load and execute stock

Network terminal

An ESP32 (or ESP32-C3 Super Mini) running the SBC65Bridge firmware connects to the SBC console's TTL serial header (GND, TX, RX, VCC) and to your Wi-Fi. You can then open a telnet session to it with PuTTY and use the SBC from anywhere on your local network. The bridge can also pull the SBC's reset line, giving a remote reset. See HobbyPCB SBC->Network Bridge.

Note: the console header is TTL level (no MAX232). Do not connect a second terminal, such as a VT100, to the same TX/RX lines while the bridge is connected, as two devices driving RX will corrupt the console data.