Multitasking DOS 4

From DisNCord Community Wiki
Jump to navigation Jump to search
DOS 4.0 running several processes.

Multitasking DOS 4 (officially called just MS-DOS 4.00, and for convenience often shortened to MDOS4) is a version of the MS-DOS operating system released in 1985.

Introducing multitasking and a new binary format shared with the contemporary Windows 1.0, it was supposed to be the next major update to the DOS operating system. However, due to technical and business reasons, it was only released to a few OEMs, who used it in a few niche applications; the rest of the world continued to use DOS 3.x, which eventually evolved into another, different version called MS-DOS 4.0.

History

Work on Multitasking DOS began in 1983, initially under the name DOS 3.0, which is documented by the fact some applications check for version number from 3.0 to 4.0. On 26 November 1985, internal revision 6.7 was built, which became the basis for subsequent OEM releases. SMT Goupil built an OEM release for their Goupil G4 computer on 15 May 1986, based on internal revision 6.7. There are some mentions of a later 4.1 release[1], these are however unconfirmed, since no such release was preserved or seen.

Since at least 1985[2], work on an 286 version of DOS was happening in parallel, which was eventually released in 1987 as OS/2 1.0, replacing Multitasking DOS.

Preserved Copies

There are two versions of Multitasking DOS 4 that were preserved. The first one is a two-floppy set, originally uploaded to the now defunct JSMachines.net website. It does not contain any branding and its kernel (IBMDOS.COM) identifies itself as internal revision 6.7, 85/11/26, which is consistent with the creation date of the files. The internal revision identification is cut off with an end of string sign, possibly indicating it was manually edited after the build; together with the fact IBM branding is used, it hints that this is actually a pre-release version. Floppy 1 contains the operating system and a few basic utilities, including FDISK and FORMAT; floppy 2 contains additional utilities, commands, a copy of the 8086 New Executable linker (LINK4.EXE), a PIF editor (PIFEDIT.EXE), and EDLIN.

The second version is an OEM release by SMT Goupil, a French company, for their Goupil G4 computer, featuring an 80186 clocked at 8 MHz. It was originally a two-floppy set, but the only preserved version is a single 720kB floppy. Based on timestamps, it was built on 15 May 1986, and possibly assembled into a single floppy on 20 March 1997. The kernel is renamed to MSDOS.SYS and IO.SYS, like it is common on MS-DOS (strings inside IO.SYS reveal the source was still named IBMBIO.ASM), and the internal revision string is not present. In addition to what is the first version, it contains a Unix-like PS.EXE utility, revealing some internals about the OS, a kernel debugger (DEBUGDD.SYS), a networking driver (NET.SYS), and DOSSIZE.EXE, an utility printing used and available memory. Strangely, the session manager (SM.EXE) is missing[3].

Installation

For the media, WinWorld has a copy of the Microsoft version, and OS/2 museum has a copy of the Goupil version. VirtualBox is confirmed to be compatible with Multitasking DOS 4. 86Box is also compatible, though 3½ inch floppy drives do not seem to work (this means you have to use the Microsoft release). For best results, try the Phoenix AT clone (under 80286 CPU).

To get Multitasking DOS 4 up and running, create a VM with a floppy drive and an IDE hard drive no larger than 32 MB. Boot from floppy 1, run FDISK and do the usual procedure of partitioning the hard drive. After reboot, run FORMAT C: /S to format the hard drive and install DOS, then you can reboot into the base system. (If you get the "bad or missing command interpreter" trying to boot from hard drive at this point, then boot from the first floppy and run these steps from there.)

There is no installation program, hence to complete the installation process, the files from the floppy have to be manually copied to the hard drive:

C:
COPY A:*.*
MD BIN
CD BIN
COPY A:\BIN\*.*

If installing the Goupil version, the file copying is over now. If installing the Microsoft version, swap to the second floppy, stay in the BIN directory, and run again:

COPY A:*.*

Before rebooting, AUTOEXEC.BAT and CONFIG.SYS have to be modified to point to the hard drive instead of the floppy. Failure to do this will result in a "bad or missing command interpreter" error on boot. EDLIN.EXE is shipped with the system and can be used to do the necessary changes:

EDLIN C:\AUTOEXEC.BAT
*5
      5:*PATH C:\BIN
*E
EDLIN C:\CONFIG.SYS
*3
      3:*C:\BIN\SM.EXE C:\COMMAND.COM
*E

Then you can remove your boot floppy and reboot into the full Multitasking DOS 4.0 system, now running from a hard drive:

Command v. 4.00
Copyright (C) 1981,1985 Microsoft Corp.

[4.0 C:\]

Tips and Tricks

The Alt key starts the Session Manager menu, from which you can create a new session and switch between existing sessions. Each session has a memory limit that can be viewed by the MEMSET command (default is 128kB). Keep in mind that legacy DOS applications (i.e. non-New Executable ones) take the entire space up to the limit, so you probably don't want to set it to maximum. For legacy applications switching between several programs, like Microsoft C 4.0's CL.EXE (calling C1.EXE), the right amount has to be fine-tuned in order to allow both binaries to run (in the case of MSC 4.0, 200kB works, 128kB is too little for C1.EXE to load, 640kB causes CL.EXE to take all the space, leaving none to C1.EXE).

If you installed the Microsoft version, it is recommended to install DOSSIZE.EXE and PS.EXE tools from the Goupil version; if you installed the Goupil version and want the Session Manager (for switching between processes), you have to copy SM.EXE over from the Microsoft version.

Development

Native New Executable Hello world application built using MASM and LINK4 on Multitasking DOS 4.0

No toolchain directly targeting Multitasking DOS 4 was preserved, however, the aforementioned distributions contain an New Executable linker (LINK4.EXE), which can be used together with a suitable assembler or compiler to create NE binaries that will run on Multitasking DOS 4.

Microsoft C 3.0 can be used as the C compiler, since as discovered by neozeed, its C library is compatible with LINK4.EXE, and it can be easily installed. To build an NE binary with it, assuming PATH, INCLUDE and LIB are set, first run CL.EXE with /c to produce an object file, then run LINK4.EXE to link the final binary (typically, you need to specify to link against SLIBC.LIB and EM.LIB). The compiler includes no support for MDOS4's DOSCALLS module; DOSCALLS.LIB can be extracted from the MDOS4 kernel with a library manager, but currently we have no header file with function prototypes.

MASM 4.0 can be used to assemble a simple program on Multitasking DOS 4. In order to be successfully linked with LINK4.EXE, the program must contain a DGROUP declaration, which is also called Automatic Data Segment in the NE specification. Here's an example implementation of Hello world:

data segment public 'DATA'
assume ds:data
hello db "Hello world$"
db 512 dup(0)
data ends

dgroup group DATA

code segment public 'CODE'
assume cs:code
start:
mov ax, DATA
mov ds, ax
mov dx, offset HELLO
mov ah, 09h
int 21h
mov ah, 4ch
int 21h
code ends
end start

stack segment public 'STACK'
stack ends

Note the 512 zeroes in the data section, without these, the program doesn't work for some currently unknown reasons. This quirk is not shared by Windows 1.0, which runs the Hello world program fine without the zeroes.

References

  1. http://www.os2museum.com/wp/multitasking-ms-dos-4-0-lives/
  2. Judging by the fact that Microsoft C 3.0 includes a switch for 286 support. TODO: Check if MDOS4's LINK4 supports PROTMODE.
  3. http://www.os2museum.com/wp/multitasking-ms-dos-4-0-goupil-oem/