Monday, 26 August 2013

What is the difference between misc drivers and char drivers?

What is the difference between misc drivers and char drivers?

I'm reading about misc drivers in Linux, and I'm a little confused about
the differences between them and char drivers. One source, the Linux
journal, writes:
Alessandro tells us how to register a small device needing a single entry
point with the misc driver.

Sometimes people need to write "small" device drivers, to support custom
hacks—either hardware or software ones. To this end, as well as to host
some real drivers, the Linux kernel exports an interface to allow modules
to register their own small drivers. The misc driver was designed for this
purpose.
Ok, so from this I get that there's a simple driver (in this case with a
single entry point), that's a misc driver. Then another source, Essential
Linux Device Drivers, states:
Misc (or miscellaneous) drivers are simple char drivers that share certain
common characteristics. Because misc drivers are char drivers, the earlier
discussion on char driver entry points hold for misc drivers, too.
Now this seems to say that misc drivers are just char drivers, but perhaps
a subset of functions, and char drivers can have more than one entry point
(such as an ioctl() or an open() or a read() call)
So, what, in Linux C coding terms, are the differences between a char and
misc device driver? (Besides the obvious major number assignment (10) for
all misc drivers). Is there a difference in supported entry points? Is my
assumption correct that misc device drivers only have a subset of what you
can get in a full char device driver?

No comments:

Post a Comment