Re: Basic question about device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Dhanashri Bhate wrote:

Thanks MAndeep, got it..
but one more question :)
so when the kernel sees any device request it will send it to proper driver function with the adress in user area. and the buffer in kernel space, is the one we kalloc during init_module. is that right?



The kernel is not aware whether it is a device reqeust or something else all the user passes in a system call like read(), is the file descriptor, the process issuing this call , has an array of file_descriptor 's maintained in the struct task_struct for the process in kernel space . the fd you pass it using the sys call is just an index into this array which would give the kernel a struct *file structure ultimately , which would hold file operations structure i.e the one you defined in your module . hope i was clear and more importantly right ;-) . I'am not sure about the exact (name) details of the structures , the mechanism described above does exist though for 2.4 kernel.


cheers,
Amith


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux