Linux OS kernel driver initialization sequence Adjustment

Source: Internet
Author: User
Linux operating system kernel driver initialization sequence adjustment-general Linux technology-Linux programming and kernel information, the following is a detailed description. We need to use the API provided by another driver (I2C) When making a driver today. We encountered a dependency problem during kernel initialization.

My driver runs before I2C initialization, And the API provided by I2C is still unavailable. I checked a lot of information. Some people on the Internet said that the Starting sequence of all drivers using the module_init macro is uncertain (I have not found any authoritative information ).

All the _ init functions are in the Section. initcall. init also saves a function pointer. during initialization, the kernel will call these _ init function pointers through these function pointers. After the initialization is complete, release the entire init section (including. init. text ,. initcall. init ).

Note that the call sequence of these functions during kernel Initialization is only related to the order of the function pointers here, and 1) the functions themselves are described in. init. the order in the text section is irrelevant. In the 2.4 kernel, the order of these function pointers is also related to the order of links and is uncertain. In the 2.6 kernel, The initcall. init segments are further divided into seven sub-segments:
QUOTE:
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.