Subject: Re: Opening character device
To: Onofre Wendell <firstname.lastname@example.org>
From: None <email@example.com>
Date: 01/15/2002 17:44:17
On Tue, Jan 15, 2002 at 07:10:36AM -0800, Onofre Wendell wrote:
> How do I open a character device? I can open some character
> devices but not the one that I wrote. I made the device
> using mknod, then tried to open it. Gave me 'device not
> configured' (6).
Well, there are devices and then there are device nodes. Devices
are in the kernel. Device nodes usually live in /dev and are a way
for the kernel to connect the filename with the correct (driver)
data structures in the kernel.
Meaning, you can't just create device nodes with mknod willy-nilly
and expect to get a useful result.
Having said that, most (if not all) character (or "raw") devices can
be opened and used with regular tools. For example, on some systems
you can sample audio by doing a "cat < /dev/audio". A useful tool
for working on character devices is the dd command.
What are you trying to do?
Kevin P. Neal http://www.pobox.com/~kpn/
Seen on bottom of IBM part number 1887724:
DO NOT EXPOSE MOUSE PAD TO DIRECT SUNLIGHT FOR EXTENDED PERIODS OF TIME.