📜 ⬆️ ⬇️

Launch IBM OS / 2 1.0 in a virtual machine: why it is difficult to do

Why is OS / 2 difficult to run in a virtual environment?


Due to certain reasons, OS / 2 is very difficult to get to work in a virtual machine; much more complicated than DOS, Windows 3.x, Windows NT, Windows 95, or many UNIX-like operating systems. Problems lie in the architecture of the Axis and its history.

First, the talk will be about the implementation features of the kernel and the drivers of the old ( very old) OS / 2 versions, then a little about the virtual machines, and then the author, after performing a number of manipulations, will launch IBM OS / 2 1.0 in the VirtualBox 4.3.8 virtual machine on his Mac - KDPV. - approx. per.

IBM Operating System/2 Installation. Version 1.00
')

Well, firstly, the old OS / 2 versions (meaning Warp 3 and below) are difficult to launch even on an iron Pentium III and similar, it would seem, ancient machines. The code of the operating system contains many different cycles used to set time delays, which fail on fast processors, causing overflow errors in the division and all others. Almost all 1.x versions are subject to this. Support for large IDE disks is also a problem, but OS / 2 should not be blamed for this ; at that time, the IDE standard was booming, and we are talking about those times when there are no more disks, well, 300 megabytes did not exist at all, and in this respect virtualization even helps - it is much easier to move the slider in the virtual machine settings to the left and create a virtual drive on , let, 120 megabytes, than to run and search for a real, working hard disk of such small volumes.

Then, there are a number of problems that are specific to virtual environments. Let's start with the oldest versions of the Axis. IBM OS / 2 1.0 and 1.1 uses 286-style switching between protected and real CPU mode. This is a method that uses the BIOS code in order to resume the operation of the machine in a different mode at a certain stage, because a hardware reset of the processor is used to switch between modes; most virtual machines do not like this kind of execution, and is perceived as a fatal error. Interestingly, the OS / 2 1.x edition from Microsoft still detects the 386th processor, and if such was found, then another, much more efficient way of switching between modes is performed by changing the CR0 register.

Back in versions 1.x, a rather unusual driver was used that determines the type of drive, that is, its size, based on the data transfer rate of the controller. 3.5-inch disks with a volume of 720 kilobytes are read at a speed of 250 K / s, and a volume of 1.44 megabytes - at a speed of 500 K / s. But it is an iron flop. And virtual machines do not bother with emulating such fine details and allow the guest operating system, in our case, the Axis, unlike a real drive, to read a 1.44-megabyte floppy disk, even if the drive controller is programmed at 250 K / s. As a result, the driver thinks that a 720 kilobyte disk is inserted in the drive, which leads to funny errors and, in general, to the impossibility of booting from a floppy disk.

With the 2.x branch, things are a little different: the drive driver is no longer so tricky and works fine, switching between CPU modes uses code specific to the 386th processor ( in 2.x support 80286 was dropped ), but the situation is generally no better. OS / 2 2.x still has problems with timing, and on fast processors it can hang at any time, especially at an early stage of loading. And because of how the 16-bit real and 32-bit protected mode codes are mixed in the Half-Line, it is extremely important to correctly implement all aspects of the x86 architecture processors, and virtual machines have problems with this. Quite often there are floating, hardly elusive bugs, because of which OS / 2 ( meaning mainly versions before Warp 4 - approx. Lane ) cannot boot and work in a virtual machine without errors.

Another problem is the old (DOS-compatible) style of error handling FPU ( Floating Point Unit - math coprocessor for floating point operations - approx. Lane ). OS / 2 non-SMP versions ( aka UNI - systems that do not use symmetric multiprocessor - Symmetric MultiProcessor system; the term applies to both software and hardware - approx. Lane ) use the 8086-compatible method of generating the signal FERR# and converting it in IRQ 19, instead of using # MF-exceptions, as all modern operating systems do today. Such a mechanism should be correctly emulated for Axis to work in a virtual machine.

Only the latest versions of Axis (the so-called Convenience Packs - MCP1, MCP2 for client and ACP1, ACP2 - for server) are supported as a guest in some virtual machines (known in Virtual PC and VirtualBox). By then IBM ( MDM - MezhDelMash - International Business Machines;) - approx. per. ) have already dealt with problems with dependence on processor speed in some places, and hardware support has already reached a level suitable for working with today's virtual devices emulated by virtual machines.

The half-shaft works especially well if you turn on ( always turn on - approx. Lane ) hardware acceleration (VT-x and AMD-V) - MCP and ACP are installed and working without any problems, and also Virtual PC and VirtualBox to this time, guest OS add- ons were released, adding their hardware accelerated video drivers, support for mouse integration, shared folders, and similar things that greatly improve the usability of the Axis in the virtual machine.

Everything, as always, is a matter of money and effort spent on solving a problem. Almost anything can be solved if there is a real need for it.

Launch IBM OS / 2 1.0 in a virtual machine


As I said before, it’s not at all clear why the IBM revision core, even with an 80386-compatible CPU, uses the old, 286-style mode switching method, which causes a hardware reset of the CPU, and then execution continues from the BIOS that was previously told from where the execution should continue. Microsoft's OS / 2 release 1.0 contained a kernel that uses, when possible, a new (faster) 386-only mode switching code from the very first OS / 2 SDK beta - April 1987.

And in order to make it generally interesting, the OS / 2 core is also famous for using the undocumented LOADALL , if it is running on 80286. And still, the IBM version of OS / 2 1.0 was running on 386 AT-clones of that time! How is this possible?

The key word is BIOS. The BIOS of the machines on the 80386 processor must support 286-style mode switching, and this is standard functionality. And the mode switching code written for 286 also works on systems with 80386.

How the LOADALL works on the 80386 is less obvious. BIOS developers soon realized that on 386-compatible processors, it is relatively easy to emulate a LOADALL subset by switching to real-time mode. It took Intel several years to just at least guess the existence of such a technique in the BIOS, and therefore this behavior can hardly be called well documented, but it works on any system with an 80386-compatible processor.

IBM OS / 2 1.0 in VirtualBox 4.3


VirtualBox version 4.3 has finally learned how to run the ancient IBM versions of OS / 2 1.0 and 1.1. Next is VirtualBox 4.3.8, Mac OS X is the host.

Create a new machine, the type of guest OSes should be set to “Other OS / 2”. RAM, put eight megabytes (OS / 2 1.0 blows the roof from the big sizes). Put a virtual drive with a size of 30 megabytes - this OS / 2 version still does not know how to partition more than 32 megabytes (but OS / 2 1.1 has already been taught). It can be more, but definitely you should not put more than 500 megabytes - there will be problems with mismatch of geometries.

But that's not all. To make switching between the CPU modes, which, as I have already mentioned more than once, is done by resetting the processor, you must tweak the settings of the virtual machine so that VirtualBox does not complete its operation with an error during a three-fold CPU folio. Usually, a three-fold CPU error means that the guest OS is no longer able to resolve the problem and continue working, but for IBM OS / 2 1.0 / 1.1, this is part of normal operation. To change virtual machine settings, go to the VirtualBox directory and use the VBoxManage utility:

  VBoxManage modifyvm <virtual_machine_name> --triplefaultreset on 

And still need to patch the installation floppy.
Otherwise, the axis will crash with the division by zero error. Script patcher on Python .

Is done. Try it. If everything went well, the installer title screen will flash up in front of you:
IBM Operating System/2 Installation. Version 1.00

However, there is a possibility that you will have a problem with formatting a partition in FAT, although the breakdown should go smoothly.
FORMAT unsuccessful

If you are unlucky, just take any diskette with DOS, load it in a virtual machine, and format the already created partition in FAT16. Then reboot into the installer, and choose to use the existing volume, do not format it again. Obviously, this is a bug in the OS / 2 installer or in VirtualBox.

Then everything should go smoothly, and you will only be required to change the virtual diskettes in the virtual drive as they are installed, and agree with the default settings, which are quite reasonable. After the OS / 2 installation process is complete, TSHELL - Text Shell is launched - a text shell of a protected mode that performs the function of launching programs and sessions, and switches between OS / 2 and DOS multitasking sessions.
TSHELL Program Selector

And yes, it really is IBM OS / 2 1.0 :
IBM Operating System/2 Command Interpreter Version 1.00

Please note that if you have a host that does not support hardware acceleration of virtualization (VT-x or AMD-V technology), VirtualBox will swear that such is necessary to run OS / 2 and will refuse to start the virtual machine. Hardware virtualization is desirable, but OS / 2 1.0 will work without it (but for 2.0, Warp 3 and 4 it is mandatory). You can bypass errors by setting the type of guest operating system to either DOS or Unknown.

It would be interesting to know which other modern virtual machines (normal, that is, which quietly run modern 32-bit and 64-bit operating systems, rather than specialized emulators 80286) are capable of running the earliest releases of IBM OS / 2 - 1.0 and 1.1. It is known that Microsoft Virtual PC 2007, although recommended for running more modern OS / 2 versions, since hardware is emulated very close to real, is not able to run IBM OS / 2 1.0 and 1.1.



From the translator:


Notes on spelling, punctuation and grammar, translation bugs and inaccuracies (I often “float” on topics that Michal Necasek speaks with ease; that's why, by the way, it’s interesting to read and translate his articles. If something is not obvious to me (and something was not obvious to me, especially when translating the previous article ), I always google and try to figure it out, ask questions) please report in a personal. You are welcome.

Did a survey about whether you want to see articles about Axis and related topics. The community has something to say, true. The bigger problem is that the corresponding hub is not provided, and there are still not enough posts to apply; Let's see what can be done with this - there are really quite good articles.

Those who answered “yes”, I also ask you to comment on the article and indicate what kind of article you want to see, that you are interested to find out.

PS This is a combined translation of two articles , and there’s so much in the “source” field that doesn’t climb, so I indicated there just the website address.

Source: https://habr.com/ru/post/223277/


All Articles