accessing files, devices, in kernel modules



hi there!

I have just started studying the linux kernel, version 2.6. i read some
manuals, howtos, have already made some really simple modules, but when
I tried to do a little more complex work, I stumbled across some
dificulties.
well, what I want to is a kernel module that opens a regular file,
writes something to it, and closes it. easy, isn't it? I also thought
that ;)

but then I tried making a simple open over the file, but the module
complains it can't find the symbols open, close and write. Is there
anything unusual I must do to work with files in the kernel? none of
the manuals I read mentioned how to open and do some I/O over it.

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!

I looked at /proc/kallsyms, and open is there. I don't have a clue why
the module complains it couldn't find the open.

thanks for any help you could provide, and sorry for such noob question

.



Relevant Pages

  • Re: accessing files, devices, in kernel modules
    ... I have just started studying the linux kernel, ... well, what I want to is a kernel module that opens a regular file, ... the manuals I read mentioned how to open and do some I/O over it. ...
    (comp.os.linux.development.system)
  • Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning
    ... Are suid binaries something that you feel is necessary to scan from? ... downloading and installing trojaned libraries is not something we can ... bad kernel to disable scanning) but by that time they already won. ... for a test that is a good mix of reads,writes, and opens. ...
    (Linux-Kernel)
  • Re: accessing files, devices, in kernel modules
    ... probably I need to use some kernel ... but what I'd like to know is: can I use the sound card the same way I ... well, what I want to is a kernel module that opens a regular file, ... complains it can't find the symbols open, ...
    (comp.os.linux.development.system)
  • Re: accessing files, devices, in kernel modules
    ... There is one link in the reference link at this place, ... like to know is how can I use the soundcard in kernel space. ... but what I'd like to know is: can I use the sound card the same way I ... well, what I want to is a kernel module that opens a regular file, ...
    (comp.os.linux.development.system)
  • Re: broken linuxulator in -current as of Jan 8 17:51:45 CET
    ... the open trace shows REAL path ie. after possible prefixing with /compat/linux ... ie. it opens the right library but IGNORES it and the iterates through the rest ... This may not be a _new_ bug in the kernel. ... It may be the case that the introduction of a new linux syscall ...
    (freebsd-current)