Re: accessing files, devices, in kernel modules
- From: "gil_hamilton@xxxxxxxxxxx" <gil_hamilton@xxxxxxxxxxx>
- Date: 25 Aug 2006 11:47:55 -0700
Yellow wrote:
now, to my real problem: I must record some sound, and then play it!
since in LInux everything is a file, I'm able to do it by means of
/dev/dsp. that's why I asked abou t how to work with regular files. but
I don't know if this way of accessing devices hold for modules. and I
can't open that file!
No; that way of accessing files is not used from within the kernel
(though it is possible to access regular files). Why do you think you
ought to do this from within a kernel module?
The usual way of doing such things is to write a driver -- which may or
may not be contained within a loadable kernel module -- that interfaces
to a particular type of device and provides the ability to read from or
write to the device (or both). Then one uses an application
(non-kernel) program to read data from one device and write it to
another (or from a device to a file, or from a file to a device, and so
forth). "Everything is a file" in Linux only because there is a driver
for each device that makes it look that way.
GH
.
- References:
- accessing files, devices, in kernel modules
- From: Yellow
- accessing files, devices, in kernel modules
- Prev by Date: Re: PCI Driver - Read/Write to Base Address
- Next by Date: Re: accessing files, devices, in kernel modules
- Previous by thread: accessing files, devices, in kernel modules
- Next by thread: Re: accessing files, devices, in kernel modules
- Index(es):
Relevant Pages
|