System server query

15 views
Skip to first unread message

Nitin Mahajan

unread,
Aug 23, 2011, 11:10:48 AM8/23/11
to android-d...@googlegroups.com, android-...@googlegroups.com
Hi!

I was just going through the code to understand how the system server
is started.

I have some query here. Why there is a LOGI saying LOGI("System
server: starting Android runtime.\n"); in file System_init.cpp?
We aren't actually starting the Android runtime here. We are just
starting the native services and the Android java services.

1. Is this understanding of mine correct?

As per my understanding the AndroidRuntime has been already started in
Zygote and
when we did a fork to start system server, the AndroidRuntime object
which was created on stack, is available to the child process from
Zygote's address space itself.

2. Is this understanding of mine correct?


Thanks in advance

regards
-Nitin

Nigel Sheridan-Smith

unread,
Aug 23, 2011, 6:32:26 PM8/23/11
to android-...@googlegroups.com
Hi Nitin,

System server is started by init, the first system process.

It starts the Dalvik VM (see /frameworks/base/cmds/system_server/library) and Zygote in two phases - it calls init1() and init2() in android/os/Zygote.java (from my memory). Zygote then uses JNI to fork itself by calling back into the Android C++ libraries.

Cheers,

Nigel


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


freakingtux

unread,
Aug 24, 2011, 4:30:54 PM8/24/11
to android-...@googlegroups.com, android-d...@googlegroups.com
Hi


On Tuesday, August 23, 2011 5:10:48 PM UTC+2, Nitin wrote:
Hi!

I was just going through the code to understand how the system server
is started.


Greetings
Reply all
Reply to author
Forward
0 new messages