Re: accessing files, devices, in kernel modules



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

.



Relevant Pages

  • Re: lock up problems
    ... > I have tried installing many flavours of linux (Redhat, Lycoris, ... Since you've ruled out a hardware problem, I suspect a kernel module or ... driver that's misbehaving with your hardware. ...
    (comp.os.linux.hardware)
  • Re: RocketRAID 1740 driver for Fedora 7
    ... What kernel module gets loaded, ... I would expect the AHCI driver to handle it. ... Fedora doesn't ship a kernel with the needed module, ... Linux 2.6.20-1.2962.fc6 i686 GNU/Linux ...
    (Fedora)
  • Re: Please help
    ... first of all I have no idea about Debian but Im working on a pretty nice ... We do offer a driver for some versions of the Linux operating system and kernel ... new version it is possible to hit a situation where the kernel module will not ...
    (Debian-User)
  • Re: [GIT PATCH] more Driver core patches for 2.6.19
    ... He has two driver programmers ... with little experience in writing Linux kernel drivers. ... Write a large kernel module from scratch? ... where the userspace-kernel interface would be. ...
    (Linux-Kernel)
  • Re: Fedora 5 - Intel Pro/Wireless LAN 2100 3B Mini PCI adapter woes.
    ... Intel PRO/Wireless 2100 Network Connection Adapter ... IMPORTANT INFORMATION BEFORE USING THIS DRIVER ... Intel PRO/Wireless 2100 Network Connection driver for Linux available ...
    (comp.os.linux.networking)