www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/19/01:17:30

Date: Tue, 19 Jul 94 14:07:58 JST
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Real-time OS under DJGPP

   Date: Mon, 18 Jul 1994 15:24:27 -0400 (EDT)
   From: David Max <max AT SLINKY DOT CS DOT NYU DOT EDU>
   Mime-Version: 1.0
   Content-Type: TEXT/PLAIN; charset=US-ASCII

   On Mon, 18 Jul 1994, Martin Haltmayer wrote:

   > What do you mean by 'real-time multitasking'? I always supposed
   > real-time to be the contrary to multitasking... either a process
   > owns the cpu (real-time) or shares it (multitasking)???  Martin
   > haltmayer AT uni-augsburg DOT de

   Multitasking is running two things at the same time. Real-time just
   means that somewhere somehow there is a reference to time and/or
   meeting deadlines. Perhaps there is a user who is waiting for a

In a multi-tasking system, meeting deadlines is far and away the
important consideration.

   response or a serial port interrupt that needs immediate attention. 
   So far all there is available for DJGPP is multitasking based on
   the idea that every task runs until it decides to relenquish

Not true.  There is DESQview/X, which for my single-user non-real-time
uses does very well.  DV/X v. 2.0 is about US$150 from Quarterdeck
Office Systems, Santa Monica, CA.  Try "info AT qdeck DOT com."  There is
also a version without the X server, DESQview.  It is now up to
version 2.62 or so.
    In its untuned state, DV doesn't even "play a 'real-time'
operating system on TV."  A floppy disk or CD-ROM access stops it dead
in its tracks, sometimes for seconds.  However, there are (so I have
heard) drivers that can be installed that make it possible to play
Tetris while formatting a floppy.  That's as close to real-time as I
need.  :-)  Seriously, I have successfully simultaneously downloaded
via FTP a 1MB file, downloaded via 2400 baud modem a 200KB file, and
copied a 1MB file from floppy to hard drive under DV/X, while XAntfarm
was digging up my root window.  The ants tended to take a second's
rest every few millimeters, but no corruption of any of the files
occurred.  Note that I did have a disk cache enabled; this may have
affected the downloads by making it possible for them not to call DOS
very often.  Also, the FTP transfer went about half normal speed for
that connection, indicating that there was a definite performance hit
that might make the system unsuitable for a given application.
    The bottom line is that due to the nature of DOS, it is probably
impossible to have a truly real-time operating system built on top of
DOS, in the following sense.  Unless you make sure that no thread ever
makes a "large" request to DOS (loading a large file, any floppy or CD
ROM access, etc), a thread can get "caught in DOS" and refuse to
relinquish control for many time slices.  There are ways to minimize
this possibility; apparently there are undocumented features of DOS
which can be exploited so that you can interrupt DOS in some but not
all places.  (These features, heavily used by DV, are exploited also
by QEMM and may be related to the problems some people have with
QEMM.)  But there is a (large) irreducible minimum of non-reentrancy
in DOS.
    Of course, you can write your own floppy and CD-ROM drivers, and
so on, doing things a sector at a time or whatever.  But this implies
that the *OS* is not real-time.  Still, that localizes the problem to
a certain group of DOS calls, and you could probably write wrapper
functions which chop up requests into small pieces.

   control. This leaves it up to the programmer to make sure that all
   tasks release control in a timely fashion. I suppose what is meant
   here by "real-time" is that the task scheduler should at the very
   least be preemptive so that the programmer doesn't have to worry
   about writing programs that run for too long without releasing
   control.

   David Max
   New York University

+-----------------------------------------------------------------------+
|                           Stephen Turnbull                            |
|     University of Tsukuba, Institute of Socio-Economic Planning       |
|          Tennodai 1-chome 1--1, Tsukuba, Ibaraki 305 JAPAN            |
|        Phone:  +81 (298) 53-5091     Fax:  +81 (298) 55-3849          |
|               Email:  turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp                 |
|                                                                       |
|                Founder and CEO, Skinny Boy Associates                 |
|               Mechanism Design and Social Engineering                 |
| REAL solutions to REAL problems of REAL people in REAL time!  REALLY. |
|                      Phone:  +81 (298) 56-2703                        |
+-----------------------------------------------------------------------+

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019