On Mon, 6 Dec 2004 02:02, Hannes Mayer wrote: > I'm trying to capture the parallel port interrupt in a kernel module. > First I compiled the "skeleton" from: > http://freebsd.active-venture.com/arch-handbook/driverbasics-kld.html > and it works well. > > Then I googled on how to setup the interrupt handler, also looked at > the device driver sources of the parallel port driver and I found > that BUS_SETUP_INTR is used to setup the handler.
I would suggest looking at existing drivers, there's plenty of working example code 8-) In FreeBSD there is a parallel port abstraction called ppbus (man 4 ppbus) which allows different drivers to access the parallel port. Examples of code that uses ppbus are lpt, vpo, ppi, pps. I would say the ppi driver is probably a good place to start looking as it's just a "geek port", and hence isn't very complex. I just kludged up a version of ppi that you can build outside the tree and allows you to load and unload (although I haven't actually _tested_ it apart from load and unload :) http://www.gsoft.com.au/~doconnor/pphack.tgz -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
pgpMehCHqYsL4.pgp
Description: PGP signature