[[File:DOS 4.0 multitasking demo.png|thumb|DOS 4.0 running several processes.]]
[[File:DOS 4.0 multitasking demo.png|thumb|DOS 4.0 running several processes.]]
''For more detailed information about this version of DOS, see [[Multitasking DOS 4]].''
Officially called just MS-DOS 4.00, Multitasking DOS 4 was the intended successor of DOS 2.x and later 3.x, initially developed between January 1983<ref>http://www.os2museum.com/wp/multitasking-ms-dos-4-0-lives/</ref> and November 1985. It has many features later appearing in both OS/2 and Windows, including:
Officially called just MS-DOS 4.00, Multitasking DOS 4 was the intended successor of DOS 2.x and later 3.x, initially developed between January 1983<ref>http://www.os2museum.com/wp/multitasking-ms-dos-4-0-lives/</ref> and November 1985. It has many features later appearing in both OS/2 and Windows, including:
Line 21:
Line 23:
This version of DOS supports pre-emptive multitasking, but its usability is limited by the 640kB memory limit, with no swapping because of lack of necessary hardware support. For this reason, it was only released to certain OEMs, opting to wait with the public release for its protected mode successor<ref>https://virtuallyfun.com/2013/03/17/european-ms-dos-4-00-aka-multitasking-dos/</ref>.
This version of DOS supports pre-emptive multitasking, but its usability is limited by the 640kB memory limit, with no swapping because of lack of necessary hardware support. For this reason, it was only released to certain OEMs, opting to wait with the public release for its protected mode successor<ref>https://virtuallyfun.com/2013/03/17/european-ms-dos-4-00-aka-multitasking-dos/</ref>.
=== Preserved Copies ===
=== New APIs ===
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<ref>http://www.os2museum.com/wp/multitasking-ms-dos-4-0-goupil-oem/</ref>.
=== Installation ===
For the media, WinWorld has [https://winworldpc.com/product/multitasking-ms-dos-/400 a copy of the Microsoft version], and OS/2 museum has [http://www.os2museum.com/files/msdos4m-goupil.zip 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:
<pre>
C:
COPY A:*.*
MD BIN
CD BIN
COPY A:\BIN\*.*
</pre>
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:
<pre>
COPY A:*.*
</pre>
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:
<pre>
EDLIN C:\AUTOEXEC.BAT
*5
5:*PATH C:\BIN
*E
EDLIN C:\CONFIG.SYS
*3
3:*C:\BIN\SM.EXE C:\COMMAND.COM
*E
</pre>
Then you can remove your boot floppy and reboot into the full Multitasking DOS 4.0 system, now running from a hard drive:
<pre>
Command v. 4.00
Copyright (C) 1981,1985 Microsoft Corp.
[4.0 C:\]
</pre>
=== 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 ===
[[File:MDOS4 Native Hello world build.png|thumb|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:
DOSCALLS functions:
<pre>
<pre>
data segment public 'DATA'
1 ALLOCSEG
assume ds:data
2 REALLOCSEG
hello db "Hello world$"
3 FREESEG
db 512 dup(0)
4 LOCKSEG
data ends
5 UNLOCKSEG
6 GETSEGSIZE
dgroup group DATA
7 GETDSHANDLE
8 CRITENTER
code segment public 'CODE'
9 CRITLEAVE
assume cs:code
10 FCRITENTER
start:
11 FCRITLEAVE
mov ax, DATA
12 PBLOCK
mov ds, ax
13 PRUN
mov dx, offset HELLO
14 SUBSCREEN
mov ah, 09h
15 GETPIDS
int 21h
16 DOSDISCARDCODE
mov ah, 4ch
17 DOSGETHANDLE
int 21h
18 DOSHANDLEJUMP
code ends
end start
stack segment public 'STACK'
stack ends
</pre>
</pre>
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.
An effort to get Microsoft C working is happening on DisNCord. There are two challenges: the lack of a C runtime for Multitasking DOS 4, and Microsoft C compilers being prone to running out of memory on Multitasking DOS 4.
TODO: Extensions of INT 21h
== OS/2 Pre-Betas ==
== OS/2 Pre-Betas ==
Revision as of 10:48, 15 January 2023
This is a list, chronologically sorted, of OS/2 versions, related products, and historic dates.
For more detailed information about this version of DOS, see Multitasking DOS 4.
Officially called just MS-DOS 4.00, Multitasking DOS 4 was the intended successor of DOS 2.x and later 3.x, initially developed between January 1983[1] and November 1985. It has many features later appearing in both OS/2 and Windows, including:
an OS/2-style per-task data area (PTDA) replacing the MS-DOS program segment prefix (PSP)
system calls using dynamically linked functions in a built-in module named DOSCALLS
the concept of processes along with related system calls
the use of a higher-level language (C) for writing parts of the operating system.
However, unlike any version of OS/2 released to the public (TODO: check for 1986 ADOS 5.0), both earlier MS-DOS COM and MZ executables and MS-DOS interrupts are supported on Multitasking DOS 4, and there are even improvements to these APIs (some of which break compatibility with older DOS versions). New apps use both the legacy (int 21h) and new dynamically linked APIs, perhaps suggesting the old API was deprecated or in the process of being replaced.
It was originally called DOS 3.0, which is referenced by older binaries checking for DOS 3.0 to 4.0; later the release number was pushed to 4.0 with the release of 3.0.
This version of DOS supports pre-emptive multitasking, but its usability is limited by the 640kB memory limit, with no swapping because of lack of necessary hardware support. For this reason, it was only released to certain OEMs, opting to wait with the public release for its protected mode successor[2].