DIY Fully working Alpine Linux for Allwinner and Other ARM SOCs

From Alpine Linux
Revision as of 11:33, 10 April 2016 by Atlury (talk | contribs)

This is working progress - Till it completes - This is taken from multiple sources and is copyright of the respective authors albiet copied shamelessly.


Comprehensive Introduction

Why do we need alpine linux when there are so many xyz distros available? Well it is one the most lightweight platforms with hot swap support for SD-cards and USB devices. There are options for allocation of SD-card free space for application storage.

There are possibilities to completely upgrade a device running remotely with minimum downtime. Console logins are possible with USB null modems for field servicing. Most importantly you can be rest assured that it can survives against power cuts, restarts. For devices based without onboard mmc, especially working on sd-card its although the more important.

The philosophy of commit only when required, keeps the entire OS read-only and in-memory without touching the storage at all. Thus devices can survive for longer times without crash.

Arm devices unlike x86 dont come with bios in general. BIOS in x86 PCs is generally a firmware configuring and connecting the hardware to the operating system and it offers support for a variety of OS and supports new OS versions.

ARM use a different approach involving a boot loader for hardware configuration and operating system start-up. The boot loader is developed specifically for the application, adapted to one well-defined hardware configuration, one operating system and only one version of it which means you cannot probably use it for other SOCs without significant changes.

We here generally talk about Allwinner especially H3 SOCs but you could probably apply this philosophy to other SOCs. The nanopi m1, Orange pi pc and Orange pi lite are only around $10 making them great home servers, firewalls for lowest possible cost.

Any Linux cannot be started on an ARM Device without a small amount of machine specific code to initialise the system.

There are typically 4 stages involved in the ARM Device boot-up process

(stage 1) ROM - Reads from initialized persistent storage (selected by boot mode) SPL into internal Ram (stage 2) UBL/X-loader/U-boot SPL - SPL once loaded does additional setup and load from persistent storage the next stage u-boot into DDR RAM (stage 3) U-boot - U-boot once loaded continues the processor setup and reads the kernel into DDR (stage 4) Kernel - Once kernel is loaded, it boots linux and initializes the user run time environment

Each stage adds functionality. In here we are concerned with SD-Cards, and you are free apply this process to any other include NAND/USB etc. It is important to note that SPL, U-Boot and the Linux Kernel are all statically linked to start running at specific locations from a memory map defined by the CPU.

That memory map is nothing but a layout that defines where both internal memory and DDR are mapped to.

Data reported for 2014–2015, by region
Year Africa Americas Asia & Pacific Europe
2014 2,300 8,950 9,325 4,200
2015 2,725 9,200 8,850 4,775