All The Good Ones Were Taken

Z1a - The GPIO and IDE Card

Next up, this computer would need its own keyboard and some kind of non-volatile storage device. And that would require some kind of General-Purpose Input/Output card.

So I set about designing one. Four input ports, four output ports. Latches to hold the output values in place, buffers on the inputs to switch them into the data bus for reading. Some space for pull-up/pull-down resistors on the inputs, and some jumper pins to configure port addresses, because who doesn't miss those halcyon days of configuring PC motherboards by moving jumpers around?

Meanwhile, I'd been thinking about what to use for storage.

SD card readers are now a common add-on for old home computers, and turn out to be pretty simple to interface with, although they run on 3.3v rather than 5v so I'd have to do some level conversion. And they're not really 1980s technology.

I also looked at Compact Flash cards, which interface-wise turn out to be pretty much the same as IDE hard drives. And the IDE port was technically 1980s technology. And as I learned here, it's so easy to make a suitable interface that I could add one to the GPIO card without any extra chips. However, it does only make half the drive's capacity available, as it only uses 8 bits of the 16-bit IDE data bus.

After a purge a few years ago, I didn't have any physical IDE hard drives left, but I did have a bunch of CF cards still hanging around from the days when digital cameras used them. One cheap CF-IDE adapter later, and I have my storage device.

Square green PCB with components, and a Compact Flash card connected via an IDE adapter

The Filesystem

Rather than use any standard filesystem, I came up with a quick, simple, space-wasting one of my own.

The storage device is divided into 64-kilobyte chunks.

The first chunk holds directory information. Of this, the first 256 bytes hold disk info, like name and formatted capacity, and the rest is divided into 32-byte file descriptors. Each subsequent chunk can hold one file, so the maximum file size is 64k. There are no subdirectories.

File descriptors look like this:

0 Flags
1-2 File length
3-5 Start address
6-7 BASIC autorun line number (not yet implemented)
8-15 Reserved for future use
16-31 Filename, terminated with 0x0D

Meanwhile, now that the Z1a had some I/O ports, I could get on with plugging in a keyboard...