Subject: Re: PCI device driver as LKM
To: Matthias Scheler <tron@lyssa.owl.de>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: tech-kern
Date: 12/28/1998 09:49:53
In message <766htr$ioo$1@colwyn.owl.de> Matthias Scheler wrote:
> Hello,
>
> does NetBSD's LKM interface already allow to load a driver for PCI board
> which needs an interrupt, register space and DMA? If it does where can
> I find an example source?
I think so. I do all my stuff at the moment with LKM's and I think
the probe-code should still be able to handle it. (I don't have a
PCI driver though)
Just probe during the LKM initialisation, so you can fail that if
the card is not there.
A good example with a nice trick to create the /dev/ entries on the fly
is in /sys/lkm/netinet/if_ipl/mln_ipl.c.
CAVEAT:
If want to do that to make a binary distribution of the driver usable
on more than one release/snapshot forget it. As there is no defined interface
to the kernel you have to recompile it every 2-3 weeks if you track -current,
and keep a 1.3 1.3.1 1.3.2 1.3.3 1.3A ... version.
We need to define this interface so we can make drivers a little more
portable (eg. an LKM shouldn't have to know if UVM is used, or LOCKDEBUG
is turned on etc.)
Stefan
BTW.
As the enhancments I posted in the summer (loading lkm symbols and linking
between LKM, clone devices) are still not checked in I've made lkm's of those.
I can mail you the source if you like. (the clone device stuff contains now
a function to create a /dev/ entry).
>
> Thanks in advance
>
> --
> Matthias Scheler http://home.owl.de/~tron/
--
Stefan Grefen Tandem Computers Europe Inc.
grefen@hprc.tandem.com High Performance Research Center
--- Hacking's just another word for nothing left to kludge. ---