The Original MS-DOS 4.0

From: Hans Franke <>
Date: Mon Jul 3 09:28:38 2000

> > Well, I never heared about the version you are refering to, but
> > DOS was basicly starting from 2.0 able to do task switching.
> > All Informations necersary where contained within a series of
> > structures with a single root. The only missing thing was a
> > table of task pointers to switch between - and a service to
> > store and restore the screen content. There have been several
> > products offering this service. And with DOS 4 MS supplied the
> > infamous shell, capable of doing this. You could load several
> > applications and switch via a hot key combination. Windows is
> > still today (at least Win9x) based on this very same mechanism
> > for context switching. Also the functions for 'background'
> > applications/drivers where designed to support application
> > switching. The famous TSR mechanism was not only ment to steal
> > some memory for crude interrupt handlers, but also for true
> > serviceprovider tasks within the OS ... well, I guess most
> > programmers never realized the potential offered and kept
> > limited to a simple one programm state of mind.

> > All this was already available starting with DOS 2.x, just
> > it has never been 'official' until DOS 4.x

> I'd have to differ with you a bit on this. A co-worker and I
> spent 6 months writing a DOS 2.0-compatible file system for
> our own application which contained its own home-rolled
> multitasker; we had to write the file system because the
> DOS file system calls were (and through at least 3.3) were
> not serially-reentrant.

> The context switching you're referring to revolves around
> switching some data structures, such as the file handle
> table; but you have to wait until a file system call is
> done before you can swap to the next task. Not useful
> when (like us) you're developing real-time software.

Maybe I should have added some ** around core issues:
The system was designed for *application* switching.
Read: switch maual between lets say Wordstar and dBase.

Dos itself was never reentrant, a switch could only be
issued from outside of most functions - and a switch within
a (hardware) interrupt was close to impossible (one way to
make it was for example to check the IndosFlag (address
gathered by 21/34) and the critical error section flag)
If a task switch request occured while inside DOS you
had to postpone your switch until it was save. Other ways
include the Idle (int28) function of dos and simple DOS
warpers. Starting with 3.0 MS offered within the 21/5D
functions several additional hooks/Lists to allow easy
*application* task switching - and typicaly, with 4.x
almost all of these functions became 'official' counterparts -
just to be dropped again in 5.0...

As soon as you view DOS as a single critical section
your task switchhing should work fine - or you have to
dig into all hooks to allow a lower granuality of non
switching sections, and DOS offers quite a lot to do
so. The famous LoL (List of Lists) has always been
a good start - but even without this 'internal' info
multitasking can be done.

I did a lot of DOS hacking during the 80s ... starting with
DOS 2.11 - and I had to maintain 2.11 compatibility for a
long time since most installations around did use only 2.11.
(One of the first things I did was a (almost) 100% DOS
managed file buffer hack to use free mem as cache - some of
our machines where still in 1988 dual FD/no HD installations -
bu just adding a small buffer allocator/dealocator to the
File Buffer management).

Around 1990 I also did a pure real mode multitasking OS
for a very special setup - to replace a planned 150,000 USD
Unixsystem by a 8MHz 80286 :)

> As an aside, this was for the last firm for which I worked
> as a programmer; I left in '90, and dropped in for a visit
> in '95; at that time, they told me the system I'd designed
> was running in a DOS box under the Alpha-release of Win95
> and was beating a comparable application running on a VAX.
> I felt very good that day...



VCF Europa 2.0 am 28./29. April 2001 in Muenchen
Received on Mon Jul 03 2000 - 09:28:38 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:32:55 BST