Qmeter v1.00 Zap's QuickMeter
Copyright (c)1997 Michael Dwyer/N0ZAP (mdwyer@holly.colostate.edu)
13-Mar-97

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

---Overview
This program is used to drive the LED display described in the
led-stat.txt file that came with this archive.  It is different from
most other meters on the market(?) in that it displays the CPU idle
time, as opposed to the load average.  It uses the /proc filesystem to
gather its data. It has to option to include a "heartbeat" similar to
the HP9000 workstations, and an option to vary the beat with the load
average.

---Required 
1) The led-stat LED meter (instructions in the included led-stat.txt file)
2) 386 or higher PC running the Linux OS with the /proc file-system activated.
   Qmeter works with 1.2 and 2.* kernels. Drastic changes in /proc will break
   the meter. The meter might work with other machines, but changes
   will need to be made to the port.h file.
3) A free parallel port.

---Installation
1) Edit the config.h file. Most importantly, make sure the IOPORT is
   set correctly.  All the options are documented in the config.h
   file.
2) Edit the Makefile.  All you should need to do here is
   remove the -m486 flag if you don't have a 486. 
3) Become root. Type 'make'. 
4) Copy the qmeter executable to /usr/local/bin or someplace similar.
5) Copy the qmeter.1 man page to /usr/man/man1 or your man path.         
6) Add a line to your /etc/rc.d/rc.local file like this:
         /usr/local/bin/qmeter &
7) Enjoy!!

---Background
The led-stat meter is extremely simple to build and has some really neat
applications.  However, there's not too much choice in software to run it. 
In my travels, I've seen three other meters that all do the same thing, albeit
with different amounts of cleanliness.

The first is the one that came with the led-stat.txt file. (The one included
i this package is trimmed down.) I don't know how many people bothered to 
make it work. It chewed on the output of the ps command to get it's
info, which I suppose made it a little more portable.

The second one is a neat little one built in C++.  It is a little better, but
some people have had problems with it. (I never tried it.)

The third one is one that I suggest you find. The meter-0.2 package, written
by Brian D. Chase (chasebd@nextwork.rose-hulman.edu) is full of all kinds
of nifty features, from being able to do a Cylon/Knight Rider to different
kinds of chases. It was also nice in that it was a lot nicer on the system.
It is an excellent companion to my meter. It isn't as quick to respond to
system changes, but its a lot more attention-getting. Use it to
impress your friends!

All the prior meters have the same problem, though. They only read the load
average. The load average is a tenuous number, to say the least. Is there
a max load average? How do you know when to light your last LED? It is also
a pretty boring number. It doesn't change all that much, (every 5 seconds or
so)and on my own machine, is rarely above 1.0 anyway. So, it just doesn't 
respond to changes in the system fast enough.

So this meter reads the CPU idle time, instead.  This number makes a lot 
more sense to me. It has a definite high and low point. But the best thing
is that is is constantly in motion. For instance, enter X11 and drive the
mouse around. Did you ever realize it took that much CPU time to run the
mouse? DOSEMU keeps the meter at an even 1/2. Watch as a JPEG picture decodes:
the meter maxes out. Watch instantly as an action moves the meter.

Note that on a bogged-down machine, this meter could be pretty boring: "Hey,
look! Its still solid red!!"  Its a lot of fun on a small system that doesn't
see too many users at a time.  You can feel safe putting it on a bogged-down
machine, however, knowing that it will not add much to the load.  It uses
very little CPU time, and keeps less than 300k resident. (Your mileage may
vary.) One interesting thing is that this program sits near the bottom of a 
top(1) display, while top itself stays at the top.  Turning off the scaling
makes it even faster. 

---Changes
From 0.99
 - Removed the ugly beat_mask and used XOR instead. (How stupid of me!)
 - Added load average scaling.
 - Chenged the BEATLENGHT to a percentage.

Still to be done
 - Add command line options
 - Change the scaling function (Scales up too fast!)
 - Patch to make it useable with lcdtime
 - Use of all 10 LEDs?

---Thanks
Thanks go out to Joseph Vigneau, who (I presume) thought up the whole thing to
begin with. Damian, a roommate of Joseph, I presume (damianf@wpi.edu) for
writing the code to send data direct to the port. Brian Chase (chasebd@nextwork
.rose-hulman.edu) for writing meter-0.2, which was an inspiration. Chris
Hirsch/N0ZWI (chirsch@holly.colostate.edu) for his insight and imagination 
(he's working on the 16-LED version right now...) My father, who bought me a
Commodore 64 way back in 1985.  Ryan Straughan, who helped me get started in
Linux. Linus for making a pretty damn nifty operating system.

