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. NVIDIA GeForce GTX 970 Offers Great Linux Performance
  2. CompuLab Intense-PC2: An Excellent, Fanless, Mini PC Powered By Intel's i7 Haswell
  3. From The Atom 330 To Haswell ULT: Intel Linux Performance Benchmarks
  4. AMD Radeon R9 285 Tonga Performance On Linux
Latest Linux Articles
  1. AMD Moves Forward With Unified Linux Driver Strategy, New Kernel Driver
  2. MSI: Update Your BIOS From The Linux Desktop
  3. NVIDIA vs. AMD 2D Linux Drivers: Catalyst Is Getting Quite Good At 2D
  4. 15-Way GPU Comparison With Mesa 10.3 + Linux 3.17
Latest Linux News
  1. Features Of The Linux 3.18 Kernel
  2. Automatic Feedback Directed Optimizer Merged Into GCC
  3. Debian Now Defaults To Xfce On Non-x86 Desktops
  4. Phoenix Is Trying To Be An Open Version Of Apple's Swift
  5. Linux 3.19 To Have Skylake Graphics, PPGTT Enablement
  6. Ubuntu 16.04 Might Be The Distribution's Last 32-Bit Release
  7. Imagination Releases Full ISA Documentation For PowerVR Rogue GPUs
  8. Features GNOME Developers Want In The Linux Kernel
  9. GTK+ Gains Experimental Overlay Scrollbars
  10. Phoronix Test Suite 5.4 M3 Is Another Hearty Update
Latest Forum Discussions
  1. Users/Developers Threatening Fork Of Debian GNU/Linux
  2. Proof that strlcpy is un-needed
  3. xbox one tv tuner
  4. HOPE: The Ease Of Python With The Speed Of C++
  5. Bye bye BSD, Hello Linux: A Sys Admin's Story
  6. Updated and Optimized Ubuntu Free Graphics Drivers
  7. NVIDIA Presents Its Driver Plans To Support Mir/Wayland & KMS On Linux
  8. AMD Is Restructuring Again, Losing 7% Of Employees