Installation of DWCS for Linux
------------------------------

This software is designed for Intel-based Linux machines running
kernel version 2.2.7.

You should follow these few steps for (hopefully) successful
installation:

Either:

a) Run ./install_dwcs as root, if you're feeling lucky :-) and
   you have a clean linux source tree in /usr/src/linux,

   or

b) Follow the following steps:

1. Make sure you're running as root. If not, type:
	
	su root (and enter your password if necessary)

2. Copy the patch file linux_2.2.7_dwcs_v*.*.patch to the top-level
   directory of a CLEAN (that is, unmodified) Linux 2.2.7 source tree:

	cp linux_2.2.7_dwcs_v*.*.patch /usr/src/linux
	(or to wherever the Linux source is on your machine)

3. Change to the top-level directory of your source tree:

	cd /usr/src/linux (or wherever it is on your machine)

4. Apply the patch file linux_2.2.7_dwcs_v*.*.patch by typing:

	patch -b -p1 < linux_2.2.7_dwcs_v*.*.patch

   Hopefully, your source tree should be patched successfully at this
   point.

5. If there exists /usr/include/schedbits.h, make a backup and copy 
   the new schedbits.h file to /usr/include:
   
 	cp dwcs_v*.*/schedbits.h /usr/include

   If there was no previous /usr/include/schedbits.h file, then
   there should be a file called /usr/include/bits/sched.h. If so,
   make a backup, of this file and copy sched.h to /usr/include/bits:

	cp dwcs_v*.*/sched.h /usr/include/bits

6. Rebuild your new kernel. NOTE: In the "Kernel Hacking" menu, there are 
   two options to enable building of the DWCS scheduler module (CONFIG_DWCS)
   and the /proc filesystem entry (CONFIG_PROC_DWCS) for retrieving
   information about DWCS scheduled processes. Say "Y" to both of these 
   options (you can say "N" to enabling an entry for DWCS in /proc). 
   By default, the CONFIG_PROC_DWCS option is not available unless you 
   first enable the DWCS scheduler module.

7. Make sure that you make all kernel modules and install them after 
   building the new kernel. Follow the instructions for building the kernel 
   as normal (see the README file in the top-level directory of the source 
   tree), then type:

   make modules; make modules_install

7. Change back to the directory containing this INSTALL file and type:
 
	make

8. Restart your machine with the new kernel.

9. When your machine has rebooted, you should now be able to type:

	modprobe dwcs

   If this fails, try:

	depmod -a; modprobe dwcs
  
	or

	insmod dwcs (from the `kernel' or `/lib/modules/2.2.7/misc' directory)

10. If all is working, and CONFIG_PROC_DWCS was set when you built your
    new kernel, you can now type:

	cat /proc/dwcs 

    This shows you various scheduling parameters regarding the current
    snapshot of the scheduler runqueue. If there's not much there, that's
    because most processes are blocked. Check 'top' to verify the
    number of processes actually using the CPU at the current time.

11. Add the directory containing this INSTALL file to your path. Then,
    as root, you can type:

	load_scheduler (to force DWCS to be the active kernel scheduler)
	unload_scheduler (to return to the default Linux scheduler)

    If you have the dwcs module loaded and you decide to remove it
    by typing 'rmmod dwcs' when DWCS is the active scheduler, the
    system should gracefully return to the default Linux scheduler.

I've added a command-line executable: dwcs_setscheduler, that allows a
process, identified by its PID to have its DWCS scheduling attributes
set by the super-user at run-time.

MAKE SURE YOU KNOW WHAT YOU ARE DOING WHEN YOU USE 'dwcs_setscheduler'
OTHERWISE YOU MAY LOCK UP THE MACHINE, AND THE ONLY SOLUTION AT THAT
POINT IS TO PRESS THE BIG ON/OFF SWITCH.

You can also set scheduling parameters for processes within your own
programs by using the system-call, sched_setscheduler(). To set DWCS
service attributes, specify SCHED_DWCS as your scheduling policy.

Check the Documentation.txt file for more information, or look at:
http://www.cc.gatech.edu/~west/dwcs.html

Enjoy,

Rich West.


	


