Let's look at Android startup in IT process.
When we talk about any process, we must first look at the steps of Android system, startup process.
So here is a timeline diagram of Android boot process.
So in this diagram, the first step is the power on power own and system startup.
When the power is pressed, the boot chip code starts executing from a predefined place and this is
basically hardcoded in the ROM.
This loads the bootloader into the RAM and executes it.
So whenever we press the power button in a mobile device, it starts executing from predefined address
which is hardcoded in the row and this will load the bootloader into the RAM and executes it.
The bootloader is a small program which runs before the operating system starts running.
Its main function is to start the system OS.
So in our case this bootloader will start the Linux kernel.
So as we know, Android is based on Linux kernel.
So the bootloader is basically responsible for starting the Linux kernel.
So once the Linux kernel starts, it sets the protected memory cache and it loads all the system drivers
like the audio, video, graphics drivers, all sorts of drivers.
When the kernel finishes setting up the system looks for the RC file.
So there is a file and configuration file in it file.
So it will first look for init files in the system files and then it starts the root process or the
first process in the system which is called the init process.
So in this session we are going to dig deeper into the process.
We'll see what all actions are being performed in this process and we'll have a code walkthrough and
see which files or which modules are responsible for this init process.
In the later tutorials we will cover zygote system, server system, UI and launcher.
The process mainly does four things.
So the first step is to create the folders and mount the device.
So in the first step it basically creates the file system of Android.
In the second step, it creates the ACL index policies.
So in case if you don't know what ACL index is, it's still index stands for security and hence Linux.
ACL index is a set of rules to improve the security of your system.
So I have created a different tutorial for SELinux, so you will learn about that later.
So in the third step it will initialize and start the property service.
So Android maintains a set of properties.
It is very similar to the registry entry in Windows.
So you might have seen the registry in Windows right where we have a property and value pair.
Android also does something very similar.
So in Android there is a set of properties which has a key value property name and the value and this
property and value are used in a lot of places in Android.
By using ADB, we can get the list of these properties and their values.
I'll show you how to do that.
And in the fourth step we'll pass the INI dot RC configuration file and start the zygote process.
So we'll cover the zygote process in a separate tutorial.
So in this tutorial we will see how the zygote process is getting started.
Let's look at the modules which implements the INI process in Android so you can find most of the init
modules within this folder.
So it is within aosp system core in.
Our bookmark the most important modules.
So here we have the main TCP, which consists of a main method.
Within this method you could find three methods which are pretty important.
So the first one is first stage main.
The first stage main method is mainly responsible for creating the directories and mounting the devices.
So we can see that it's mainly mounting the devices and creating the directories here.
Second, we have the setup SELinux method.
So within setup, a select method basically loads all the SELinux related policies and it sets the enforcement
of Linux and it will set the Linux enforcement as well.
So you will learn in detail about Linux in a later tutorial.
But for now, just keep in mind that Linux is a set of rules to enhance the security of your system.
The third method within Main is second stage main.
So the second stage main is implemented in any TCP within any TCP IP.
The main method which we need to look at is property init.
So the property init basically initializes the properties within the system.
So in Android there are a lot of properties which are initiated at the startup.
So it is very similar to the Windows Registry property value pair.
I'll show you how we can see the properties.
Let me open up the emulator.
So to see the properties which are initialized in the emulator, you need to go to the shell and get
probed.
So this lists all the properties which are set within the system.
These properties are used in many places.
So for example, arrow dot dot product.
So this is the product name of this.
You can see these in the settings.
If you go to settings, you can see many of these properties listed here.
Like for example, if you go to about emulated device.
So here you can see the build number, right?
So the build number is built from these build properties.
So it's basically a concatenation of all these.
Similarly, all these properties are used in many, many places within the within the OS while booting
up and also after booting up, it's used for many purposes.
Even you can have a runtime resource overlay based on these properties.
So the property in it basically loads all the properties and then we have the init zygote dot rc file.
So the init process basically reads this RC file and it starts the zygote process.
So in need RC is a configuration file with scripts written in an android init language.
So it mainly consists of five types of statements, like some action statements, commands, services,
options and imports.
So it's a very simple language.
So you can google it to find more information about this init language.
So this init dot rc file is actually passed by the password cpp within the init folder and it will start
the zygote process.
So if you want to debug something in this init process and you can always have a look at the logcat
for this tag.
So init.
So all the.
Activities done in the unit will be tagged with this unit tag so you can search for this and find the
different tasks performed during the unit process.
So I hope you have got a high level of view of what's happening in the unit process.
Thank you.