The boot will display three screens:
- Linux kernel splash screen, static screen
- The static screen that appears during Init process startup
- Dynamic screens that occur during system service startup
The display of these images is different, but is eventually shown by framebuffer, each layer encapsulates the process it displays. Either way, they are rendered on a hardware device called a framebuffer (frame buffer, or FB).
Framebuffer is the abstraction of hardware display devices, shielding the underlying different display devices. The corresponding picture can be obtained by writing on the framebuffer.
First splash screen : show a Penguin
More direct use of framebuffer, through the final info->fbops->fb_imageblit (info, image); Invoking the display of the implementation screen, the callback function fb_imageblit is used to render the specified image on the specified frame buffer hardware device.
Second splash screen
Also relatively simple, call Load_565rle_image (Init_image_file) to display the screen, the final call framebuffer in the interface Fb_open to open the device file/dev/graphics/fb0, opened the device file/ After dev/graphics/fb0, we can output the contents of the file/initlogo.rle to the frame buffer hardware device.
A third splash screen
More complex, involving system service Surfaceflinger.
By the application bootanimation to be responsible for the display. Application Bootanimation is configured as a service in the startup script init.rc.
When the Surfaceflinger service starts, It notifies the INIT process to start the application bootanimation by modifying the value of the system property Ctl.start so that the third splash screen can be displayed, and the Activitymanagerservice service notifies SU when the system process starts up critical services The Rfaceflinger service modifies the value of the system property ctl.stop so that the INIT process can be notified to stop executing the application bootanimation, that is, to stop displaying a third splash screen.
Surfaceflinger::init () –> Startbootanim ()->property_set ("Ctl.start", "Bootanim");
Surfaceflinger::init () First initializes the device home screen and the OpenGL library, calls Startbootanim () after initialization is complete, calls Property_set in Startbootanim () (" Ctl.start "," Bootanim "); the init process receives a notification of a system property change, which is eventually handled by the function handle_property_set_fd in the init process, as the property changes.
The Bootanimation service is eventually called, and the service initializes OpenGL with EGL to prepare for the OpenGL display. Finally, the OpenGL interface is used to render the screen, through Glswapbuffers (Mdisplay, msurface) display.
Android system boot screen display process brief description