Previous Next Table of Contents

3. Software

3.1 Software

You will have to build an executable that will perform like this:

Change BASE = 0x3bc for /dev/lp0, 0x378 for /dev/lp1, and 0x278 for /dev/lp2, range=8.

It would be nice if you had that program setuid, so that everybody can drink coffee!

3.2 Device driver

Just read kernel hacker's guide, implement a device driver (it could even be user space i think). Please, compile it as a module, so that we won't need a kernel compile in every update. Then write:

echo cappuccino >/dev/coffee

And you will have a hot cup of coffee in 1 minute. Remember to give the right permission to /dev/coffee, depending on whether you want only root making coffee or not.

The advantage of this method is that it supports feedback from the coffee-machine by using the ACK of parallel port, so that smart coffee-machines could produce an interrupt.

Do it as homework.

3.3 Connecting with the Internet

If you have implemented the C programme (see above), you just have to write down a simple CGI script to turn ON and OFF the coffee-machine. You should write some nice webpages, explaining how to make coffee, and put them at an apache web server...


Previous Next Table of Contents