Why cell phones don't get generic OS installers?
There are several reasons.
1) Unstable ABI and lack of code portability
This one partially has to do with why you can't boot a generic image but it has more to do with why it takes so long to get updates.
You might have heard of "stable ABI" before. GNU/Linux do not have a stable ABI. What this means is that the way drivers integrate into the kernel can (and usually does) change from version to version. So if you write a driver for one version of Android, it might not work on the next version, and has to be partially rewritten.
Project Treble fixed this to some degree by offering a stable ABI (which is to say, Google limited themselves with what changes they can make to the driver interfaces to ensure that one driver can work on multiple versions). Windows has a very stable ABI. That's why you can still sometimes install XP drivers on Windows 10. Here is an explanation on why GNU/Linux does not have a stable ABI.
2) Device Tree and hardware specific code
This has to do with how ARM works. ARM devices are typically not designed to be able to detect which hardware is present on the device when they boot. You therefore have to code exactly which hardware is present and pass that info to the kernel with a "device tree".
It is possible to design a device to look for hardware automatically at boot, if it's compliant with what's called ARM "Server Base Boot Requirements". Here is a great article about how it is being implemented in the Raspberry Pi.
Here is a page from ARM about it, and it goes over some of the things that needs to be done. As you can probably see, it requires collaboration from OS vendors, hardware vendors and OEMs, which is one of the reasons why it might be pretty hard to get working on phones.
Why does those articles mention "servers"? Because getting consumer electronics vendors like Qualcomm and Samsung to work with each other, to make their devices last longer so fewer devices are sold, is not exactly an easy task. It matters a lot for server vendors trying to sell to enterprise customers. So ARM has basically went "okay, we'll just focus on servers then". There is nothing technical preventing server base boot from working on phones though, if everyone worked together. Your device would still need some specific drivers though to function 100%. That brings me to...
3) Drivers
How do you install drivers on a phone? Usually, the drivers are baked into the Linux kernel on Android phones, so they are updated only when the OS is updated. Google has solved this limitation however by creating and implementing a way for drivers to be updated through the Play Store!
Here is an article about how it's now supported by some Snapdragons and some Mali GPUs. So this issue is slowly being solved, but I am not sure if drivers other than GPU drivers can be updated yet.
A side note about updates.
A new project called "project mainline" will help Android phones get updates quicker. What Google is doing is decoupling a lot of system modules from the OS itself and making them upgradable through the Play Store.
When it was first announced (Android 10) it was 12 different modules such as permission controller and media framework, and with Android 11 they are extending it to 20 modules.
These modules are delivered and updated with a new file format called APEX.
The reason why I bring this up is because APEX could be used for more than just updating some Google mandated core components. Google might be planning on making a generic Android OS, and then have vendors install their specific code through APEX modules.
Then there are a ton of other reasons why booting a generic OS image on a phone isn't possible today. Google is working on solving a lot of that but it takes time.
Please note that the article I just linked about AOSP being able to boot from mainline Linux 5.9 with just one patch has this rather big caveat:
QuoteFor being able to boot the mainline kernel "to [user interface] on AOSP/Master", for devices with fully upstream hardware support there is just one patch required.
That means that it only works on devices where the device makers have submitted drivers to the Linux kernel team and have them merged into the master branch. That's not an easy feat and I doubt many devices supports it. But with APEX modules that might not be a problem in the future!
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now