denysvitali / linux-on-pixel-c

Documentation on how to run a Linux Distro on the Google Pixel C (2015)
MIT License
60 stars 5 forks source link

Why Linux distros aren't ported to phones or tablets? #7

Open hhhh1338 opened 7 years ago

hhhh1338 commented 7 years ago

delete

Edit by @DenysVitali

The original question was the following (I don't know why the author decided to remove it):

Nice work man! With this project.

I wanted to know for quite some time why linux operating systems are not ported to phones or tablets with android like on they are on desktops and laptops. I know linux can run on various devices with different CPU architectures, I use linux daily, but why it is so hard to run some linux OS natively on android based device with linux kernel?

I know you can run linux on android with linux deploy, but not natively. Is it just because companies are not interested in porting linux to phones and tablets?

thx for reply

denysvitali commented 7 years ago

Why did you remove the question? It was interesting! I re-added the text you removed, there is nothing to be afraid of when asking such a nice question 😃

Why Linux operating systems are not ported to phones or tables (that normally ship) with Android like on the desktop and laptops

Well, there are many reasons behind that, and I don't think I still got them all, but here are a few:

Architecture

The most common Linux distros are made for i386 / amd64 (x86 / x64 processors), only a few of them decided to actively develop (or keep a branch) for mobile / other processors (namely, arm processors like the armv8 used in the Google Pixel C)
Whilst some distros are available for such processors, sometimes they are specifically made for specific devices (like the Raspberry Pi 3, which uses the same architecture). Unfortunately the mainline kernel doesn't yet contain the necessary Tegra (Tegra X1 is the chip used for both CPU and GPU, the same chip is used in the Nintendo Switch console) hacks / drivers. That's why Android keeps a Linux/Tegra repository, as well as other chip-specific repositories.

Wide diversity in the kernels

Unfortunately the Tegra chip isn't the only one that has got a custom repository with its own sources. This unfortunately is the result of having a ton of architectures / manufacturers and only a few upstreamed changes. Therefore, the mainline linux kernel (the one from where the various flavoured kernels come from) doesn't include these changes, thus distros don't have them. That's the same reason on why your newly-updated Android O device still rocks a 3.10 kernel, instead of a mainline 4.13 one.

Marketing problems

Unfortunately, as of today, there isn't really a good alternative to Android.
There were and are some goods project to "port" or at least have a Linux distro running on a mobile device. Unfortunately none of them, except for maybe PostmarketOS, made it to the public / had a great success. Apparently, as of today, no one cares about having a Linux distro running on a smartphone / tablet, or simply they're not used to since big companies develop their own OSs without making them Open Source / by using a mainline kernel. As of today, the only two "distros" I know of, that are quite compatible with any mobile device are Android and Chrome OS. Both of them still use Java for their apps, and don't provide a serious desktop experience as you would expect from any other distro

Then there is this project, which aims at providing a basic linux distro, based on Arch Linux for ARM, to be able to run anything on the powerful hardware of the Google Pixel C. Unfortunately there are still some problems and this goal may not be achieved without more help from the community / vendors / Google / whatever.

I use linux daily, but why it is so hard to run some linux OS natively on android based device with linux kernel?

For the previously exposed reasons 😞

I know you can run linux on android with linux deploy, but not natively. Is it just because companies are not interested in porting linux to phones and tablets?

I really suspect it is a marketing strategy. Unfortunately we still live in a "not-so-opensource world". I understand the reasons, but innovation isn't all made of proprietary software and licenses.
I hope in the future, we will be able to run anything on our OWN devices, without having to port / fix anything by ourself, but instead by simply dropping a CI generated img file from the distro providers.
This won't likely happen until the vendors won't start thinking outside the box by providing some help to the community: if the device can be used with anything - the sales of the HW itself will certainly blow up.

The only thing we can do is to hope this will change in the future...

If anyone wants to add something to this discussion, or argue with some of my points, go ahead, I'll keep this issue open since it is a nice discussion.

Have a wonderful day

denysvitali commented 7 years ago

I forgot to mention KDE Plasma-Mobile

denysvitali commented 7 years ago

You might be interested in Linux on Galaxy, it made the headlines today :)

The problem itself is with vendors, and with who produces the drivers (most of the time they are developed by the manufacture themselves).
Currently the kernel-mess situation w/ Android is getting on the right track thanks to Project Treble.

Most of the driver problems are caused by incompatibilities with most recent kernels. If all the changes made by Google (or any other manufacturer) on their own repositories were upstreamed (sent to the mainline repository), any future kernel version will be one config away - and thus the drivers compatibility is ensured.

Unfortunately this isn't the case. Every manufacturer works on their own kernel branch, and eventually pulls some changes from upstream, without contributing. This means that either you stick with their own kernels (which are a mess), or you try do port their changes to newer kernels.

mirh commented 7 years ago

Once upon a time linux distros weren't ported because there wwere many divergences between the-only-standardized-platform-on-this-earth (x86) and arm world.. That even if you had the most motivated developers, they'd have been already struggling to get even with the massive changes and reinvention of the wheel (e.g. switch to ION memory allocator, CMA, bluedroid..) (also, I'd arrive to say that in 2010, gnu/linux situation was as much desperate on desktops, as it is today on mobile) Situation is now at least conceptually better, but it's still mainly blocked by one thing if you ask me: graphics drivers.

There are two school of thoughts:

The first approach has been mostly hampered by tens of different takes on the matter across the years, finally and hopefully converged into Project Halium. It's also the only realistically viable one for older devices. The second is remotely a thing on just the newest devices (only with Adreno, Vivante, Mali and maybe VideoCore) and only if you haven't serious pretensions for now. Oh, also Tegra of course. Forget vulkan or full opengl compliancy though, at least until 2020 or so.

p.s. linux on galaxy is just inside an app. Useful, but thanks my ass.

clort81 commented 3 years ago

To provide updated info: there is linux on: Nokia N900 Motorola Droid4 Pinephone 64 I run some opengl games and apps on Droid4. This project has done nice work: https://maemo-leste.github.io/

mirh commented 3 years ago

There is actually linux on a fuckton more phones http://postmarketos.org/

Since 4 years ago, open gpu drivers have far more improved.