Hacker News new | ask | show | jobs
by lisivka 3482 days ago
Android is Linux.
4 comments

No. Android is a Java based OS that happens to use Linux as a kernel.

The majority of APIs are not exposed to NDK users, only to OEMs.

Google could release lets say Android 8 with another POSIX compliant kernel and the only apps that would notice are the ones using non official APIs.

Some Linux distros are already using non-linux kernels, e.g. GNU Debian/kFreeBSD, so Debian Linux is not Linux then.

Currently, Android is released using Linux kernel, ELF executable format, POSIX API's, and so on. There is no Android/kFreeBSD, nor Android/NT.

Android games can be launched on Linux using android libraries (not all, but some works pretty well, see: http://www.shashlik.io/showcases/ ).

Linux tools can be launched on Android systems (including X based tools, if X server is running).

For most of practical purposes, Android is Linux.

Nice try playing word games.

Debian user space isn't the same thing as a kernel.

Android kernel doesn't expose the same syscalls as a standard Linux.

I am really keen in having Google replacing Linux with Magenta, then we can carry on this discussion about what Android is supposed to be.

Currently, Android can be ran at vanilla kernel: http://forum.xda-developers.com/nexus-7-2013/general/android...
A forked version of it because Google didn't want to deal with "No." from the Linux maintainers when they were massacring the kernel into mobile ready form.
My distro uses patched version of Linux kernel too. Only very few brave souls are using vanilla kernel. So what?
The point is that distro patches are trivial compared to Android patches. Your distro will continue to work fine with a vanilla kernel unless it's using an esoteric configuration, and even with esoteric configurations it's relatively easy to include necessary patches to vanilla kernel.

Compiling and using a vanilla kernel instead of the distro one is straightforward and easy job for people with basic knowledge of source building. It's not a job for "very few brave souls". The reason many people use distro kernels is because they're good enough.

OTOH any consumer Android device requires millions of loc patching to a several years old version of Linux kernel just to boot.

AFAIK, vanilla kernel improved a lot in terms of functionality, so Android can work on vanilla kernel if code will be adapted to use these new APIs instead of Android homegrown APIs. Anyway, it's open source, so anybody can use Android patches without restriction. I see no problem here. Kernel version 4.4 is fresh enough for me: https://android.googlesource.com/kernel/common/+/android-4.4... .

BTW. I'm not sure if my distro (Fedora) will work with vanilla kernel without Redhat patches. There was times when it wasn't. I compiled kernel myself with my own patches and configuration in between 2001-2008.

> AFAIK, vanilla kernel improved a lot in terms of functionality, so Android can work on vanilla kernel if code will be adapted to use these new APIs instead of Android homegrown APIs. Anyway, it's open source, so anybody can use Android patches without restriction. I see no problem here. Kernel version 4.4 is fresh enough for me: https://android.googlesource.com/kernel/common/+/android-4.4.... .

What I'm trying to tell is it being possible doesn't mean it is practically possible.

Android specific API or subsystems are one part of it, then there is device specific patches. Kernel and patches being open source makes it possible to switch to a new kernel version but I've almost never seen that exercised. Few years ago the stats were that a typical consumer phone contains millions of line of patches on top of the selected upstream kernel version. It is not feasible to rebase a typical device to use a newer kernel version, and it really shows: I've seen only few phones that got a newer kernel version than it originally shipped with, switching from an ancient kernel version to only slightly newer but ancient kernel version.

> BTW. I'm not sure if my distro (Fedora) will work with vanilla kernel without Redhat patches. There was times when it wasn't. I compiled kernel myself with my own patches and configuration in between 2001-2008.

I'm pretty sure it'll. Linus himself uses Fedora and he likes his kernel pure vanilla :)

Currently, Android can be run on vanilla kernel: http://forum.xda-developers.com/nexus-7-2013/general/android...
At this point any Android device you buy is a fork of Linux.

And, frankly, if Google decided to swap out Linux for, say, DragonflyBSD, almost no-one would notice or care.

Isn't this true for desktop GNU/Linux too? I mean, last I checked, Debian kFreeBSD would be similar enough to Debian GNU/Linux as long as you don't drop to the console - the equivalent of which would be adb shell.
No, because you get full access to the OS APIs, so any application is exposed to the implementation specific behaviours of POSIX and OS specific syscalls and paths.

Where in Android, you just get Java and a tiny bit of C and C++.

Check the NDK documentation, Google provides a list of the set of APIs any NDK application is allowed to use.

Since many used to ignore that list, starting with Android 7, any app that uses unauthorised native libraries will get killed.

It's called tivoization: https://en.wikipedia.org/wiki/Tivoization .

Fork Android OSP and fix that. I'm sure that CyanogenMod will allow me to use native libraries as much as I want.

I am ok with it, as it means less C code exposed to the world.
I'm not sure of numbers but AFAIR both kfreebsd and khurd have 80% of packages in the archive and even getting to this level requires Linux compatibility hacks like procfs support
I think you mean GNU/Android.