Create a device node in the Android system

Source: Internet
Author: User

I checked a lot of information and many people mistakenly thought it was the/dev/yourdevice created by the kernel.

In the latest kernel, this statement is incorrect. In fact, the kernel is only responsible for creating a large number of directories and files in/sys,

The real device nodes are created in the user space.

In the Android system, the INIT process is responsible for processing such uevent events. If it is an "add" device event, init will create corresponding nodes under/dev /.

For specific code, see system/CORE/init/devices. C: handle_device_event-> make_device

Node users, groups, and permissions can all be customized in devperms.

 

For Linux systems, I think it should be implemented by udev.

 

For non-android systems, it should be mdev

 

In fact, the key to who will handle it depends on the method in which the application layer processes the uevent sent by the kernel, whether to listen to the socket or set

/Proc/sys/kernel/hotplug command file

 

 

 

 

 

Related Article

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.