Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have a doubt on how the data is written and read to and from the character device . i need the complete sequence in few words of which structures are involved and which function is involved untill data is written to the actual hardware
let us assume there is a character device and this is not memory mapped in the kernel space
so my flow would be like this
ioctl(CMD=WRITE) --- system call --- ioctl(CMD=WRITE)
userspace ------------------------->kernelspace------------->
i have show a diagram above which says userspace ioctl call with cmd=WRITE executes kernel space ioctl(CMD=WRITE) present in file_operations structure. after this i wanted to know what are the functions executed so that the data is actually written on the hardware device.
can any one reply to me with your answer.
that is not what i was looking at anisha basically how the interaction happen with the character device the one you shown is just a layer above it but i wanted to know what happens when you want read write on the device
every device in the kernel space is represented by a struct device and then it has a struct device_driver and then there is a struct bus_driver now i wanted to know how the file_operations structure communicates with this struct device_driver and then struct bus_driver to write the data on the character device .
I don't know whether I have understood you clearly or not but if you want to know the communications between these internal structures of the device drivers then I think you'll have to read definitions of those functions which are responsible for the same.
i mean view it from a hardware perspective that is not mapped using ioremap for that how a file_operations structure communicates with the struct device
first let me make my self clear do you agree every char device at the low level is represented my struct device yes or no.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.