I have a really great Altair 8800 with two diskette drives, but I couldn't help but think how great it would be to have a larger hard disk. I knew that the CP/M operating system would support fixed disks, but I just don't see many Altairs that have them. The Altairs I see with hard disks seem mostly to be a historical curiosity. Rarely do I see people still using them. Could be that it just wasn't popular, since CP/M doesn't support directories. Or it could just be the cost and the era.
Still, I wanted one. And it seemed to me that there should be an S-100 option that could be used. After all, the S-100 bus became popular in the late 1970s and stayed popular for over a decade, until being displaced by the ISA bus from the IBM PC. But even after that, there were some folks still making stuff for the S-100 bus.
A scan of the internet came up with a ready option: An IDE/CF board designed by John Monahan and sold as a raw board, schematic and bill-of-materials on s100computers.com. So cool!
I immediately ordered a couple, and started gathering all the components required to assemble them. Socketed everything and cleaned up after myself with flux remover. Not a difficult board to make.
Installed one in my Altair, downloaded the software for it and fired it up.
Hard crash. Dead solid, not even any blinky lights.
What I had overlooked was that John Monahan - undoubtedly a very competent designer - pretty much makes everything in his systems. He doesn't appear to make anything for Altairs or IMSAI machines. I think Monahan designs are independent of any other platform, so compatibility with other systems isn't on the menu.
I wrote to him and we chatted a couple times via email, but he is very busy so I was kind of on my own.
No problem, that's kinda fun too.
The first thing I learned is that Monahan's system is Z80-based. So that means all his code is close enough to compatible to make it through the assembler and linker, but not close enough to run on an 8080 machine. So my first task was to re-write his "myIDE" utility/test program to make it 8080-compatible. While I was there, I made a few enhancements. Mostly, the differences are for accessing the area of disk beyond what CP/M can access. But beyond that, my version of the program - which I call "IDEutil" is close enough to his that anyone familiar with one would be comfortable with the other.
Once I had that in hand, I rolled up my sleeves to create a version of CP/M that would run on my Altair and would access the IDE drives. With the same naïveté I had when I expected the board to run straight away, I set about adding my 8080-compatible IDE hardware-layer code into the CP/M version he had made for his systems. Of course, that dumped core right off the line.
The IDE section of the code wasn't the only place where Z80 instructions were used. Of course, why would it be any other way? If you have the extra register instructions, the relative jump instructions and the bulk move instructions, why not take advantage of them? But as for me, I'm running an 8080.
So I re-wrote all modules to be 8080-compatible. I put Altair SIO and 2SIO code in the chario module, Altair FDC code in the diskette module and my 8080-ported IDE code in the IDE module. Then I set about troubleshooting the system with the SID debugger 'til the fat lady sang.
I now have a version of CP/M 3.0 that runs on the Altair, supports SIO and 2SIO asynchronous interfaces, the Altair FDC and IDE disk drives, be they magnetic or compact flash. It boots from diskette and supports two 330Kb floppies on A and B, and two 8Mb IDE drives on C and D.
Additionally, the translation layer for the IDE drives breaks them into 8Mb segments, which can be easily addressed individually using the most-significant byte of the two-byte track address. The tracks are addressed as 0000-FFFF and sectors as 0000-003F. The first 8Mb segment is tracks 0000-00FF, and that is the segment that is accessed by CP/M. The second segment is tracks 0100-01FF, third segment is 0200-02FF, and so on, up to track FFFF for 2Gb total storage.
This additional storage can be accessed using the IDEutil program, included in the CP/M distribution archive, below:
If you're interested in the "gritty details," you can see my debugging trace outputs and notes I made along the way:
I'm pretty happy with this version of CP/M exactly as it stands. But there are a few things that might be useful at some point:
1. A version of BIOS that boots from an IDE drive.
2. BIOS that supports banked memory on the Altair. Of course, we'd need to choose or define and develop memory hardware first.
3. BIOS or tool that changes the CP/M accessible drive from "partition" 00 to any other.
To explain this third idea, you might remember I mentioned my "IDEutil" utility had some enhancements that are for accessing the area of disk beyond what CP/M can "see." What it does is to logically group tracks beyond the first 8Mb into "partitions," using the most significant byte of the track number as a partition identifier.
CP/M tracks are 00-FF and sectors are 00-3F for each of the IDE drives. But the drive is capable of tracks 0000-FFFF. So the first 8Mb is tracks 0000-00FF, the second is 0100-01FF, and so on. IDEutil can access any of these areas, but CP/M can only "see" the first one.
It might be nice to add a feature - tied in through the wrlba function in IDE3.asm - that allows the user to change "partitions" in CP/M, to allow any of 256 to be selected. That would expose an entire 2Gb drive to CP/M.
Resources: