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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
here is an example.
http://www.atnf.csiro.au/people/rgooch/linux/docs/porting-to-2.2.html
regards