1. Boot the kernel after loading
2. Execution of init process----> Device initialization workA1. Read Inic.rc A2. Start the zygote process----> The process is the incubator B1 for all processes. Initializes the Dalvik virtual machine B2. Start the System_server process C1. Send commands through the socket to the zygote process B3. Received command fork itself C1. Create an Dalvik virtual machine instance to execute the application entry function
Zygote provides 3 ways to create a process fork () creates a zygote process forkandspecialize () creates a non-zygote process forksystemserver () creates a system service process
Dalvik Virtual Machine Execution Program flow:[Virtual machine thread], [loader class], [Verify byte code], [Find main class], [Execute byte stream], [end]
1. First completion of class loading through the Loadclassfromdex () function each class successfully resolves with a classobject type of data structure that exists with the runtime Environment 2. Use the Gdvm.loadedclasses Global hash table to store queries for all load Classes 3. The bytecode validator uses the Dvmverifycodeflow () function to verify the loaded code 4. Call Findclass () Find and load the Main method Class 5. Call the Dvminterpret () function to initialize the interpreter and execute the byte stream
The JIT for Dalvik virtual machines (just in time compilation) is the mainstream of JIT with 2 bytecode compilation methods 1. Method: Compile 2 as a function or a method. Trace mode: A branch of code that is compiled in trace for frequent execution caches
From for notes (Wiz)
2. Android System Boot Process