[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
passing variables to/from kernel space
Hi all,
complete new guy to the Linux kernel and module programming. I've written
a module that can read to/from memory mapped space to the registers of a
PCI card (PLX9054 chip). It's simply loaded and unloaded using insmod and
rmmod, and isn't left to reside in the kernel -- it's just for a quick
initialisation of register values after which I can forget about them.
1. How do I pass register values entered in user space to the module so
that these values are loaded into the registers? I've read up on
copy_to/from_user and put/get_user but don't know how to implement them in
working code.
2. In a kernel module I want to call some function which will give me the
time elapsed in seconds since Jan1 1970 - time() would do this in a user
program, but what is it's equivalent for the kernel module?
3. Is there a HOWTO or example code somewhere I can read up on (for system
calls too, which might be a better way of doing things?) ? I've looked at
most kernel hacking stuff I think, but still can't find what I need.
I appreciate the help. Thanks.
Oliver.
Dept. of Physics,
National University of Ireland, Galway,
Galway,
Ireland.
Tel: +353 (0)91 524411 ext. 2716
Fax: +353 (0)91 750584
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/