Go to Google Groups Home    comp.os.minix
What would you like to see most in minix?

James da Silva <j...@cs.umd.edu>

In article <1991Aug26.110602.19...@klaava.Helsinki.FI> torva...@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:

>Unlike minix, I also happen to LIKE interrupts, so interrupts are
>handled without trying to hide the reason behind them (I especially like
>my hard-disk-driver.  Anybody else make interrupts drive a state-
>machine?).

Sure.  For one example, Alessandro Forin's Mach SCSI adapter drivers are
written this way.  A comment from his code:

/*
 * This layer works based on small simple 'scripts' that are installed
 * at the start of the command and drive the chip to completion.
 * The idea comes from the specs of the NCR 53C700 'script' processor.
 *
 * There are various reasons for this, mainly
 * - Performance: identify the common (successful) path, and follow it;
 *   at interrupt time no code is needed to find the current status
 * - Code size: it should be easy to compact common operations
 * - Adaptability: the code skeleton should adapt to different chips without
 *   terrible complications.
 * - Error handling: and it is easy to modify the actions performed
 *   by the scripts to cope with strange but well identified sequences
 *
 */

An interesting way to write a device driver.  I believe this is a very old
technique, too.

Good luck on your OS project, it sounds like a lot of fun.
Jaime
...........................................................................
: domain: j...@cs.umd.edu                                   James da Silva
: path:   uunet!mimsy!jds                   Systems Design & Analysis Group