segunda-feira, 16 de julho de 2018

Building goldfish kernel for Android emulator

[UNDER CONSTRUCTION]

We are going to prepare an environment for next tutorials about Linux Kernel. I choose Android emulator platform because it is familiar to me, and also very convenient when using Android debugging environment such as ADB.
It is a simple task when you are already familiar to Android build environment.

The key point is to match proper CPU architecture, Android system image and Kernel versions. Let's start with current highest Android API level at this moment. Then I checked what is proper Kernel version for selected Android API level. It is also more convenient to run Android simulator over x86 architecture due to performance. But we can also test ARM and other archs.

Combination that works for me: Android API Level 28 (P) x86_64 + Kernel 4.4 x86_64.

Important mention to reference which gave me hints: https://gist.github.com/yan12125/78a9004acb1bed5faf2ffd442163e2ef.

Get cross-compiler toolchain

Get pre-build GCC to cross-compile Kernel source to Android x86 architecture: Reference: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/.

Get Android kernel source code

Get Android Kernel source code. goldfish project is the name of Android kernel source code for emulator.
We are going to use branch for Kernel version 4.4.
Reference: https://android.googlesource.com/kernel/goldfish/.

Build Android kernel for emulator (x86_64_ranchu)


Running Android emulator with custom kernel (Linux/Windows)

Checking that our custom kernel is running:

Nenhum comentário:

Postar um comentário

Char device driver example

[UNDER CONSTRUCTION]