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

Currently, this code is designed for Intel-based Linux machines running
kernel version 2.2.7.

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

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

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

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

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

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

4. Apply the patch file linux_2.2.7_dwcs_v1.0.patch by typing:

	patch -b -p1 < linux_2.2.7_dwcs_v1.0.patch

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

5. Copy the new schedbits.h file to /usr/include:
   
 	cp schedbits.h /usr/include

6. Rebuild your new kernel. To be safe, you should disable SMP support
   since I have yet to verify DWCS works on SMP machines as of this
   release.

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

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 directory containing this INSTALL file)

10. If all is working, 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.
    However, you should type 'dmesg' to see what I think of such
    careless people ;-)

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.


	


