Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Oct 2000 04:41:51 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Willem van Engen <wvengen@stack.nl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD 4.x kld device driver 
Message-ID:  <200010031141.e93Bfph06288@mass.osd.bsdi.com>
In-Reply-To: Your message of "Tue, 03 Oct 2000 13:00:51 %2B0200." <39D9BC63.7C7EDD43@stack.nl> 

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

Have a look at the simple device driver I wrote for the Linksys 
Gigadrive's front panel LEDs, etc. 

http://people.freebsd.org/~msmith/gigadrive

This approach should suit you well.  I would use a single device node and 
a small set of ioctls for your control interface, as this will keep 
things simple.  You could also use a couple of sysctl nodes (this would 
make it possible to talk to it without needing a device node).

Let me know if you want more comments on your code...

> I'm writing a device driver for FreeBSD 3.x and 4.x for the application
> panel of the fujitsu lifebook c4110 notebook (a led, lcd and some
> buttons). It took me some time to get a working driver (compiles on both
> 3.x and 4.x), but it's not really clean code. I'd like to rewrite it,
> but I can't find how to do it properly (the kernel sources don't help me
> enough). How do I use uimove, DECLARE_MODULE, etc properly? How do I use
> more than one device in one module?
> Currently I use outb and inb to access the hardware resources. Should
> newbus be used in FreeBSD 4.x?
> 
> Another question is the architecure of the device driver. How exactly
> should the interface to the device be? Currently, I'm thinking of three
> devices to control the three different parts /dev/led (led), /dev/lcd
> (lcd) and /dev/abtn (buttons). Ascii numbers should be written to/read
> from the character devices. Is this the way to do it, or should system
> calls be used (harder to use in shell scripts) or binary values?
> 
> Thanks in advance.
> 
> Willem van Engen <wvengen@stack.nl>
> 
> See the application panel project at http://willem.n3.net/fujitsu/
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




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?200010031141.e93Bfph06288>