Johan Dams wrote:@bgat,
I'm sorry, but I disagree with you. Linux (the kernel) IS the operating system. All the other stuff is just user level stuff which might or might not be needed. For example, I've built several embedded system using the Linux kernel with all the functionality needed built into the kernel and one or two user level tasks which were started by directly replacing 'init'.
You are, of course, free to disagree with me. :-)
But you are actually supporting my point, and not yours: the Linux kernel doesn't accomplish much without support of user programs. You do not state that you have shipped Linux systems that have no user programs whatsoever.
For some implementations, it's true that the formalism of an "operating system" isn't necessary. Not everyone needs run-levels, package management, and so on. And when you choose to go that route, then you have simply a Linux kernel plus a few purpose-built user programs.
But Linux is still only the kernel, and those programs are taking the place of what would normally be something more resembling an operating system. This isn't a bad solution.
My quibbling here with terminology is important, because getting the functionality ascribed to the correct parts of the system greatly informs you as to where changes need to be made when necessary. You already realize this, clearly, because you understood that since you didn't need the functionality of /sbin/init, you could replace it. You didn't go hacking around in the Linux kernel looking for the CONFIG_RUNLEVEL option to turn off run-levels, for example.
Johan Dams wrote:
While Android can be considered an application framework, it's not really the best approach. It can not be denied that Android has a phone background, and as such, a lot of the classes are targeting phone applications. At this point, Google is hard at work to get Android usable on different types of devices such as tablets, probably by merging experiences with their Chrome OS in it some how.
The speculation in your latter sentence is telling, at least to me.
If you go look at the actual Android framework source code, you don't see very much there that's of utility only to cell phones. There are a few classes, sure, but the overwhelming majority are to deal with internal event management, GUI widgets, networking, and multimedia support. These functionalities are useful to many kinds of devices in addition to cell phones.
So, based on the observation that the overwhelming majority of classes that are implemented in the Android framework are not uniquely useful for cell phone systems, one must conclude that Android is not merely a cell phone framework.
Keep in mind that Android AOSP also travels along with a large stack of example programs, which includes a phone dialer. Those aren't part of the framework itself and thus don't bias Android's framework specialization in one way or another: they just demonstrate that the framework is useful in certain use cases.
As for Android being the "best approach" or not, that's too subjective a question to answer.
Johan Dams wrote:
Comparing Qt with Android as framework is, in my opinion, wrong. For starters, Qt is cross platform and does not rely on anything in the Linux kernel. I've personally ported Qt to, among others, L4 based systems without issues.
You do realize that Android is more cross-platform capable than Qt, right?
True, you can't (reasonably) use Android above anything other than an enhanced Linux kernel. But Android activity classes that have no native code (which correctly describes about 2/3 of the applications in the Google Play application store to date) can run without modification on ARM, MIPS, and x86 platforms. They don't even need to be recompiled.
With Qt, everything is native code. So you must at least recompile that code to run it on a foreign instruction set architecture. This isn't a negative of Qt, they just were solving a different problem than Android.
Johan Dams wrote:
"Android brings a LOT more to the situation than Qt does"
It also brings a lot more overhead than typically needed for embedded systems, and is harder to scale down. Try running Android with a minimal C library... Personally, I think Qt offers a lot more in the embedded sphere than Android does.
There really isn't such a thing as a "typical" embedded system. That's the joy of this business! :-)
Part of Android's "overhead" is in the fact that most of what the user sees is running in a java-like virtual machine. That does impose a performance hit (I've heard numbers as high as 30% compared to native code, but it's probably dependent on the workload used for the test). But that virtual environment allows Android to do interesting things regarding portability, power management, and security.
On balance, the tradeoff seems to work. Note that comparable iPhone devices, which run everything in native code, do not gain significantly longer battery life than Android devices. And although the user experience is quite different, ICS- and JB-based Android devices are comparable in the quality of the experience to iPhone devices.
So even though Android uses a VM instead of native code, which is the origin of the "overhead" that you find unpleasant, it doesn't seem to have made much difference to the end-user-observable characteristics that matter. So is that "overhead" really relevant? To the top-line requirements, it would seem not.
Android already has a minimal C runtime library, called bionic, which is far smaller than the glibc libraries typically paired with Qt (I haven't looked at bionic compared to uClibc, another library often paired with Qt). Some other ways that Qt comes up short compared to Android:
* Qt lacks a security model. It relies exclusively upon the security mechanisms of the underlying OS and kernel.
* Qt has no framework for application package management. How the application file enters and exits the system depends entirely upon the underlying OS mechanisms.
* Qt has no facilities for power control or awareness. Qt applications cannot natively request notification of impending platform suspend/resume events, nor can they deny requests for same.
* Qt doesn't have a comprehensive mechanism for re-use of classes in a Service-Oriented-Architecture kind-of way. To invoke a Qt-based object, you have to link the class code to your application at build time.
None of the above are true shortcomings of Qt: they just aren't problems that Qt was trying to solve. So if you reject Android in favor of Qt, you must also provide answers (and implementations) for the functions that Android brings but Qt doesn't.
Android isn't the end-all, be-all solution for embedded Linux. But it isn't easily dismissed, either.
b.g.