Building the kernel on the device would take a lot of time and most phones do not have the resources to do so (memory and CPU).
Adding a development environment (compiler, libs, etc.) to the install image would make the install image quite large.
Most manufacturers release incomplete code for their drivers. This makes a complete re-creation of them from source nearly impossible.
There is no repository for 3rd party binary device drivers (probably not "legal" to do so). Mobile phones often have a proprietary system UI framework which is never released as source code. The best you can do is either re-create your own (AOSP, CM, AOKP) or borrow the one from the stock firmware release (Touchwiz, Sense).
If your phone needs a "special" network driver, how are you going to transfer one over during your install if you don't already have one. (classic chicken vs egg scenario)
It is much easier to setup one generic build (on a PC or server), then have custom compile scripts for each device you intend to support. Also a lot easier to debug build issues on a full computer than trying to do so on a phone.
In the PC world, you have manufacturer's that have to release binary drivers to Apple/Microsoft for validation and make binary or source drivers available for Linux. In the mobile world, those processes do not exist.
Originally Posted by Dragnucs
I have this question in mind for a long time now. It gets confirmed every time a company decides to make a new mobile OS. Why is it so damn difficult to first install a mobile OS, but even more, why only people with some special knowledge and dedication can port an OS to a new mobile device?
I mean, on a computer we just have to select if we want i386/x86 or AMD/x86_64 installer what ever computer brand or other hardware we do have while on mobile, we need to have a very specific image for our device. We end up with hundreds if not thousands of images of the same version of the OS.
So my question is, why don't we have this work flow to install a mobile OS:
- Flash a generic image on the device
- Run it
- Auto compile a new kernel on the device itself
- Load generic drivers
- If generic drivers don't work, download specific ones
- Continue with installing other regular software
Technical answers are welcomed.