Link to home
Start Free TrialLog in
Avatar of namus
namus

asked on

userspace to kernel interraction

i want to open a file in user space & want to copy its contents to the kernel space module. & i wanto kno the reverse procedure too...

actually my ioctl call wud activate my module & then the module reads the file & does some work... & at last has to write the file back to the user space...

i found out that it canb done by copy_to_user & etc... functions... but have no time for experimentation now..

& how to manage memory in kernel space ... i mean to allocate buffers & manipulate as done in user space with malloc.

cud i get some code that gets this work done... coz im in areal hurry, so if i get some code... i wud b indebted... plz
thx
namus
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manish_regmi
manish_regmi

Rubini's book which can be found online has examples that you can build and try out.
http://www.xml.com/ldd/chapter/book/

See chapter 5, it covers the basics with regards to ioctl, Blocking I/O, Asynchronous Notification, etc.

Cheers