tosh_fan v1.0

tosh_fan turns the fan on and off for Toshiba laptops.  This program
should work with Toshiba 465CDX (at least it works on mine).

The asm code used to turn the fan on and off and get its status was taken
from the 'fan' program by Jonathan A. Buzzard.  According to his readme,
the code should also work with the Toshiba 400CS, 4O0CDT, 610CT as well 
as 410X, 420X, and 430X Satellite Pro's, and 100X, 110X, 200X, and 210X
Satellite laptops.

I wrote this program because Jonathan's fan program does not have a
-q option, which I wanted for my fvwm pop-up menu.  When I went to update
the fan code, I decided that it would be nice to add a couple other 
features.  Most notably is a 'cyclic' feature so that the user can run
tosh_fan in the background to turn the fan on and off periodically.
While I was in the code, I decided to make the code more modular.  The
result is basically a complete rewrite, with only the asm routines
that access the fan surviving from the original "fan" code.

I also wrote this as a way to get my feet wet with Linux programming on
something that really was not at all complicated, but still useful.

Making:
   Unpack the archive, cd to the tosh_fan-1.0 directory and type 
     make tosh_fan

Installing:
   I have not created an install yet (just lazy, I guess).  

   Copy tosh_fan somewhere in the path.  For example:
      cp tosh_fan /usr/local/bin

   Type 'make clean' to clean up the build directory.

Notes:
   tosh_fan must be run as root.  If you want other users to be able
   to run it, be sure to type:
      chmod u+s tosh_fan

   Fire and forget tip.  Add the following line to your rc.local file:
      /usr/local/bin/tosh_fan -fql -t 5 10 &
   to have tosh_fan run on startup, and keep running until you turn
   the machine off (pick any on and off times you wish, of course).
   If you do this, I would suggest NOT letting other people, besides
   root run the program.  You may also want to put it in an sbin
   directory.

Using tosh_fan:
   There are a handful of switches that can be used with tosh_fan.

   -f - turns the fan off
   -n - turns the fan on 
   -q - quiet mode, no user message
   -v - verbose mode, all user messages, default
   -l - turn on system logging
   -t number1 [number2] - cyclic mode  
      on for number1 minutes, off for number1 minutes or number2
      minutes depending upon the number of numbers given
   --help - displays the switches
   --version - displays the version and copyright

The f, n, q, l and v switches can all be grouped behind one '-'.  It is an
error to use the -f and -n at the same time.  If -q and -v are used at the
same time, whichever one is used last takes precedence.

-t must always be followed by a number.  -t cannot be grouped after the
same '-' as other switches.  If -t is used with -n or -f, the -n or -f
indicate the initial state of the fan.

If no switches are given, tosh_fan will display the current state of the
fan (on or off).

Example:
    tosh_fan -fq -t 10 &
    Will run tosh_fan in the background.  The initial state of the fan
    will be off for 10 minutes, then on for 10 minutes, then off for 10
    minutes....   This will continue until tosh_fan is killed.

Version Information:
  o Version 1.0
     o never really released
     o initial version

  o Version 1.1
     o first version I actually plan on letting others see
     o added OFF time as opposed to just one time in the
       cyclic mode
     o added system logging
    
Future Plans:
    I also plan on writing a "Toshiba Control Panel" once I get done
    going through the GTK+ tutorial, and if my job ever gives me some
    free time.  This will combine the tosh_fan program with a system
    monitor, battery monitor, etc.


If you want to get a hold of me:

Kenneth W. Sodemann
e-mail: stufflehead@bigfoot.com
