SmartIDE for the 1200XL (Bob Woolley)

Year
1996
Type
DIY project
Category
Internal parallel-bus IDE interface
Manufacturer
Homebrew design by Bob Woolley (published in Atari Classics, 1995–1996)
Cover of Atari Classics, Fall 1996 (Volume 5, Number 2), with two black-and-white photos of an opened 1200XL containing a ribbon cable and an internal hard drive, and the headlines 'What Secrets Dwell Beneath This Innocent Ribbon Cable?' and 'It's…

Overview

Bob Woolley's SmartIDE is the classic do-it-yourself hard disk for the Atari 1200XL. It was published as a series in Atari Classics magazine. The articles were "SmartOS" (Sept/Oct 1995), then "Dallas 'ROMs'", "Smart IDE", "The IDEal Hard Drive" and "IDE Driver Software" (all Fall 1996). The articles describe an internal board that puts an IDE drive on the 1200XL's processor bus as a true parallel bus (PBI) device, together with a RAM-based OS that the IDE code is assembled into.

Woolley's driver sources from April 1999 (PIDE05/06, IDE38F, MVRAM5, LOADPBI, SETD301) circulate together with his recovery instructions, an e-mail explaining the hotkeys, and later extensions by an enthusiast signing as MegaX.

How it works

Parallel bus device ROM. The handler is assembled at $D800, the window where the XL OS looks for parallel-device ROMs. It carries the standard header: a $80 ID byte at $D803, a JMP to the SIO handler at $D805, a JMP to the interrupt handler at $D808, the $91 signature byte at $D80B, and the init code at $D819. Writing 1 to the device-select register $D1FF maps the board in. LOADPBI copies the handler from $5800 into the $D800–$DFFF window, with $D140 used as a write-enable. Woolley's PBI code is RAM-loaded rather than burned into a ROM, which explains the "Dallas 'ROMs'" article title.

IDE registers. The eight task-file registers appear at $D190–$D197. The SIO hook checks the device ID byte in the DCB ($0300) for disk ($31), then looks up the requested unit (DUNIT, $0301) in a 16-entry partition table. Matching requests go to the hard disk; anything else falls back to normal SIO. It handles status (S, N), read (R, IDE command $20), write (W/P, IDE command $30) and format (!/"). The partition offset is added to the requested sector to get the IDE head/sector/cylinder values.

Partition table and hotkeys. The table sits at $D7C0 and has 16 four-byte entries. Each entry gives the starting drive sector (× 256), the length in 256-sector blocks, the density (SD, ED or DD) and which SIO unit (D1:–D9:) it answers as. Pressing CTRL-F1, a 1200XL function key, rotates the first seven entries through D1:, so one floppy-sized boot partition after another appears as drive 1. One more press deselects the hard disk and returns D1: to a real SIO drive. Holding SELECT at power-on bypasses the hard disk, because the handler tests CONSOL ($D01F) bit 1. Three LEDs show the selected partition.

OS in RAM. MVRAM5 copies an OS image into RAM, and the IDE code is patched into it. The 1200XL's rear-panel TV switch is repurposed to choose between a 400/800-compatible OS and the "RAMOS". That gives you a fall-back position when the RAM OS is damaged.

Re-loading the drivers

Woolley's recovery note ("Check HD") uses only an Atari Assembler Editor (EDASM) cartridge:

  1. Set the TV switch to 400/800 and boot into MemoPad to prove the base machine works. Then switch to RAMOS and press RESET. LEDs showing anything other than 000 mean the PBI device is alive.
  2. With a real drive as D1:, power on and press CTRL-F1 until the LEDs read 000, then boot a known-good DOS from floppy.
  3. To reinstall, power up with EDASM and run SETD301 from the debugger. It writes $FF to PORTB ($D301) and sets PACTL ($D303) so PORTB stays an output port. Then assemble and run LOADPBI (G600), MVRAM5 with OS4000.OBJ, and finally IDE38F with $D140 temporarily set to $40.

Later improvements (MegaX)

  • IDE38 update: the original IDE38.ASM lacked the SIO Get Configuration command, so standard formatters couldn't work. MegaX added it. To make room he moved the partition table into a 155-byte unused area of the XL/XE OS ROM just before the international character set, and noted that 1,179 bytes are free from $CB65 if you give up that character set. He also patched SpartaDOS's HDINIT.COM to handle drives beyond 7.
  • 16-bit IDE: two 74ALS573 latches capture the high data byte (accessed through $D100–$D13F, with the low byte via $D150), giving full 16-bit transfers. It was tested in read mode only.
  • PBI 16-bit IDE: a redesign as a single PBI device with battery-backed SRAM for the handler, banked RAM at $D600–$D7FF and $D800–$DFFF, and an LCD. The schematic was drawn in Eagle; no code had been written for it.
  • Later SmartIDE code also initialises an LCD at $D1C0, a second POKEY, a second PIA and a 6522 VIA.

Skill level and caveats

This is an advanced project. You need a 1200XL, comfort working on the processor bus, an assembler cartridge, and a willingness to rebuild drivers from source. The code assumes Atari's Rev. 2 XL OS layout. Get the Atari Classics articles (scans are on archive.org) before building, because the hardware design is described there rather than in the driver files.

Credits