Please find my comments below.
On Sun, Nov 9, 2008 at 10:16 AM, Anders Rundgren
<anders....@telia.com> wrote:
>
> Pardon my ignorance of Linux programming but maybe you could give me a
> few hints based on the Android source?
>
> I want to create a service that runs as system (kernel) process.
Could you be a bit more specific?
What do you mean by a kernel process? Do you want your service to run
_inside_ the kernel? Or you only mean that it is a native system
service (e.g. written in C/C++, only one instance runs in the
background)
In general, unless you are adding support for a new hardware device,
new filesystem or network protocol, you should run your service as a
normal user space process. And even in the above cases, Android
provides a user space HAL layer to allow the creation of user space
drivers. So there is no need to run your service inside the kernel,
unless it is absolutely necessary.
> User-mode Java programs will comminicate with this service using a
> fairly complex API.
Android includes a nice inter-process communication mechanism called
Binder. Most parts of the system use this method to communicate,
including Java <-> Native Service communication.
>
> What are the recommended techniques for communication. I don' t think
> JNI is the answer since JNI runs in the context of the caller and this
> service must also only exists as one shared instance.
Using JNI and omitting Binder is also an option, but we would need
more information on what you want to achieve in order to give more
specific advice.
There are a few great video presentations from Google I/O here:
http://source.android.com/documentation
These provide a nice overview of how all the parts fit together.
Best Regards,
Gergely
It would be very nice if somebody from the Android team could elaborate a bit on what this means for
developers of for example security-critical applications. In particular:
Is this rather a feature of the processor, the actual Android G1 implementation, or a part of the
open source plot?
It sounds very cool that you could develop user-level secure containers that relied in some way on a
single kernel-mode driver.
Anders