Linux MISC Device

Source: Internet
Author: User

Refer:

Http://longer.spaces.eepw.com.cn/articles/article/item/60415

Http://imganquan.org/blog? P = 350

I found it online and summarized it as follows:

Miscellaneous device (Misc device)
Miscellaneous devices are also a device driver used in embedded systems. There is a miscdevice. h file in the include/Linux directory of the Linux kernel. You need to define your own MISC device from the device here. The reason is that these character devices do not conform to the predefined category of character devices. All these devices use the No. 10, which is attributed to MISC device. In fact, misc_register calls register_chrdev () with the primary number 10.

That is to say, the MISC device is actually a special character device.

 

Character Device)

When you use register_chrdev (led_major, device_name, & dev_fops) to register a character device driver, if multiple devices use this function to register the driver, led_major cannot be the same, otherwise, several devices cannot be registered (I have verified ). If the module uses this method to register and the value of led_major is 0 (the primary device number is automatically allocated), the allocated primary device number and secondary device number will be displayed on the terminal when the module is loaded using the insmod command, create a node in the/dev directory. For example, if the number of the device LEDs is 253 and 0, then create a node: mknod LEDs C 253. When you use register_chrdev (led_major, device_name, & dev_fops) to register a driver for a character device, you must manually create a node. Otherwise, the device cannot be opened in the application.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/lanmanck/archive/2009/10/22/4713978.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.