Ms dos that we never saw

Sometimes there are such artifacts of nature that you begin to involuntarily think about different conspiracy theories and alternative stories. Today I would like to talk about various little-known and not very aspects of the MS-DOS operating system. There were a lot of stories about dos on the Habré: short essays, detailed chronology, memoirs of nostalgia, but no one ever noted about 1985 MS-DOS 4.0. I think this is a very important part of the development of operating systems for the IBM PC, but surprisingly little information about such an important transition stage. This is a literally lost dos branch and finding information about it is a big problem. 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 in a fit of procrastination I decided to read a little Internet instead of work. I once had a Sharp PC 6200 laptop based on the newfangled 80286 processor and equipped with two disks, one 10 megabyte HDD, and the second 4 megabyte ROM. On the ROM drive there were utilities from the manufacturer and the DOS installer. According to the developers, if a person purchased a new hard drive, then he could break it, format it and install dos directly using the built-in laptop means. Probably, this decision was dictated by the lack of a drive in the 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 there was fame 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 diverged, starting from the list of problems and ending with the release date. It should be noted separately that in those wild times it was not necessary to talk about the release of the dos. Until the fifth version, MS DOS was not sold on the free market; Microsoft worked exclusively for equipment manufacturers and the corporate segment, therefore versions of those times are known either for purchased equipment samples with a pre-installed system, or for leaked versions from enterprises. In addition, dos of those times was almost bare, only a few very important system utilities, and from very much applied software you can only note the assembler / disassembler / debugger DEBUG, the linear text editor EDLIN and BASIC in some versions. Having received a bare system, there was practically nothing to do in it, but it is more a trend of those days. But the computer was usually bought for a very specific purpose, and most likely the OS was chosen for software, and not vice versa. Of particular interest against this background is CP / M 86, which at that time included a visual text editor, assembler and basic compiler. However, back to our DOS. On some sites, I found evidence that DOS 4.0 was a fundamentally new operating system and huge changes were made in its kernel, at the very least: the new FAT16 file system, which allowed using a hard drive of more than 32 megabytes, for this VFS appeared in the kernel allowing 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 combed,

Then, 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 was clearly interesting and little studied. Then the truth gradually began to loom. It turns out there are two versions of 4.00, one of which is well known to everyone, released in 1988 and is based on 3.30, the other was released at the end of 1985, based on 2.1 with parts from 3.1 and has all these magical properties. For their distinction, the 1985 version is popularly called 4.00M.

At this point, I was completely no longer interested in the bugs of the usual fourth version, and I started hunting for images of the multitasking version. I collected about ten different versions of MS DOS 4.0 for different vendors, including even Nokia (that's where their cooperation feet grow from), along the way, finding the source code for MS DOS 3.3, but there wasn’t that 4.00M. And the images were discovered, 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 on all teams! But the main functionality is visible as well. On the right alt, a task list appeared in which you could create a new process or switch between existing ones. Which, in general, did not really impress me. I was not even sure that this is an authentic version from Microsoft, and not a hoax on rumors on the network. Actually we will prove it. Moreover, the fact that multitasking is implemented by some kind of blotch on top of SM.EXE speaks in favor of this version. Here is the contents 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 similar to Windows. PIFEDIT.EXE and the first long-awaited document: swapper.doc were found on the second diskette.

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 the swapper to run in a minimum amount of space.
   Note the swapper must run in backround.
2. The above configuration will cause the swapper to default to the
   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 and the swapper will default to the root directory of the
   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. If you don't want to have swapping, then 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. Separately, it is worth noting 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 Microsoft. A MEMSET memory management utility, real background processes, not truncated TSRs that intercept interrupt vectors. Virtual memory and the ability to upload segments to disk. I immediately tried to start something with the detach command and received a response in the form of the PID of the running process. Interestingly, if you try to run an interactive command in the background, its output overlaps with the current console, and it immediately receives the end-of-file character ^ Z and closes. If you run FDISK, then the terminal settings are corrupted. They are not restored even if you end the session of this terminal and reopen it. That is, the terminals are allocated statically. Interestingly, the CLS does not work as expected, but simply displays the ESC sequence. That is, the terminals are far from direct memory access and must be controlled through ANSI. There was an ANSI driver, but I did not download it. Then I already doubted very much about hoaxes on such a scale. So leave the emulator and go directly to the autopsy.

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. First, note that the file structure has changed dramatically. 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 a file utility glitch, or simply the file format is not yet fully standardized.
Files contain a heading more similar to PE than what you are used to working with dos. You can see the original file name and the list of imported exported characters called DOSCALLS here, that is, there was apparently an attempt to implement something similar to 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 dos, that is, the internal audit message was roughly cut from the output, but remained in the file. The following is just a list of interesting anachronisms and amazing things.

  • DOSCALLS list: ALLOCSEG, REALLOCSEG, FREESEG, LOCKSEG, UNLOCKSEG, GETSEGSIZE, GETDSHANDLE, CRITENTER, CRITLEAVE, FCRITENTER, FCRITLEAVE, PBLOCK, PRUN, SUBSCREEN, GETPIDS, DOSDISLEDHARDCHDODDHEDDHARD Visible memory allocation operations as well as synchronization mechanisms, critical sections and GETPIDS to obtain a list of processes. Interestingly, I did not find a way to get a list of processes for the user. Only, so to speak, a list of applications.
  • Interesting paths are visible in the kernel, for example \ SHAREMEM \, \ SEM \, and in other files \ SHAREMEM \ SMPGNAME, \ SHAREMEM \ SMDATA1, \ SHAREMEM \ PRINTQUE, \ SEM \ PRINT.INS, \ SEM \ PRINT.GO shared memory and semaphores work
  • Using PIFEDIT, you can create for a binary .PIF file with a description of the necessary flags (for example, launch in the background and using 8087) and memory limits. In addition, these settings can be saved directly to the NE EXE.

  • COMMAND.COM can load not only BAT, COM and EXE, but also PIF.
  • The contained link4.exe is an executable linker that can use the NE format. Interestingly, in MS-DOS 4.0 from 1988, the third version of the linker is used, and here is the fourth. It is also interesting to note that the linker is the basic component of the system, but there is not a single compiler that allows you to get .org. This can be explained by the fact that old compilers could be used for the new version, but because of the new format, a new linker.
  • The drivers of even standard devices are separate, have small versions and lines at startup, which were not there before, for example - Installing Com Device Driver V1.02 ---. Surely this is due to a change in the internal representation of devices.
  • The files contain a lot of extraneous lines about the name of the source file, which are not in the release. They can occasionally be found in modified OEM versions, but not in the basic ones. There are a lot of them, which gives some idea of ​​the structure of the source code tree and dates.
    version
    dos / append.exe: @ (#) append.c 1.1 85/10/09
    dos / assign.exe: @ (#) assign.c 6.1 85/10/23
    dos / attrib.exe: @ (#) attrib. c 6.1 85/10/24
    dos / fdisk.exe: @ (#) fdisk.c 1.1 85/10/09
    dos / fdisk.exe: @ (#) fddata.c 1.1 85/10/09
    dos / fdisk.exe : @ (#) fdlow.c 1.1 85/10/09
    dos / fdisk.exe: @ (#) fdsub.c 1.1 85/10/09
    dos / join.exe: @ (#) joinsbst.c 6.3 85/11 / 08
    dos / join.exe: @ (#) sysvar.c 6.2 85/11/08
    dos / join.exe: @ (#) cds.c 6.2 85/11/08
    dos / join.exe: @ (#) dpb.c 6.1 85/11/08
    dos / label.exe: @ (#) label.c 6.1 85/10/24
    dos / link4.exe: @ (#) newdef.y 6.2 85/10/14
    dos / link4 .exe: @ (#) ms4bnr.c 1.1 85/10/15
    dos / mode.exe: @ (#) mode.c 6.2 85/10/24
    dos / pifedit.exe: @ (#) getkey.c 6.1 85 / 10/25
    dos / pifedit.exe: @ (#) pifmes.c 6.1 85/10/25
    dos / pifedit.exe: @ (#) advpscrn.c 6.1 85/10/25
    dos / pifedit.exe: @ (#) advescrn. c 6.1 85/10/25
    dos / pifedit.exe: @ (#) usrscrn.c 6.1 85/10/25
    dos / pifedit.exe: @ (#) rangers.c 6.1 85/10/25
    dos / subst.exe : @ (#) joinsbst.c 6.3 85/11/08
    dos / subst.exe: @ (#) sysvar.c 6.2 85/11/08
    dos / subst.exe: @ (#) cds.c 6.2 85/11 / 08
    dos / subst.exe: @ (#) dpb.c 6.1 85/11/08
    dos / swapper.doc: @ (#) swapper.doc 6.1 85/10/09
    ega.sys: @ (#) BIOSMSYN6. 1
    ega.sys: @ (#) scrinit.asm 6.3 85/11/14
    ibmbio.com:@(#)BIOSMSYN6.1
    ibmbio.com:@(#)ibmbio.asm 6.4 85/11/25
    ibmbio.com: @ (#) scrinit.asm 6.3 85/11/14
    ibmbio.com:@(#)ibmprint.asm 6.3 85/11/14
    ibmbio.com:@(#)ibmatdsk.asm 6.3 85/11/14
    ibmbio.com:@(#)ibmdsk.asm 6.3 85/11/14
    ibmbio.com:@(#)sysini.asm 6.4 85/11 / 14
    ibmdos.com:@(#)msinit.asm 6.7 85/11/26


  • From the previous paragraph you can see the general use of C in this version of dos. Most utilities for DOS 3.30 were encoded in assembler.
  • Some utilities were taken without changes from other versions, for example, CHKDSK from 3.0, DISKCOPY from 2.0, and enough in the old file format.
  • Even in this internal version there is practically no humor and a minimum of debugging information, all I could find was Abort .Retry .Ignore .Fail .Huh? .. and Terrible error, unknown control packet
  • There were no names of living people or something similar to a nickname. Moreover, even the standard phrase © Copyright 1988 Microsoft CorpLicensed Material - Property of Microsoft which is in all release files is not contained in any of the files!
  • Quite brainwashing lines like \ DEV \ NUL and Can't open \ dev \ con, and the directory with executable files is called BIN. I have read more than once that many Microsoft employees of that time were Unix fans.


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 a Russian driver, nor a speech synthesizer can be installed. Zork plays perfectly, tasks switch. You can play CC, but after switching the schedule it breaks. qbasic starts up, but if you switch 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 directly into DOS structures. TSR is not available as a class. Apparently direct access to video memory is also not welcomed. Actually, it is possible precisely because of this point that the project did not receive a future.

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

Multitasking MS-DOS 4.0 was a little known and separate development of DOS done in parallel with the development of DOS 3.x in 1985. It should not be confused with the later retail DOS 4.0 that was released in 1988. DOS 4.0 supported preemptive multitasking , shared memory, semaphores, advanced memory management, a session manager, imports, exports and a new executable format. Many of the ideas and features introduced here found their way into OS / 2. Unfortunately DOS 4.0 was limited by the real-mode 8086 environment and the 640KB address space. Also programs which were not well-behaved or relied upon undocumented DOS functions would not run properly under DOS 4.0, particularly TSR programs.


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

MS-DOS 4.0 was unique because it was developed “on spec” - IBM didn't see a need for a multitasking version MS-DOS and didn't have a new hardware offering on which to attach the product. But IBM did have the PC / AT which was an 80286 based processor and it didn't have an OS that took advantage of that hardware. So IBM and Microsoft started negotiations to take the MS-DOS 4.0 code base and turn it into what eventually turned into OS / 2. I ended up not working on the OS / 2 effort, instead I worked on finishing up MS-DOS 4.0 for the OEM partners who had licensed MS-DOS 4.0.


It turns out that this version wasn’t in vain, it’s not only the ancestor of OS / 2, but literally its bot, many of the technologies that were used here were shared with Windows of that 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 transitional link that everyone has forgotten and not even mentioned.

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

Also popular now: