EmbLogic's Blog

SOME BASIC QUESTIONS WHEN WE START WITH CHARACTER DRIVER .DO YOU HAVE ANSWERS ?

Working of character driver :see diagram & also see some queries of character driver.http://www.opensourceforu.com/wp-content/uploads/2011/02/figure_7_character_driver_overview.png





The above diagram show how the character driver works in linux , user space to kernel space .

but when we implementing the driver there are many issues are find from inserting a driver to Removing the driver.

some are following:

  1. why we use use sculldev because only cdev work as device of application ?
  2. why we use container_of function if it,s only use of access the cdev address then what is its internal operations and how it work ?
  3. we use kmalloc for providing the memory to sculldev if we want to print the value of sculldev which is garbage then that show errors : the variable is struct sculldev but we print value with %c ,there have no effect if we use type casting , what is solution ?
  4. we use memset for fill the null values in sculldev how we can check sculldev filled with null ?
  5. In cleanup function we use kfree ,that means free the memory of sculldev ,how we can check memory is totally free ,i mean how we can see that ?
  6.  The return type of unregister_chrdev_region is void ,if we want check our device is unregistered sucessfully using printk statement.
  7. what is motive of using cdev_del function because we already use rmmod,unregister function and after that cdev_del function ,what main purpose of this function ,we can see the output of this function.
  8. what fundamentals of struct file and why we make the  struct file_operations because that is already included in header file which is fs.h and cdev.h .

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>