Kernel in Action
Hi 🙂 You may be one of those Android developers or users who enjoy divergent applications available on the market and may be playing with different applications all day long, but actually what you were doing is playing with the kernel. 🙂 Um just kidding Kernel is common to all Oss. Kernel acts as a bridge between software and hardware. For each action you make on the device, the application sends a request to the kernel in the form of a system call. Kernel will communicate with hardware through device drivers, to do what you want it to do.
In developer perspective, let’s assume we created a simple hello world. Android applications do not directly interact with the kernel anyway. Hence what we do is calling an API method available in the Android Application Framework. This API method call will, then make a system call on the kernel. Ultimately kernel will get the job done for you. 🙂 What if there is no such thing called “Kernel” there? Then the poor developer will have to write code for each event for every single piece of hardware in the device.
What is a Kernel?
At the very basic level what controls your mobile device is the operating system (OS). All operating systems have a kernel, which is known as the most important or the central part of the OS. Kernel itself is a program. What it does is controlling the hardware of the device (Ex. Changes to brightness, volume level) and manages the system resources (Ex. Power Management, Memory Management, I/O management, process management). When the system boots kernel program loads to the RAM and starts providing its facilities.
Android Kernel:
Android OS has a Linux kernel. But Android kernel and Linux kernel are not exactly the same. Android uses a modified version of Linux kernel to support the device architecture, since Android is a mobile device and not a PC. When considering a mobile device there are hardware imitations as well as new features comparing to a desktop PC. Ex. Drivers need for a mobile device small keypads, 3G/4G cards, SIM cards, etc.
Following are some new changes on Android Kernel which are not available in Linux Kernel.
- IPC Binder : Allow processes to provide services to other processes through inter process communication.
- Ashmem (Anonymous Shared MEMory)
- pmem
- logger
- wakelocks
- Android Debug Bridge
- RAM console and Log Device
- Changes to YAFFS2 (Yet Another Flash File Systems 2nd Edition) files
- Changes to Bluetooth files, Scheduler, Power Management
- Keypad light controls, management to TCP networking.
You can find different kernel sources available at the Google repository: Here https://android.googlesource.com/?format=HTML
Here you can start building the android kernel source:
How to Build Android Kernel from source
Thank You 🙂