Wednesday 15 April 2020

Tiny Core Linux

Intro

Recently we have looked at Linux in a variety of ways.  Buildroot has been used to tailor and build a distribution, we have compiled Linux to run on the Atlas board, we have created many different systems on Qemu.  Along the way I came across Tiny Core Linux (TCL)  which provides a Linux system in 11MB. Kudos to Robert Shingledecker who developed it in 2008 and those who have supported it since then.  It has an extensive user manual and an active forum.

Core System

The simplest variant of TCL is called Core.  This comprises two files a recent linux kernel (5.4.3) and core.gz a compressed file system.  It is available as an ISO.  I could quickly boot from the iso file in Qemu and bring up a small system.  It looks like linux, feels like linux and quacks like linux.

PiCore

A version of the system has been provided to run on RPi.  I simply copied the iso to an SD card and booted on my RPI 1B.  It comes complete with network access and SSH.  Initially I connected a screen and keyboard but it was soon reliable enough to run headless.

TinyCore

The next step is to setup a windows manager FLWM (fast light windows manager) so that we have a working X system.  Again we have a small amount of software.  Using X under Qemu was a bit of a pain and I don't want to use an RPi like this so I installed on Roy's old laptop.  A 2GB partition is vast overkill for a system which is now about 50MB but it enabled me to run some variants.

Linux Structure

The irresistable attraction of a tiny system is that it is small enough to have a crack at understanding the overall makeup of linux.  The TCL manual was a big help as it describes the boot process initiated by the kernel which lays out the file system, sets up devices and hands over to init which is part of busybox.  Init provides utilities for all the processes running on the system and makes requests to the kernel where necessary.  Applications / programs can be added as necessary but aren't essential for a running system.  TCL minimises the ones provided by default but has a good variety of extensions available for download and install.
So we really just have the kernel, Busybox binaries, some libraries and a few start up scripts which make up our system.  As the icing on the cake Busybox has a link to Fabrice Ballards, linux in a browser running busybox.

No comments:

Post a Comment