As previously mentioned, IBM’s OS/2 1.0 and 1.1 is extra unfriendly to modern hypervisors. To recap, there is a curious difference between IBM’s and Microsoft’s kernels in OS/2 1.0/1.1 with regard to mode switching.
For reasons that aren’t very clear, IBM’s kernels implement only 286 style mode switching: In order to get from protected back to real mode, the processor is reset and the BIOS told where to resume execution. On the other hand, Microsoft’s kernels have had (faster) 386-specific code ever since the first OS/2 SDK beta from April 1987.
To make matters more interesting, the OS/2 kernel is also famous for using the undocumented LOADALL instruction when running on a 286. Yet IBM’s OS/2 did run on 386 AT clones of the era. How is that possible?
The crucial ingredient is the BIOS. The 386 BIOS must support the 286-style mode switching, which is standard functionality. The same logic used for 286s also works in a 386 BIOS—all the BIOS needs to do is check a special flag and divert execution very early during initialization.
The less obvious component is LOADALL emulation. BIOS developers soon realized that a 386 can relatively easily emulate a subset of LOADALL functionality used by OS/2 and other software. In those cases, LOADALL is only used to adjust segment bases which can be accomplished by switching the 386 to protected mode, loading segment characteristics as directed, and then switching back to real mode. It took Intel several years to even acknowledge the existence of this technique, and it could hardly be called well documented, but it works on every 386-compatible processor.
IBM OS/2 1.0 in VirtualBox 4.3
VirtualBox 4.3 can finally run the historic IBM releases of OS/2 1.0 and 1.1. The following was tested on VirtualBox 4.3.8 running on a Mac.
It’s best to create a new VM from scratch. The guest OS type should be “Other OS/2”. RAM size should be set to 8MB (OS/2 1.0 blows up with more memory than that). For OS/2 1.0, disk size may be set to just 30MB as this version does not support partitions larger than 32MB (OS/2 1.1 no longer suffered from this limitation). The virtual disk should certainly be no larger than 500MB to avoid problems with BIOS/IDE geometry mismatch.
Before attempting to boot IBM OS/2 1.0 or 1.1, the VM behavior needs to be tweaked:
VBoxManage modifyvm <vm> --triplefaultreset on
Without this setting, the VM will terminate when OS/2 causes the CPU to triple fault. In the typical case, a triple fault is a fatal error indicating that the guest OS is beyond help, but with IBM OS/2 1.0/1.1, “crashing” the CPU is part of normal operation.
The OS/2 installation floppies of course also need to be patched, otherwise OS/2 will crash with division by zero. If everything worked, a screen like this should appear:
When initializing the fixed disk, an error may show up when performing a format:
If this occurs, use a bootable DOS floppy and format the partition which should already have been created; when the OS/2 installer is restarted again, use the existing volume rather than reformatting it again. It’s not clear whether this is a bug in the OS/2 installer or in VirtualBox.
The rest of the installation should be a matter of feeding the diskettes to the installer as directed, and accepting the largely sensible defaults. If everything went well, the VM will show the Program Selector a few seconds after the final reboot:
And just to show that yes, this is really IBM OS/2 1.0:
Note: On hosts without VT-x or AMD-V support, VirtualBox will complain that OS/2 guests require hardware virtualization. However, that does not apply to OS/2 1.x (but it is true of OS/2 2.x). The complaints can be circumvented by setting the guest OS type to ‘Unknown’ or ‘DOS’.
It would be interesting to know which other modern hypervisors (i.e. something able to run modern 32-bit and 64-bit OSes, rather than a 286 emulator), if any, are capable of running IBM OS/2 1.0/1.1. VirtualPC 2007, which is otherwise a very faithful representation of a real PC, is known not to run the old IBM OS/2 releases.