[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

character device driver for I/O-card.



Ugh!

I am studying engeneering and in school we have a subject
called ``embedded systems''.  Here we have designed an
I/O-card (very simble with some LEDs and DIP switches) and
write some software to read from and write to this card in
C++.  We are using a development tool called
RTKernel/RTTarget which is absolutely *excellent* for writing
OSes for embedded realtime systems.

Now.  I would like to make something similar in Linux.
Write a driver for an I/O-card plugged in the ISA-bus.
I can understand read/write operations like the ones needed
are only allowed from suid root programs or kernel/modules.

This is what I had in mind:  kernel module that create a
char device /dev/myhardware which reflects my card.  Once
the module is loaded, the normal filesystem permissions
take care of which users (most likely a group) that have
access to /dev/myhardware.

At this point, I am not focusing on the realtime-part yet; I
simply want a drive for my (yet to be designed) hardware.  I
have been reading some of ``Linux Module Programmers Guide'' and
found it to be horribly outdated; it is based on 2.2.x and I am
using 2.4.0.  However, it gave me a feel of the basics.  I have
been looking into the source of some of the char drivers that
come with 2.4.0, like the nvram.c and rtc.c, and combined with
the information from the book, I can understand most of it.
But macros and functions defined else where makes it
incredibly difficult for a kernelnewbie.

So!  Where can I find better sources for information on
writing my own kernel module and char device driver?  And am
I heading the right direction at all?

I know the book ``Linux Programming Unleashed'' has a chapter
about device drivers, but I assume it is outdated as well.


Any help, comments, suggetions, flames are most welcome.


I use Debian potato kernel 2.4.0 on an x86-architecture.

-- 
Stephan Henningsen  /
                   /  http://stephan.tisprut.dk


-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml