1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Booting A Modern Linux Desktop In Just ~200MB

Tomas Matejicek

Published on 26 December 2012
Written by Tomas Matejicek
Page 1 of 3 - 10 Comments

Unlike many of the Linux distributions out there today that are little more than minor user-facing changes to Ubuntu or another tier-one Linux operating system, Slax for the past many years has followed its own dance. Slax, a LiveCD Linux distribution built around Slackware, is very lightweight and calls itself a "pocket operating system" as with the most recent release it can fit a full Linux OS with the KDE4 desktop in about 200MB. Slax is also intended to be quite easy for others to modify and create custom images via Slackware packages and Slax modules. The recent Slax 7.0 release was the first update for the open-source operating system in several years. For those interested in knowing how this very lightweight and customizable operating system can work so efficiently, Tomáš Matejícek, the Slax creator, has written an exclusive Phoronix article about the process.

What Is Slax

Slax is a Live operating system based on Linux. Live means it runs from an external media without any need for permanent installation. Slax boots from USB mass storage devices such as Flash Drive keys as well as from regular hard drives and CD/DVD discs.

Slax Directory Structure

All Slax data files are located on the boot media in a single directory. It is no surprise that the name of that directory is 'slax'. All the magic happens inside. Here is an overview of simplified directory structure; directories are red, some interesting files are mentioned as well, using italic:

Booting The Linux Kernel

When your computer's BIOS boots Slax, it actually just runs SYSLINUX boot loader. The boot loader itself is stored either in file isolinux.bin or ldlinux.sys, depending on your boot media - CD/DVD uses isolinux.bin, USB disk or hard drive uses ldlinux.sys.

As soon as the SYSLINUX boot loader is executed, it learns what to do next from its configuration file (you guessed it) syslinux.cfg. In Slax, this configuration file contains instructions to show some cool boot logo and optionally provide boot menu if the user hits a key before timeout. When the timeout counter reaches zero or the user exited boot menu, SYSLINUX boot loader loads two files into memory: vmlinuz (Linux kernel) and initrfs.img (base root filesystem). The progress is indicated by continuous stream of dots printed on screen. Once the files are loaded, the vmlinuz binary is executed to start the Linux kernel.

Pre-Init

Under normal conditions (when a standard Linux distribution is starting from a hard drive), the Linux kernel would mount the root filesystem from the hard drive and /sbin/init would be executed as the main process which takes care of system startup. In Slax, the situation is different - there is no hard drive to mount the root filesystem from, yet the kernel surely needs some init process to be started. For that purpose, Slax carries a base filesystem in the initrfs.img file - it is a compressed CPIO archive with some directories and files inside, including core Linux tools (commands) and the desired init.

So after the Linux kernel has successfully initialized and has a full control of your computer, its last task is to find the mentioned CPIO archive in memory (it was loaded there from file initrfs.img by syslinux boot loader as you surely remember), extract it (into a memory area which acts as a temporary root filesystem, called initramfs) and execute the temporary /init process from there.

<< Previous Page
1
Latest Linux Hardware Reviews
  1. A Walkthrough Of The New 32 System Open-Source Linux Benchmarking Test Farm
  2. Habey MITX-6771: Mini-ITX Board With Quad-Core J1900 Bay Trail
  3. OCZ Vector 150 SSD On Linux
  4. Noctua i4 CPU Cooler: Great For Cooling High-End LGA-2011v3 CPUs
Latest Linux Articles
  1. AMD Kaveri: Open-Source Radeon Gallium3D vs. Catalyst 14.12 Omega Driver
  2. 12-Way AMD Catalyst 14.12 vs. NVIDIA 346 Series Linux GPU Comparison
  3. AMD Catalyst 14.12 Omega Driver Brings Mixed Results For Linux Users
  4. 6-Way Winter 2014 Linux Distribution Comparison
Latest Linux News
  1. X.Org Server 1.16.3 Released To Fix Security Issues
  2. Linux 3.19 Merge Window Closes Ahead Of Schedule
  3. MIPS R6 Architecture Now Supported By GCC
  4. LowRISC To Feature Tagged Memory & Minion Cores
  5. Intel Skylake Audio Support For Linux 3.19
  6. After 10+ Years, NetworkManager Reaches v1.0
  7. VDPAU Updated To v0.9
  8. An Open Hardware Random Number Generator Proposed
  9. LLVM 3.6 Will Be Branched Next Month
  10. Opera Browser Puts Out Linux Updates For The Holidays
Latest Forum Discussions
  1. Need some hand holding with upgrading xserver
  2. The New SuperTuxKart Looks Better, But Can Cause GPU/Driver Problems
  3. XLennart: A Game For Systemd Haters With Nothing Better To Do
  4. Updated and Optimized Ubuntu Free Graphics Drivers
  5. Debian init discussion in Phoenix Wright format
  6. FPS capped on Linux (AMD fglrx drivers)
  7. Are there an app using HSA ?
  8. Bench specific mount point