📜 ⬆️ ⬇️

MS-DOS, which we have never seen

Sometimes there are such artifacts of nature that you begin to unwittingly think about different conspiracy theories and alternative history. Today I would like to talk about various little-known and not so aspects of the MS-DOS operating system. There were a lot of stories about dos on Habré: brief essays, detailed chronology, nostalgic memoirs, but no one has ever mentioned MS-DOS 4.0 from 1985. I consider this a very important link in the development of operating systems for the IBM PC, but surprisingly little information about such an important transitional stage. This is literally a lost branch of the dos and it is a big problem to find information about it. What would you think if you heard about DOS support for preemptive multitasking, virtual memory, swap, semaphores and IPC. Fantasy?

Actually, the story began one idle day, when I decided to read the Internet instead of work in a fit of procrastination. I once had a Sharp PC 6200 laptop, based on a new-fashioned 80286 processor and equipped with two drives, one HDD for 10 megabytes, and a second ROM for 4 megabytes. On the ROM drive were utilities from the manufacturer and installer DOS. According to the developers, if a person purchased a new hard drive, then he could break it up, format it, and install dos directly with built-in tools. Probably, this decision was dictated by the lack of a drive in a laptop, but for me it was very original and fresh. I confidently remembered that there was DOS 4.0 and I wanted to learn more about it, especially since fame was going about it as an unsuccessful system, but I did not know the specifics.

Literally from the first request I received a lot of contradictions in the issue. Literally everything went from the list of problems to the release date. Separately, it should be noted that in those wild times, it is not necessary to talk about the release of dos. Up to the fifth version, MS DOS was not sold freely, Microsoft worked exclusively for equipment manufacturers and the corporate segment, so the versions of those times are known either by purchased equipment samples with a pre-installed system, or by leaked versions from enterprises. In addition, the dos of those times was practically naked, only a few very important system utilities, and from very much applied software, only the DEBUG assembler / disassembler / debugger, EDLIN and BASIC linear text editor in some versions can be noted. Having received a naked system, there was practically nothing to do in it, but this is more the spirit of those days. But the computer was usually bought with a well-defined goal and rather the OS was chosen for software, and not vice versa. Particularly interesting on this background is the CP / M 86, which at the time included a visual text editor, an assembler compiler, and BASIC. However, back to our DOS. On some sites I found evidence that DOS 4.0 was a fundamentally new operating system and there were huge changes to its core, to the minimum: a new FAT16 file system that allowed the use of a hard drive of more than 32 megabytes, for which the VFS appeared to work successfully simultaneously with two different file systems, up to multitasking, semaphores and shared memory. According to eyewitnesses in version 4.01, the system was brushed, multitasking was blocked and a working system was released.

Here, to put it mildly, I was very surprised. I clearly remember that there was no multitasking and shared memory on the laptop and the version was strictly equal to 4.00. But I felt that the topic is clearly interesting and little studied. Then the truth gradually began to emerge. It turns out that there are two versions 4.00, one of them, known to all, was released in 1988 and is based on 3.30, the other was released in late 1985, based on 2.1 with parts from 3.1 and has all these magical properties. To distinguish them, the 1985 version is popularly called 4.00M.
')
At this moment, I was completely no longer interested in the usual fourth version of the bugs, and I began to hunt for images of the multitasking version. I collected about ten different versions of MS DOS 4.0 for different vendors, among which was even Nokia (that's where their collaboration grows), along the way finding the source code of MS DOS 3.3, but that 4.00M was not there. And the images were found, and not just, but right in the on-line x86 emulator.



The system consisted of two floppy disks, where there was, in fact, the kernel of the operating system and a very minimal set of utilities. No documents were contained. No help. Moreover, even the key /? not present in all teams! But the main functionality is visible and so. On the right alto, a task list appeared in which you could create a new process or switch between the existing ones. Which, in general, was not particularly impressive. I was not even sure that this is an authentic version from Microsoft, and not a hoax on the rumors on the network. Actually, this is what we will prove. Moreover, the fact that multitasking is implemented by some SM.EXE over the top speaks in favor of this version. Here is the content of CONFIG.SYS:

BUFFERS=20 FILES=40 SHELL=c:\dos\sm.exe c:\command.com 


Further research revealed several oddities. Firstly, these are .PIF files that were on floppy disks, which made this DOS with Windows. On the second diskette, PIFEDIT.EXE and the first long-awaited document were found: swapper.doc.

swapper.doc
 ;  Swapper.doc
 ;
 ;  SCCSID = @ (#) swapper.doc 6.1 85/10/09

 Using the dos 4.00 partition swapper.

 1. You must add the swapper, swapper.exe, to the autoexec.bat file.  Add
    the following lines:

     memset default = 5
     detach swapper
     memset default = 127

    This allows you to run in a minimum amount of space.

    Note the swapper MUST run in backround.

 2. The above configuration will cause the default to
    root directory of c: drive for locating its swap files.  You may
    tell the swapper where to place the swap files by specifying
    the drive and also the directory.  You must always specify the
    drive directory of the drive
    drive.  Example:

     detach swapper d:
    or
     detach swapper c: \ tmp

 3. The swapper will manage the cleanup of its swap files.  If the
    swap directory is changed after a system crash, there is the
    chance that swap files will be left around.  These can be removed
    by executing the following on the "old" swap directory:

     del * .swp

 Currently ANY task can be swapped, so use with caution until this is
 resolved.  Remove "detach
 swapper "from the autoexec.bat file.



This is already starting to be really interesting. Firstly, the date is visible: October 9, 1985, secondly, the scope of activity is visible. We should also note that this is only October 1985, and the first version of Windows was released only in November. That is, PIF technology has not yet gone beyond the walls of Microsoft. MEMSET memory management utility, true background processes, not TSR trimmed, intercepting interrupt vectors. Virtual memory and the ability to upload segments to disk. I immediately tried to start something with the detach command and got the answer in the form of the PID of the running process. It is interesting that if you try to launch an interactive command in the background, its output overlaps with the current console, and it immediately receives the symbol of the end of the file ^ Z and closes. If you run FDISK, then the terminal settings deteriorate. They are not restored even if you terminate the session of this terminal and reopen it. That is, the terminals are statically allocated. Interestingly, CLS does not work as expected, but simply outputs the ESC sequence. That is, the terminals are heavily out of direct memory access and must be managed via ANSI. ANSI driver was, but I did not load it. Here I have already strongly begun to doubt the mystification on such a scale. So leave the emulator and go directly to the showdown.

After downloading the images, I extracted all the contents into a separate directory. I checked the images on deleted files but everything turned out to be clean. The ghostly hope of finding something else has disappeared. So let's get started. To begin with, we note that the file structure has seriously changed. For example popup.exe: MS-DOS executable, NE (unknown OS) (driver) or queuer.exe: MS-DOS executable, NE for MS-DOS, and even attrib.exe: MS-DOS executable, NE for MS Windows 3 .x. Although the file runs fine. So this is most likely the file utility glitch, or just the file format is not yet fully standardized.
The files contain a header that is more similar to PE than it is used to work with in dos. You can see the original file name and the list of imported exported characters called here DOSCALLS, that is, apparently there was an attempt to implement something like shared libraries or IPC.
The version is defined in this way.
 MS-DOS version 4.00
 Copyright 1981,82,83,84,85 Microsoft Corp.

 $ nternal revision 6.7, 85/11/26

It is interesting to note that the $ symbol means the end of the line in the DoS, that is, the message about the internal revision was roughly cut from the output, but remained in the file. Below is a list of interesting anachronisms and amazing things.



Now let's check this miracle for compatibility with programs from MS DOS. For this, we have vc.com, rkega.com, sdrv.com, zork and captain comic. Here we get the first disappointment. Neither wolves, nor Russian driver, nor speech synthesizer can be installed. Zork plays great, tasks switch. it is possible to play CC, but after switching the schedule it breaks down. qbasic starts, but if it switches from it, and then into it, the system hangs. In general, there is compatibility only with programs that behave very quietly, use the standard API and never, never climb into DOS structures directly. TSR is missing as a class. Apparently direct access to the video memory is also not welcome. Actually, it is precisely because of this point that the project did not receive a future.

Of course, you can still get the disassembler and continue with a deeper analysis, but I think that for the time being with the technical side you can finish. But the political and historical side is also interesting. As a result, we find a collection of different information about dos from PC DOS Lead-developer from IBM, among which is a page about 4.0M :

MOSCOW: DOS 4.0 is supported by MS-DOS 4.0. It was released in 1988. DOS 4.0 supported preemptive multitasking , shared memory, semaphores, advanced memory management, session manager, imports, exports and a new executable format. There are a lot of ideas for OS / 2. Unfortunately DOS 4.0 was limited by the real-mode 8086 environment and the 640KB address space. Programs that were not well-behaved or relied upon undocumented DOS functions, especially TSR programs.


And a link to the developer’s blog of this version Larry Osterman, where we can find absolutely amazing things:

MS-DOS 4.0: MS-DOS 4.0; But it didn’t have a PC / AT. So that it eventually turned into OS / 2. I worked up the MS-DOS 4.0 for the OEM partners who had licensed MS-DOS 4.0.


It turns out that this version is not in vain, it is not only the ancestor of OS / 2, but literally its larva, many technologies that were used here are shared with Windows of the time and went straight to OS / 2. However, on all historical sites, the history of OS / 2 begins in 1987 and the release of the OS / 2 SDK, and this is a transition link that has been forgotten by everyone and is not even mentioned.

PS:
 $ file append.exe
 append.exe: MS-DOS executable, NE for OS / 2 1.x

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


All Articles