AOSP Foundations
2 min read

LK and U-Boot

A brief look at alternative and legacy open-source bootloader implementations used in the Android ecosystem.

While modern flagship smartphones use highly proprietary, complex UEFI-based bootloaders (like Qualcomm's XBL/ABL), many development boards, IoT devices, and older Android smartphones rely on lighter, open-source bootloader implementations.

The two most famous open-source bootloaders in the Android ecosystem are LK and U-Boot.

Little Kernel (LK)

LK (Little Kernel) is an open-source embedded operating system created by Google and Qualcomm engineers. It is extremely small, incredibly fast, and heavily utilized in older generation devices as the primary Android Bootloader.

Key Features of LK

  • Speed: It is meticulously designed to initialize hardware and load the Linux kernel in a fraction of a second.
  • Fastboot Native: LK contains a highly robust, native C implementation of the Fastboot protocol. If you are flashing partitions on an older Nexus device, you are almost certainly talking to LK.
  • Simplicity: It provides a simple threading model and basic hardware drivers (like USB and display), making it very easy for hobbyists and hardware engineers to modify for custom development boards.

U-Boot (Das U-Boot)

U-Boot is the undisputed king of embedded Linux bootloaders. While rarely used on commercial smartphones, it is the de facto standard for almost every ARM-based single-board computer (like the Raspberry Pi or BeagleBone) that runs Android.

Why U-Boot?

  • Massive Hardware Support: U-Boot has built-in open-source drivers for tens of thousands of different embedded processors, network chips, and display panels.
  • Flexibility: It features a powerful, interactive command-line interface over a serial connection. Before booting the kernel, you can interrupt U-Boot, drop into a shell, and manually read from network servers (TFTP), test RAM, or modify kernel boot parameters on the fly.
  • Android Support: Modern versions of U-Boot include specific commands (like boota) designed to parse Android boot.img headers, load the kernel, and initiate the Android Verified Boot (AVB) sequence.
# Example of interacting with the U-Boot serial console to boot an Android kernel
=> setenv bootargs 'console=ttyS0,115200 androidboot.hardware=myboard'
=> boota 0x80000000

If you are porting Android to a custom industrial device or a hobbyist SBC, you will spend a significant amount of time configuring and compiling U-Boot.