Thank you guys! Yes, I understand Android App are JAVA programs interpreted by Dalvik VM. But I m trying to find a relation between the App point of view (JAVA Apps, framework components, activities, services,..) vs. kernel point of view (processes and threads). For this job I have modified the Android emulator to provide me some additional information on a non intruseve way (no instrumentantions techniques on the kernel were used).
My objective is compare a linux + JAVA VM + User App with the Android framework proposal. To run a App. like a calculator, a standard linux the shell will will fork and make a execv syscall to load the VM to interprete the app's bytecode. Additional syscalls are App dependent. At the end, a sys_exit will be called to terminate the process. So on Android the "????" process will tell to the zygote process to sys_clone (thread, fork or vfork?) and then the new zygote process will load the "????" using the "????" syscall. Does this new zygote will load a new dalvik image or just use the forkerd copy of the parent? As far as I can see, no execve syscall is made, so I suposed a forked copy is used. Is ii right? Aditionally why binder threads are lauched? The only think I know about binder is it a new IPC mechanisms ported from BeOS, so they are kernel threads? does kernel thread uses the do_fork() kernel function too? I didn't found a sys_exit syscall for these threads. thanks in advance! On 7 maio, 18:02, Dianne Hackborn <[email protected]> wrote: > 2-3 threads are usually created for the binder IPC thread pool. > > On Fri, May 7, 2010 at 4:11 AM, Hristo Bojinov <[email protected]>wrote: > > > > > The Calculator is a Dalvik /"Java"/ app. All those get forked off of > > zygote for performance reasons (zygote is an empty VM instance, ready > > to spawn/fork off real apps; it has many libraries preloaded in its > > address space, etc.). > > >http://developer.android.com/reference/dalvik/system/Zygote.html > > > Not sure why multiple threads though. > > > --Hristo > > > On May 6, 12:15 pm, Vesmar <[email protected]> wrote: > > > Hi all, > > > > Im studing how Android creates new processes and found two scenarios. > > > > when I am running native programs on a terminal on Android (ps, ls, > > > mkdir, etc) all programs are created in the standard way, that is, > > > fork (clone) and execve system calls. The process name on task struct > > > is set by the putname() on the sys_execve syscall handler. > > > > But when I run a Android application such the Calculator, for example, > > > i found 6 new tasks (processes or threads) forked by zygote. In fact, > > > zygote forks just one process and this new process spawns 4 new > > > processes and set their names using set_task_comm() and the last one > > > forks an aditional process. And at the last set_task_comm() is called > > > for the first forked process from zygote. > > > > So there are two ways for set the task->comm field for a process: The > > > standard way (using execve and putname()) and a new way used by > > > Android using sys_prctl who calls set_task_comm(). > > > > Does anyone have more information on how processes are created on > > > Android and why a App needs all theis tasks forked by zygote? Why > > > execve is not used and what is used instead? > > > > I m using Android for Mips using the Arriba QEMU emulator as my > > > experimentation platform. > > > > Thanks, > > > > -- > > > unsubscribe: > > > [email protected]<android-kernel%[email protected]> > > > website:http://groups.google.com/group/android-kernel > > > -- > > unsubscribe: > > [email protected]<android-kernel%[email protected]> > > website:http://groups.google.com/group/android-kernel > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > unsubscribe: [email protected] > website:http://groups.google.com/group/android-kernel -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
