Hacker News new | ask | show | jobs
by simonh 3172 days ago
We're all used to having desktop computers with generic x86 compatible processors and highly standardized internal interfaces and components, and compiling our software and installing it on any x86 computer we want.

Smartphones with ARM SOCs aren't like that because they aren't just a CPU, they also include a crapload of additional system components. Even SOCs like the Snapdragon within a specific model will offer many variations to the manufacturers. Outside the SOC itself, phone hardware is far less standardized than on a PC. You can't compile your Linux distro for ARM then install it on any smartphone, the kernel needs to be tailored to the specific phone. That's why even though unlocked Android phones are around it really takes the manufacturer themselves to be able to do something like this because only they have the detailed understanding of the platform and the resources. Otherwise, other people would be doing it.

5 comments

The Linux Device Tree infrastructure was created as a hardware description for hardware that cannot describe itself at runtime, which is mostly ARM SoCs. However that only works when hardware drivers are wired up to the device tree infrastrucure instead of being fully hardcoded. Given the usual bare minimum investment in software by most embedded hardware vendors, many/most drivers probably aren't.

Given a set of hardware with the same instruction set and drivers with full device tree support, one can now create one kernel for the whole set.

Device Tree Overlays come to rescue, but only if OEMs actually do care.

https://source.android.com/devices/architecture/dto/

The closest to a "generic" smartphone is probably the Mediatek reference platform(s), indeed found in various Chinese smartphones. Except for presence/absence of certain peripherals like sensors, those tend to be almost identical in hardware and software. Source is unfortunately not officially available but occasionally leaked along with (extensive) documentation, and there's a small community of developers who work on these cheap devices. As a bonus, they also tend to have a completely unlocked-by-default bootloader.

https://www.slashdata.co/blog/2013/05/the-mediatek-phenomeno...

In a perfect world manufacturers would give out this information, but it's understandable that they wouldn't (this doesn't mean that I don't think they should, but I know why they wouldn't). The issue is with "locked" bootloaders–the manufacturer is going through extra effort to make sure you can't run another operating system on your phone. This is inexcusable since it's not just a passive lack of helpfulness, it's an intent to make sure you can't have full control of your phone.
You can actually compile the userspace (which is more or less most of what is meant by a distro) and install it on pretty much anything. I do this a lot. The kernels have to be recompiled but that's trivially easy.
> the kernel needs to be tailored to the specific phone

Out of interest, would it be possible to operate an ARM SoC system like a generic x86 system, if drivers were upstreamed? Or is there too much SoC specific code?

The problem is that in many cases there's no nice automatic way to probe for devices, you just have to know the board config ahead of time. That's why device tree is so great, if the hardware manufacturers cooperate and upstream their code then you'll end up with something like the IBM PC.