Wednesday, 14 March 2012

Zygote


                                                                     
It is the important process in the system appear to be zygote (Which application process is binary), and runtime. These are both started by the init process. The following fragment of init.rc is relevant. It is important to note that these services auto started to noted that these services have the autostart 1 attribute, indicating they are restarted if they quit.

Zygote {
exec/system/bin/app_process
args {
0 – zygote
1 /system/bin
2 – zygote
}
autostart 1
}
runtime {
exec/system/bin/runtime
autostart 1  }
if we go kill zygote process and runtime process something interesting happens. Firstly the order of the process kills himself, and the whole system seems to restart himself , changing the ramdisk space.
We wanted to get a bit more control of what things are started up when. To do this I need to modify the init.rc file. To do this we will first extracted the ramdisk to system file so that I can modify ram disk image. After  this we simply commented out the line from init.rc . Then we can recreate it (gnucpio –I –t –F../ramdisk.img | gnucpio –o –H newc -0../rootfs.img)
We can then use emulator –ramdisk option to load our new ramdisk.
Now we can start things up manually. First we started up zygote process. As # app_process – zygote/system/bin/ --zygote . When we do that there is not output in console, or on the LCD . Next when we start runtime process(#runtime), and now things  start to happen.




No comments:

Post a Comment