has been discussed on the Linux Kernel Mailing List numerous time and
standard answer is "don't do that, do it in userspace instead." You could
ioctl or /proc entry that userspace can use to get the data. If you still want
something like this may or may not work.
long sys_open(char* filename, int flags, int mode);
long sys_close(int fd);
long sys_write(unsigned int fd, const char* buf, suze_t
then use these as you would use open(), write() and close(). Don't ever
from an interrupt handler or similar.
I'm currently working writing driver-level code
on the Axis ETRAX 100LX MCM 2+8. Specifically, I'm working in the
ethernet and parallel port driver files (ethernet.c and
e100lpslavenet.c). We are using the chip for high-speed handling of
ethernet packets, so a lot of "high-level" functionality has been stripped
out. That being said, I need a way to write a small amount of data (no
more than 64 bytes) to memory (or to file), so it can be retrieved on
I'm also very new at all this (and the Linux
environment), so please bear with me if my questions seem somewhat
I tried including <asm/unistd.h> for
file i/o, but it doesn't appear the functions are available to me (maybe I'm
just not including the right files)
I get the following [compiler
error]: undefined reference to 'open'
If it is practical, and if file i/o is possible
at the driver-level, what might I be doing wrong?
Alternatively, I was wondering if I could just
write to/read from the built-in flash? (As I mentioned, it's
only 64 bytes of data.) If so, are there functions that I may use to do
this and where are they?
Thanks for your help.