Installing an Operating System: PC vs Android

Abhay Kshatriya
7 min readJan 10, 2021

--

To understand how one can install Android on a phone themselves, it would be quite helpful to compare the process with that of installing Windows or Linux on a computer.

Before we begin

Let’s understand some important keywords that I’ll be using in the rest of this blog.
Flashing:- In the tech world, it means overwriting existing firmware on flash memory. In Android as well, we could be either overwriting entire partitions or just modifying them.
Flashable zip:- A zip file that can be flashed onto your phone.

Getting ready to install

Let’s compare the setup required to install an OS.

Booting into ‘something else’

To install Windows or Linux, we create a ‘bootable’ USB drive (or DVD or any other external storage). We do this because we want to overwrite the existing OS and for that, we don’t want to be booted with the kernel of that existing OS. We want to be in a state/mode such that we can modify the partition of the OS (if we want to overwrite it) as well as mounting our target partition as re-writeable. For Windows, it’s usually the C: drive. Although we can write data to it, we cannot unmount the partition, change it’s size, etc. For Linux, we have the /boot partition with the kernel and the root partition (/) with the OS files. With a bootable USB, we boot using the kernel and the OS written in the USB drive instead of the one already present in the hard drive.

Many of the above points apply to Android as well. To install Android, we need to first make sure that we are not booted into the existing Android system. There are usually two other modes in which you can boot your Android: Recovery and Fastboot. In most phones, you can do this by holding down either Volume Up or Volume Down key when the phone is booting. Also, if you get into one of these modes by mistake, you can just hold the power key for 5–10 seconds and it will take you to the normal Android system. In these two modes, most of your phone’s hardware is not functional, only the display and the hardware buttons work.

Recovery

Recovery is an alternative mode your phone can boot into. The /recovery partition contains its own kernel as well as a small system in itself whose main function is to install updates, wipe data and wipe cache. Recovery is used even by your phone manufacturer to install OS updates because in Android the /system partition is mounted is ‘read-only’, i.e. it can’t be modified normally. In recovery, you can install your own Android system, a partial update to an existing system, or another ‘flashable’ zip file that makes small changes to the system (or in some rare cases, other partitions).

Fastboot

Fastboot is a bootloader mode in which you can flash, i.e. write to entire partitions on any device. In recovery, you can either use your device memory to select a file to flash, or you can use adb sideload utility to select a file from your PC (using a data cable). However, in fastboot mode, you must use your PC to flash a file, either using the fastboot command-like utility or using GUI tools provided by your phone manufacturer. You can also use the fastboot mode to unlock your phone’s bootloader (more on this below).

Custom Recovery

The default Android recovery is very bare-bones. You cannot use the touchscreen in this mode, you need to use the volume keys to navigate up or down and the power key to select an option. However, it is still functional and you don’t need to custom recovery just to make the touchscreen usable in this state. The main reason we don’t use this recovery to install our own Android OS is that this recovery only accepts those flashable zips which are ‘signed’ by your phone manufacturer. It will refuse to flash our Android flashable zips.

A typical recovery UI (source)

A custom recovery allows you to install flashable zips from any source. Often, they have a much more intuitive UI and accept touchscreen input. Popular custom recoveries are TWRP, OrangeFox Recovery Project, etc.

TWRP: a custom recovery. (source)

Installing a custom recovery on Android requires unlocking the bootloader of the phone. Unlocking the bootloader means you will be able to flash any file (other than those provided by your phone vendor) using fastboot. The process for doing this is different for every phone company.

Alright! We now have some idea of how we can install Android. Now the question is what about the file itself that we are about to install?

The installation file — also, the problem 😭

To install Windows or a Linux distribution, we just need to find the ‘iso’ file that would help us create a bootable USB. That’s it. All computers of the world, made by different vendors, with different hardware are supported by one OS setup file. The only thing that we have to look out for is that the architecture of the computer matches that of the setup file. Most of our personal computers are Intel x86 or x64 based.

For PC, operating systems aren’t handled by the computer vendors. The OS companies almost completely manage the OS software.

Now let’s come to Android.

For Android, Google or AOSP don’t install Android on your phone and don’t provide you with OS updates. It’s the phone vendor companies! They all have their own heavily modified version of AOSP. They tweak the UI, include their own versions of stock apps like Dialer, Camera, etc but much more importantly for us they add proprietary code to support the hardware of the phone. This is both inside the kernel and independent of it (called vendor blobs).

Hardware support is not an issue in PC and laptop components. If someone is making a hardware component for a PC, they want to make sure on their own that it is supported by the two main operating systems — Windows and Linux. They conform to standards and submit patches for the kernel.

This is unfortunately not the case for Android phones. Each phone model has its unique kernel, device configurations, and vendor blobs.

There is no single Android setup file that can be used on different phone models even of the same company.

All the phone vendors compile their modified Android from source and release different versions for different phone models. So if we want to install an Android custom ROM on our device, what do we do?

We can do two things. Either look for a custom ROM flashable zip made for our phone model on the internet, hoping a developer has compiled and released it. Or become the developer, i.e., compile that custom ROM ourselves. For now, I’ll assume we are doing the former. Doing the latter is far out of the scope of this blog.

I had missed this from the pros and cons list in the previous blog, but now that you have some context, you’ll understand this better. One huge disadvantage of installing custom ROMs is finding a custom ROM build for your device. Either you have to be lucky, or you take into consideration the custom ROM development activity of the device before buying it.

Where can you find custom ROM builds for your device? Good places to start this search is

  1. XDA Forums.
  2. Telegram groups and channels.
  3. Custom ROM websites.
XDA forum for the Redmi Note 7 Pro

The installation process

Alright, let’s assume that we have our custom recovery installed and we have arranged for a custom ROM file for our device. The installation instructions are usually mentioned on the XDA forum post or the site from which you downloaded it. It’s usually very easy! Just erase existing OS and data, and then flash the new OS file. This is very generalized, I recommend you to read the ROM’s release post.

Now let’s compare this to the installation process of Windows and Linux.

When we install Windows, the process is quite streamlined, we just need to select a partition of which we want to install the OS. Installing a Linux distribution is also the same process, but you have a lot of flexibility. Some GUI installers allow you to completely re-define the partition scheme of the hard drive. But wait.. isn’t Android also Linux-based? So shouldn’t we be able to do this in Android too?

Well.. no. In Android, this flexibility is only limited to the custom ROM developer. He/she can define the partition scheme in any way (although in most cases, they keep it the same way as it is structured by the phone vendor). Once they define the parameters, they can’t be changes for a custom ROM file. This also makes it easy to install for users. They don’t have to fret about how much space to give to the /system partition and how much to keep in /data.

If you’re feeling adventurous, you can feel free to explore the internet about how you can unlock the bootloader of your phone, explore the XDA forums of your device, read ROM posts, comment your doubts. Welcome to a new community!

Feel free to hit me up with questions about my blogs! Thank you for reading it all. 😁

--

--

Abhay Kshatriya

Android enthusiast. IIT grad in Computer Science and Engg