SpartaDOS X: Getting Started with the Command-Line DOS

SpartaDOS X (SDX) is the most capable DOS for the 8-bit Atari. It lives on a cartridge rather than a boot disk, gives you a command prompt instead of a lettered menu, and handles subdirectories, time and date stamps, hard drives, RAMdisks and batch files. ICD released it in the late 1980s. It is still developed today and runs on modern cartridges and storage interfaces, so it's worth learning if you use an SD-card or hard-disk setup.

What you'll learn: what SDX is and which version you're likely to have, how to format a disk and work with files from the D1: prompt, wildcards and directories, how to start programs, BASIC and cartridges, how to write batch files, the DOS 2 menu equivalents, and what CONFIG.SYS does.

What you need: SDX in some form. That can be the cartridge, one of the many flash-cartridge or storage-interface builds, or the Altirra and atari800 emulators, both of which support it. Modern SDX needs a 48K machine, and more RAM is recommended.

1. Versions: ICD to today

The version history in brief:

  • SpartaDOS X was written by Mike Gustafson for ICD. Its numbering started at 4.0, and ICD releases ran from 4.17 (9-12-88) to 4.21 (7-10-89).
  • Fine Tooned Engineering (FTe) bought the rights from ICD in 1993 and issued 4.22 (11-05-95).
  • The DLT team ("SpartaDOS X Upgrade Project") restarted development with 4.39RC in 2006. The current release is SpartaDOS X 4.50 with Toolkit (23 Dec. 2024).
  • Modern builds exist for intSDX128, IDE Plus 2.0, Incognito, Maxflash, MyIDE II, SIC!, SIDE/SIDE2/SIDE3, the Ultimate1MB and others, plus the emulators. From 4.40 on, SDX needs at least a 128K ROM cartridge.

SDX shares no code with the older disk-based SpartaDOS 1.x–3.x, but it reads and writes their disks. The commands below come from ICD's reference manual and still work in current releases. Newer versions add features (FAT read support, PCLink, larger partitions) covered in the DLT documentation.

2. First boot

Insert the SDX cartridge (the left slot on an 800) and switch on. Status messages depend on your machine. A stock 64K XL says RAMDISK not installed! / No extended RAM available!. A 130XE says 4 banks reserved for XE programs. Without an R-Time 8 clock cartridge you'll also see R-Time 8 not present. Then come the version banner and the prompt:

D1:

The prompt shows the current drive. To change it, type a drive identifier and press RETURN, e.g. C: makes drive 3 current. SDX accepts letters as well as numbers: A: is the same as D1:.

3. Your first session (the ICD tutorial, condensed)

Format a disk. Type FORMAT. In the ICD Disk Formatter menu press 1 (drive 1), V to set a volume name such as TESTDISK, then F and RETURN to format. Press ESC to go back to the prompt. Every SpartaDOS disk has a volume name, which helps SDX notice when you've swapped disks.

List it:

D1:DIR

The listing shows each file's size in bytes, not sectors, plus its date and time. DIRS gives a short listing.

Make test files from BASIC. On an XL/XE type BASIC. On an 800 or 1200XL, plug the BASIC cartridge into the top of the SDX cartridge and type CAR. Then enter:

10 OPEN #1,8,0,"D1:TEST.DAT"
20 FOR X=0 TO 255
30 PUT #1,X
40 NEXT X
50 CLOSE #1
SAVE "D1:TEST.BAS"
RUN
DOS

If DOS reports Disk Error while saving memory!, just press RETURN. SDX tried to save your program to a RAMdisk that doesn't exist.

Set the clock (no R-Time 8): type DATE and enter mm-dd-yy, then TIME and enter hh:mm:ss in 24-hour form. CHTD TEST.BAS restamps a file. TD ON and TD OFF toggle a time/date line at the top of the screen.

Copy, rename, erase:

D1:COPY TEST.BAS MAKEDAT.BAS
D1:RENAME MAKEDAT.BAS MAKE.BAS
D1:ERASE TEST.BAS

Short aliases exist: REN, DEL or DELETE. To copy between disks with only one drive, use the MENU program.

4. Wildcards

? matches any single character. * matches anything or nothing for the rest of the name or extension.

D1:DIR *.DAT        all .DAT files
D1:DIR A*.D*        names starting A, extensions starting D
D1:DIR AB?DE.DAT    ABCDE.DAT, ABZDE.DAT ...

Be careful with wildcards in ERASE and RENAME: one careless pattern can hit far more files than you meant.

5. Directories

D1:MKDIR TESTS              (alias MD, CREDIR)
D1:DIR TESTS>               list it: '>' marks a directory name
D1:COPY *.DAT TESTS>*.*
D1:ERASE *.DAT              the files now live only in TESTS
D1:CHDIR TESTS              (alias CD, CWD) make it current
D1:CHDIR                    show the path, e.g. >TESTS>ANOTHER
D1:RMDIR TESTS              (alias RD, DELDIR) remove an empty directory

The root directory is called MAIN. Paths may use > or \, and each drive remembers its own current directory: CHDIR B:BASIC sets drive 2's. A directory can hold up to 1,423 entries, but it's best to stay under about 200 because big directories slow things down. Older SpartaDOS 2.x/3.x versions can't see entries past the 126th.

6. Running programs, BASIC and cartridges

  • Binary programs: type the name. .COM is assumed, so BALLSONG.OBJ must be typed in full, and a file with no extension needs a trailing period: DEMO.
  • BASIC enters built-in BASIC on XL/XE machines. CAR starts a cartridge plugged into the top of SDX (Action!, MAC/65, BASIC XL/XE…).
  • X progname runs a program with all cartridges switched off. Most large binary games and utilities need this, because they use the RAM the cartridge would occupy. You never have to hold OPTION or pull cartridges under SDX.
  • From BASIC, return to SDX with DOS.

Through CIO, BASIC programs can use the same paths: LOAD "D2:TEST.BAS", OPEN #1,6,0,"DCAR:*.*" (directory of CAR:, the read-only "ROM disk" inside the SDX cartridge), LIST "DPRN:".

7. Batch files and AUTOEXEC.BAT

A batch file is a text file of commands, one per line. Run it with a hyphen: -TEST runs TEST.BAT, and -DO_IT.TXT works when the extension isn't .BAT. SDX runs AUTOEXEC.BAT from D1: at boot. To build one from the keyboard, copy from the console device:

D1:COPY CON: D1:AUTOEXEC.BAT
TD ON
TIME
DATE

End the input with CONTROL+3. Any editor that saves plain text works too. Batch files, I/O redirection and search paths (PATH) are covered in chapter 5 of the SDX manual.

8. Coming from DOS 2

ICD's own table of DOS 2 menu equivalents:

DOS 2 menu SpartaDOS X
A Disk Directory DIR, DIRS
B Run Cartridge BASIC (internal) or CAR (external)
C Copy File COPY
D Delete File ERASE, DELETE, DEL
E Rename File RENAME, REN
F / G Lock / Unlock ATR +P / ATR -P
H Write DOS not needed
I Format FORMAT
J Duplicate Disk COPY, MENU
K Binary Save SAVE
L Binary Load program name, or LOAD
M Run at Address no equivalent
N Create MEM.SAV SET CAR and SET BASIC
O Duplicate File MENU

SDX reads and writes Atari DOS 2-format disks through its ATARIDOS driver. These always show the volume name AtariDOS. They're slower, because there's no unique volume name to cache against and binary loads with many segments can take much longer, so copy programs to a SpartaDOS-format disk or RAMdisk before running them.

9. CONFIG.SYS: tailoring the system

At boot SDX reads a CONFIG.SYS text file from the MAIN directory of a SpartaDOS-format disk in drive 1, or uses its built-in default. Three commands are available:

  • USE OSRAM | BANKED | NONE: where SDX keeps its buffers. OSRAM is the RAM under the OS ROM, $E400–$FFBF, the default on a stock XL/XE. BANKED is the 16K window at $4000–$7FFF on expanded machines. NONE is low memory, the 800 default.
  • SET var=string: environment variables such as CAR, BASIC, BATCH.
  • DEVICE driver: loads drivers in order. The ICD-era default was DEVICE SPARTA OSRAM, DEVICE SIO, DEVICE ATARIDOS, DEVICE INDUS, DEVICE CLOCK, DEVICE JIFFY, DEVICE RAMDISK. SPARTA must come before ATARIDOS.

On a stock 130XE you might USE BANKED to save main memory, unless you need the extra 64K for programs like BASIC XE in EXTEND mode.

Troubleshooting

  • A big game crashes or won't load: start it with X GAME.COM so cartridges are off, and run it from a SpartaDOS disk or RAMdisk rather than an AtariDOS disk.
  • An old SpartaDOS 3.x can't find some files: they're past entry 126 of a big SDX directory. Split the directory.
  • Game cartridge plugged into SDX: most game carts take over at boot, so SDX won't initialize. That's normal.
  • Program without an extension "not found": add a trailing period (DEMO.).
  • Protected or DOS-specific software: some programs won't work under any DOS but their own. Boot them directly.

Further reading

  • ICD, SpartaDOS X Reference Manual: full command reference (chapter 4), batch files (chapter 5), programming from BASIC and assembly (chapter 6), disk format (chapter 7).
  • The DLT SpartaDOS X project pages (sdx.atari8.info) for current releases and the updated user guide.
  • Related guides on this site: Choosing a DOS, BW-DOS guide (a free SpartaDOS-compatible disk DOS), DOS 2.5 guide.

Credits