Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 1998 14:07:49 +0200 (MET DST)
From:      Nick Hibma <nick.hibma@jrc.it>
To:        hm@kts.org
Cc:        FreeBSD hackers mailing list <hackers@FreeBSD.ORG>
Subject:   Re: developing device drivers
Message-ID:  <Pine.GSO.3.95q.980813140426.16056K-100000@elect8>
In-Reply-To: <m0z6u8J-000026C@bert.kts.org>

next in thread | previous in thread | raw e-mail | index | archive | help

 > > I second this. If you look in /usr/share/examples, you'll find a
 > > couple of sample LKMs written by Terry Lambert. I hijacked the syscall
 > > example from here and used it a lot to experiment with the XL driver.
 > 
 > I'd really like to write drivers (for ISA cards) as LKM modules, but so
 > far i don't know how to assign 1) the IRQ, 2) the iobase and 3) the membase
 > ( and perhaps flags and spl) to the LKM at module load time.
 > 
 > Did i miss something ?

Perhaps, Have a look at the verious examples, for example the wcd
driver.

Another possibility is to write a device driver that hooks into the
kernel at boot time, picks up the relevant information and stores it in
a struct. Besides attaching to the device getting that information and
maybe initialising the device it doesn't do anything. About 200 lines of
code should be easy enough to debug.

Then you write an LKM that abuses this information struct to initialise
the card as soon as the LKM is loaded. If you get the init and deinit
right in your LKM there should be no problem.

It worked for me while doing some work on a USB driver stack.

If needed I can send that code to you as an example. Or pick it up at 

http://www.etla.net/~n_hibma/usb/usb.pl

Cheers,

Nick


-- 
building: 27A
address:  STA-ISIS, T.P.270, Joint Research Centre, 21020 Ispra, Italy
tel.:     +39 332 78 9549
fax.:     +39 332 78 9185


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.95q.980813140426.16056K-100000>