Android init Process Overview

Source: Internet
Author: User

Init process, its program is located in the root file system, after Kernle self-initiated, wherein the start_kernel function to mount the root file system to/directory, in the rest_init function through the kernel_ Thread (Kernel_init, NULL, CLONE_FS | Clone_sighand); Build a kernel process with PID 1, and then call run_init_process to load the init program in the root filesystem of the boot partition to jump to the user space run. Init is the first process to run in a user space. Many of the system services were then forked by the Init process, with the main servicemanager,zygote. Zygote will fork other processes, mainly systerserver,launcher and other apk. Systermserver will start other system services in a multi-threaded manner, such as Powermanagerservice.

The main functions of the INIT process are as follows

    • Create a temporary file system directory and mount the dependent file system
    • Manage devices (via device file node)
    • Initializes the property system, which resembles the registry of the Windows system
    • Read bootloader to Kernel cmdline and deposit to the corresponding RO attribute
    • Setting SELinux-related policies
    • Parse rc file, perform corresponding action, including start dependent service
    • After entering the cycle, there are five actions
      • To execute a header command in the action list
      • Detects if a process in the system needs to be restarted
      • Listening to the property system, handling events that modify properties
      • Monitor chordered keyboard key input event, which can initiate dependent service, currently does not support
      • Recycling Zombie Processes

In addition, the UEVENTD and watchdog programs in the/sbin directory are soft links for/init programs, because there are many things similar to the three, so in order to facilitate the sharing of code to reduce the volume, similar to Busybox/toolbox, by passing over the argv parameters, to decide to run the Init , which one in the Ueventd,watchdog.

The UEVENTD daemon is responsible for monitoring hot-swappable events, similar to Udev.

The WATCHDOGD daemon is responsible for timing the "/dev/watchdog" device to write 1 kick dogs.

The above is the Android user space, the first running user process to do things, the services provided and the events being monitored.

Android init Process overview

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.