← Training catalogue
root@opcode-labs:~# cat programme/embedded-linux.md

Embedded Linux System Programming

Processes, threads, IPC, containers and the kernel, hands-on

A practical program that takes you from your first fork() to a Linux kernel you cross-compile and boot yourself. Every concept is drawn on the whiteboard, coded live in C and run on Linux: processes, IPC, POSIX threads, timers, daemons, epoll, namespaces and cgroups, multithreading design patterns, and finally an ARM64 kernel, a BusyBox root file system and your own driver on QEMU.

Register for the session →Next session: Saturday 9 January 2027
8sessions over 4 weekends
CPOSIX / Linux APIs, coded live
30+hands-on labs
ARM64kernel, rootfs and driver on QEMU

▶ Watch the 40-second preview: turn on the sound with the speaker icon

// 01

Who is it for?

Profile

  • Embedded engineers moving from microcontrollers / RTOS to Linux
  • C developers who want to write robust multi-process and multi-threaded applications
  • Final-year students and PFE / internship candidates
  • Engineers preparing for embedded Linux, automotive or IoT positions

Prerequisites

  • C programming (pointers, structs, memory)
  • Basic command-line usage
  • A PC with Linux, or Windows with WSL (Ubuntu)
  • No prior Linux system programming experience needed
// 02

What you will be able to do

  • Explain how Linux runs your program: user space, kernel space, system calls and the scheduler
  • Create and manage processes and choose the right IPC: pipes, message queues, shared memory, semaphores, sockets
  • Write correct multi-threaded code with pthreads: mutexes, condition variables, barriers, no races and no deadlocks
  • Understand what the CPU does to your threads: caches, memory ordering, false sharing
  • Build event-driven services with timers, epoll and inotify, and run them as systemd daemons
  • Isolate and limit applications with namespaces, cgroups and Docker
  • Apply multithreading design patterns: thread pool, producer / consumer, task queue
  • Cross-compile a Linux kernel and BusyBox for ARM64, boot it on QEMU and add your own kernel module
// 03

Detailed program

Each session mixes whiteboard theory, live coding and labs. Open a session to see its content.

Module 1: Linux and processes

Weekend 1

Understand how Linux runs programs, and master the process model.

01Linux foundations and the process modelKernel vs user space, system calls, fork() and wait()▶

Theory

  • Linux architecture: kernel, user space, system calls
  • Program vs process; the process life cycle and states
  • Process creation with fork(): what the child inherits
  • Parent / child synchronization with wait() and waitpid()
  • Exit status, zombies and orphans
  • Reading the man pages as your first reference

Labs

  • Set up the Linux / WSL development environment, GCC and VS Code
  • Create a child process and print the PIDs
  • Wait for a child and decode its exit status
  • Observe processes with ps and /proc
Outcome: you can create processes and explain what the kernel does when you call fork().
02Processes in depth and first IPCexec, environment, signals, pipes▶

Theory

  • The exec family and the program's environment
  • Foreground and background processes, sessions and process groups
  • Signals: sending, handling and masking
  • Inter-process communication overview
  • Pipes and FIFOs: byte streams between processes

Labs

  • Launch a program with fork() + exec()
  • Install a signal handler
  • Parent / child communication through a pipe
Outcome: you can launch, control and connect processes.

Module 2: Inter-process communication and POSIX threads

Weekend 2

Choose the right IPC mechanism, then move to multi-threading and its pitfalls.

03Inter-process communicationPipes, message queues, shared memory, semaphores, sockets▶

Theory

  • IPC families: byte stream, message oriented, shared memory
  • Pipe capacity, blocking behavior and atomic writes (PIPE_BUF)
  • POSIX message queues: attributes, priorities, blocking and non-blocking mode
  • POSIX shared memory and memory mapping
  • Binary and counting semaphores
  • Sockets: Unix domain and network sockets, client / server life cycle
  • Introduction to threads

Labs

  • Producer / consumer with a POSIX message queue
  • Share data between two processes with shared memory + a semaphore
  • Unix domain socket server and client
  • Inspect IPC objects in /dev/mqueue and /dev/shm
Outcome: you can pick and implement the right IPC for a given data flow.
04POSIX threads and synchronizationpthreads, mutexes, deadlocks, condition variables, barriers▶

Theory

  • Why multi-threading: synchronous vs asynchronous, multi-core CPUs, Amdahl's law
  • The pthreads API: create, join, detach, return values
  • The different ways a thread terminates; cancellation
  • Race conditions and mutexes
  • Deadlocks and pthread_mutex_trylock
  • Condition variables, signals and threads
  • Barriers
  • Introduction to thread pools and CPU / I/O bound workloads

Labs

  • Create, join and detach threads; pass and return data
  • Reproduce a race condition, then fix it with a mutex
  • Reproduce a deadlock, then avoid it
  • Waiter / updater threads with a condition variable
  • Synchronize worker threads with a barrier
Outcome: you write thread-safe code and know how to find and fix races and deadlocks.

Module 3: Linux services and system internals

Weekend 3

Build real Linux services, then look under the hood: containers, CPU and memory.

05Time, timers, daemons and I/O multiplexingClocks, POSIX timers, systemd, epoll, inotify▶

Theory

  • Multi-threaded application architecture
  • Time on Linux: CLOCK_REALTIME vs CLOCK_MONOTONIC, real / user / sys time
  • Timers: signal-based POSIX timers and timerfd
  • Daemons: how to write one, and logging with syslog
  • systemd: units, service life cycle, dependencies
  • File I/O buffering: the stdio buffer and the kernel page cache
  • I/O models: blocking, non-blocking and multiplexed (epoll)
  • Monitoring file events with inotify

Labs

  • Measure elapsed and CPU time correctly
  • Periodic task with a POSIX timer and with timerfd
  • Write a daemon and run it as a systemd service
  • Event loop serving several clients with epoll
  • Watch a configuration file with inotify
Outcome: you can build an event-driven Linux service that starts with the system.
06Containers and what the CPU does to your threadsNamespaces, cgroups, Docker, caches, memory ordering▶

Theory

  • Namespaces: mount, IPC, network and PID; how PIDs look inside and outside
  • cgroups: limiting CPU, memory and I/O
  • Docker: virtual machines vs containers, Dockerfile, image, container
  • The history of parallel CPUs: pipelines, superscalar, out-of-order, multi-core, hyper-threading
  • CPU topology and cache hierarchy
  • Memory consistency: sequential consistency, store buffers, reordering, memory barriers
  • Cache lines and false sharing

Labs

  • Create namespaces and compare PIDs from both sides
  • Limit a process with a cgroup
  • Package and run your server in a Docker container
  • Read the CPU topology from /sys
  • Show reordering and false sharing in code, then fix them
Outcome: you understand containers from the kernel up and write threads that scale on multi-core CPUs.

Module 4: Design patterns, tooling and the Linux kernel

Weekend 4

Structure real applications, debug and build them professionally, then go down to the kernel.

07Debugging, CMake and multithreading design patternsgdb, VS Code, CMake, thread pool, producer / consumer, scheduler▶

Theory

  • Linux history and the GNU ecosystem
  • Debugging with gdb and VS Code; build tasks
  • CMake: a meta-build system, configure and build
  • Design patterns: thread per task vs thread pool
  • Task queue and thread pool implementation
  • Producer / consumer with condition variables, without polling
  • The Linux scheduler: CFS, SCHED_OTHER, SCHED_BATCH, SCHED_FIFO, SCHED_RR
  • I/O-bound, CPU-bound and memory-bound workloads: choosing a policy

Labs

  • Debug a multi-threaded program step by step in VS Code
  • Turn a project into a CMake build
  • Implement a thread pool with a task queue
  • Producer / consumer on a shared circular buffer
  • Run threads with real-time scheduling policies
Outcome: you can structure, build and debug a multi-threaded Linux application like in industry.
08Embedded Linux on ARM64: kernel, root file system and driversCross-compilation, BusyBox, QEMU, kernel modules▶

Theory

  • Project review: multi-threaded architecture and code
  • The embedded Linux stack: bootloader, kernel, root file system, applications
  • Cross-compilation and the aarch64 toolchain
  • Configuring and building the Linux kernel for ARMv8
  • BusyBox and building a minimal root file system / initramfs
  • Kernel modules and character drivers: file_operations, copy_to_user, copy_from_user
  • System calls: from user space into the kernel

Labs

  • Get and build the Linux kernel and BusyBox for ARM64
  • Boot your own Linux on QEMU
  • Write, build and load a character driver
  • Talk to your driver from a user-space application
  • Cross-build an application and run it on the QEMU target
Outcome: you boot your own embedded Linux on ARM64 and extend it with your own kernel code.
// 04

From system calls to the kernel

The program goes from user space down to the kernel, one layer at a time:

1 · Processesfork, exec, wait, signals
2 · IPCPipes, message queues, shared memory, sockets
3 · Threadspthreads, synchronization, design patterns
4 · ServicesTimers, epoll, daemons, systemd, containers
5 · KernelCross-built ARM64 kernel, rootfs and drivers on QEMU
// 05

Tools

Environment

  • Linux (Ubuntu) or Windows with WSL
  • QEMU emulating an ARM64 (ARMv8) board: no hardware to buy

Software

  • GCC, the aarch64-linux-gnu cross toolchain, Make and CMake
  • VS Code, gdb, Git and GitHub
  • systemd, Docker, BusyBox, Linux kernel sources
// 06

What's included

  • 8 live sessions with the trainer
  • All lab sources on GitHub
  • Slides and lab companion sheets
  • Live Q&A in every session

Registration open: session starting 9 January 2027

Hybrid: on site in El Ghazala or online. Limited seats. A question about the prerequisites? Book a free 30-minute call.

Trainer: Mehdi Hanzouti, Embedded SW Architect · contact@opcode-labs.com

// registration

Book your seat

Fill in this form to register for the session starting 9 January 2027. You get a confirmation email straight away, then we contact you to finalise your registration.

Starts: Sat 9 January 2027Hybrid: El Ghazala or onlineLimited seats
Current profile
How will you attend?

Your data is only used to handle your registration. Any question? +216 92 999 707 · contact@opcode-labs.com