5

Learn Something Old Every Day, Part V: Early IBM PS/2 Hard Disks

 2 years ago
source link: http://www.os2museum.com/wp/learn-something-old-every-day-part-v-early-ibm-ps-2-hard-disks/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Learn Something Old Every Day, Part V: Early IBM PS/2 Hard Disks

So I have been (again) trying to properly archive old MS OS/2 SDKs. The version 1.02 SDK from December 1987 (corresponding to OS/2 1.0) turned out to be a bit of a poser.

The SDK came on both 3.5″ and 5.25″ media (unlike the older 1.00 and 1.01 SDKs, which as far as I can tell only existed on 5.25″ media). My Kryoflux tells me that the Install floppies were modified in both the 3.5″ and 5.25″ disk sets. Now, it’s very common for OS/2 install disks to be modified, because the installer writes an INSTALL.LOG file. But I could find no evidence of that happening.

Instead, it looked like Microsoft made some changes after mastering the disks, but exactly what those changes were is difficult to tell.

On the 5.25″ Install disk, Microsoft almost certainly updated the INSTAID.EXE file (the main installer executable). The allocation chain for INSTAID.EXE is not contiguous, which is a strong hint that it had been overwritten with a larger file. Yet the timestamp for INSTAID.EXE is the same as the other files (12/15/1987) and the entry for INSTAID.EXE is in the middle of the root directory, alphabetically sorted.

Okay, so that makes some sense. Microsoft made some last-minute installer change and had to update the already mastered disks. One might expect to find the same sort of change on both 3.5″ and 5.25″ media… but no.

The 3.5″ Install disk was also changed, but differently. There appears to have been a similar change made to INSTAID.EXE; it is similarly fragmented, and identical to the 5.25″ variant. But there are additional changes, apparently to the disk drivers. And that’s where things get a bit mysterious.

The 5.25″ Install disk comes with a DISK01.SYS driver. The 3.5″ Install disk has DISK01.506, DISK01.ESD, and DISK01.SYS on it. The DISK01.SYS on the 3.5″ media is identical to DISK01.506, but the DISK01.SYS on the 5.25″ media does not match either DISK01.506 or DISK01.ESD. In addition (perhaps not surprisingly), neither DISK01.506 nor DISK01.ESD works on an AT compatible.

Upon reflection, it’s clear that Microsoft intended the 5.25″ media to be used on AT compatibles (whether with a 286 or 386 CPU) and the 3.5″ media on IBM PS/2 machines. This was a significant difference from how IBM packaged OS/2, because IBM’s OS/2 1.0 on 3.5″ and 5.25″ media each supported both AT compatibles and PS/2 machines (DISK01.SYS vs. DISK02.SYS etc.).

The only hint I could find about the mysterious disk drivers was in a file called READ.ME! on the Toolkit disk:

I have a PS/2 machine and when booting from the Installation Diskette the machine just freezes. What's the deal?

If you have a PS/2 machine with an ESDI hard disk (i.e. 71MB or larger) the default disk driver must be changed. You simply copy the Disk01.ESD to Disk01.SYS and then re-boot the machine. The bottom line is that if you have a low level formatted hard disk and try the instaid program with the wrong disk device driver your machine will freeze.

Early PS/2 Disk Controllers

The early (1987) PS/2 machines had either MFM hard disks with a ST-506 interface, or larger ESDI disks. More about the controllers can be found here.

Now… the problem with all these interfaces is that ST-506 and ESDI are drive interfaces that host software can’t do anything with. Host software needs to call to a disk controller, but there simply isn’t any predictable mapping between drive interfaces and disk controllers. Software developers had a bad tendency to name disk drivers by the drive interface (IBM1S506.ADD, ESDI506.PDR), even though the drive interface is not too relevant when talking to a disk controller, which is what all those drivers do.

The IBM PC/XT, PC/AT, and some early PS/2 models all used disks with the ST-506 interface, but each had its own disk controller, incompatible with the others.

Western Digital’s WD1005/WD1007 ESDI controllers on the other hand were software compatible with the PC/AT disk controller, but the ESDI controller in PS/2 machines was again completely different.

The PS/2 ESDI controller used an unfamiliar I/O port range, namely 3510h-3517h. The ESDI controller information can be found for example here. I believe IBM kept using the ESDI controller interface for some time, especially in lower end MCA PS/2 machines, while high-end systems switched to SCSI.

The PS/2 ST-506 controller used the same 320h-324h I/O port range as the PC/XT disk controller. That is quite likely because it was also used on the original PS/2 Model 25 and 30, in many ways enhanced PC/XTs.

There is very little technical information available about the PS/2 ST-506 controller (the IBM documentation for the adapters does not appear to have survived, or at least isn’t publicly available). I believe that the information in the PS/1 Technical Reference (starting at page 339 in the PDF) applies.

As far as I can tell, the PS/2 ST-506 aka MFM controller was conceptually very similar to the PC/XT disk controller, but different enough in detail to be incompatible. The I/O port range was about the same, both used command blocks with CHS addressing, both used DMA to transfer data to/from disk. But the status bits were different, the command blocks were different, and I just don’t see how the two could possibly be compatible.

In other words, it looks like the programming model of the PC/XT disk controller and the PS/2 ST-506 controller is essentially the same, but the details are different enough that existing code could not work. At the same time, it looks like adapting code written for one controller to the other should not be particularly difficult.

Finding authoritative information is surprisingly tricky. There is a Minix driver for the PS/2 ST-506 adapters, ps_wini.c, which reportedly works on MCA PS/2 machines. Those are the machines that the MS OS/2 1.02 SDK would have targeted; the PS/2 Model 30 was not relevant since it had an 8086 CPU, and the PS/2 Model 30-286 wasn’t announced until September 1988. The Minix ps_wini.c matches the above mentioned PS/1 Technical Reference.

Note that there is also a Minix xt_wini.c, which is indeed similar to ps_wini.c but far from identical.

Back to the OS/2 1.02 SDK

After researching the disk modifications, I am reasonably certain that the Install disks were modified by Microsoft and INSTAID.EXE was updated before the disks were shipped.

I considered the possibility that a previous user overwrote DISK01.SYS on the 3.5″ Install disk. On reflection, that is highly unlikely given that DISK01.SYS matches DISK01.506, and the included READ.ME! implies that that was the state in which the disks were shipped. It’s more likely that the disk drivers were updated by Microsoft before shipping; the 5.25″ media wouldn’t have any corresponding change because its DISK01.SYS is different (confusing!).

Comparing with another MS OS/2 1.02 SDK disk set would help. But finding such a set could be tricky.

Update: More Digging

I’ve partially disassembled the earliest available system BIOS for PS/2 ISA-based Model 30 (September 1986) and MCA-based Model 50/60 (February 1987). I can confirm that in both cases, the system BIOS includes support for the PS/2 XT-like disk interface (it is tempting to call it XT/2 interface, though I don’t think anyone used that term), and that the code from 1986-1987 corresponds to the documentation in the PS/1 Technical Reference which is quite a bit newer (1990).

The disk interface itself seems sensible enough, but it suffers from the same problem PC/AT BIOSes did: The system only handles drive types hardcoded in the system BIOS ROM.

Interestingly, even though the interface was the same from software point of view, the implementation on Model 30 vs. Model 50/60 was very different. PS/2 Model 30 used an IDE (but not ATA!) drive with a built in controller, while the MCA models used a separate controller adapter that worked with standard ST-506 drives.

As far as I can tell, the Model 30 was self-configuring because the drive “knew” which drive type it was. On the MCA-based PS/2 machines, the user had to select the right drive type in the system setup because the system had no way to detect the drive type automatically.

I should also add that the PS/2 ST-506 drive interface is not XTA. The XTA interface emulates a standard PC/XT disk controller, but the PS/2 interface is different.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK