
********************************************************************************
**
**   Copyright 1995 David F. Carlson  (carlson@dot4.com)
**   Copyright 1995 Dot4, Inc.
**   All rights reserved
**
**   POSIX 1003.1b Process Scheduler  (POSIX.4)
**   Provided to the Linux Community by Dot4, Inc.
**
**   Dot4 is a provider of professional services for POSIX-based 
**   real-time systems from embedded to distributed.
**
**   For more information call:
**
**   Dot4, Inc.  (800) 834-1951 **  email: dot4@dot4.com
**   The Real-Time Specialists
**
********************************************************************************

This is a POSIX.4 compliant real-time scheduler for our favorite free OS!

Theory:

Other than adding the required system calls, the trick is that whenever a
process is made runnable, and it is a POSIX scheduled process, it tickles
a mask of run bits, and sets the need_resched flag.  At the next opportunity,
(ie., clock interrupt, end of system call, etc.) the scheduler finds the 
highest priority runnable process -- and runs it.

Layout:

The libc contains the system call pieces.  Archive these into /lib and /usr/
lib/gcc-lib/linux... etc.

The "test" directory contains a nice-like program.  See the usage message
for help.  All of the fields are optional.  Just a pid will print the 
scheduling domain of the target.  Useful as there is no other way to detect
a POSIX scheduled process.

The linux directory contains kernel/psched.c and include/linux/psched.h and
the dot4.patch.  CP these to your kernel build area.  Apply the patch to 
linux.1.2.0 (or eequivalant).

Limitations:  

The RR quantum is compile-time fixed.  It will be made runtime modifiable
per process controlled Real-Soon-Now.  The RR domain has had too little debug.

Notes:

Use the vt consoles at first.  Remember XWindows uses several timeshare
processes to make your shell echo to you!  Log a max priority vt in before
you play.  (Console switching is at interrupt priority -- it works even if
the a FIFO scheduled process is in an infinite loop.)  Console switching to
XWindows is *NOT* interrupt driven -- and then you may be stuck.

Credits

Thanks for bug reports to:

Markus Kuhn, mskuhn@cip.informatik.uni-erlangen.de

Practical Consideration:

Don't put a SCHED_FIFO process into an infinite loop.

Good luck.

dfc
Dot4



