Linux Basics

What is Linux?

Linux is the undisputed king of the embedded and server worlds. From the Raspberry Pi to your home Wi-Fi router, and even the Android phone in your pocket, they all run Linux.


The Kernel vs The Operating System

When people say "Linux", they are usually referring to a Linux Distribution (like Ubuntu, Debian, or Raspberry Pi OS). However, technically, Linux is just the Kernel.

The Kernel

The Kernel is the core program that sits between the software applications and the physical hardware (CPU, Memory, USB devices). If you plug in an ESP32 board, it's the Linux kernel that recognizes the USB device and creates a file for it (like /dev/ttyUSB0).

The Distribution (OS)

An Operating System is the Kernel plus all the software needed to make it useful: a desktop environment (the GUI), a package manager (to install apps), a terminal emulator, and standard utilities.

  • Ubuntu: The most popular desktop distribution. Perfect for beginners and has excellent support for ESP-IDF and STM32 tools.
  • Raspberry Pi OS (formerly Raspbian): A lightweight distribution based on Debian, specifically optimized for the Raspberry Pi hardware.

Why Use Linux for Embedded Development?

If you are currently using Windows, you might wonder why you should bother learning Linux.

  1. Native Toolchains: Almost all professional embedded toolchains (GCC, Make, CMake, Ninja) were originally built for Linux. They run natively, much faster, and with fewer weird bugs than on Windows.
  2. Hardware Interaction: In Linux, "Everything is a file." Your serial port is a file. Your I2C bus is a file. This makes writing software that interacts with hardware incredibly straightforward compared to the Windows registry and COM ports.
  3. Deployment: When you build an Edge AI gateway on a Raspberry Pi, you will be deploying your code to a Linux machine. Understanding how it works is non-negotiable.

The Terminal (Command Line Interface)

The most powerful tool in Linux is the Terminal (or CLI). While modern Linux has a beautiful graphical user interface (GUI), professional developers spend most of their time in the terminal.

It allows you to:

  • Navigate the file system instantly.
  • Install software with a single command.
  • Compile code and flash microcontrollers without clicking through menus.

In the next section, we will learn how to navigate the Linux File System using the terminal.

Previous
Before You Begin