Part 3: Kernel Essentials

This section covers Zephyr’s kernel fundamentals - threads, scheduling, interrupts, timing, and kernel objects.

What You’ll Learn

  • Creating and managing threads
  • Understanding the scheduler and priorities
  • Implementing interrupt handlers (ISRs)
  • Using timing services (delays, timers)
  • Working with workqueues
  • Choosing the right kernel objects
  • Memory management strategies for embedded systems

Chapters

Chapter Description
Threads Thread creation, lifecycle, and attributes
Scheduling Scheduler, priorities, and preemption
Interrupts ISR implementation and restrictions
Timing Kernel ticks, delays, sleep, timers
Workqueues System workqueue and k_work
Kernel Objects Object taxonomy and selection
Memory Management Heaps, slabs, memory blocks, and allocation strategies

Kernel Architecture Overview

flowchart TB
    subgraph Threads["Thread Management"]
        T1[Thread 1]
        T2[Thread 2]
        T3[Thread 3]
    end

    subgraph Scheduler["Scheduler"]
        READY[Ready Queue]
        RUNNING[Running Thread]
        PEND[Pending Threads]
    end

    subgraph Services["Kernel Services"]
        TIMING[Timing]
        SYNC[Synchronization]
        IPC[IPC]
    end

    Threads --> Scheduler
    Scheduler --> Services

Prerequisites

Before starting this section, you should have:

  • Completed Parts 1-2 (working build environment)
  • Understanding of C programming
  • Basic knowledge of concurrent programming concepts

The kernel is the heart of Zephyr. Understanding these concepts is essential for writing reliable embedded applications.


Table of contents


Back to top

Zephyr RTOS Programming Guide is not affiliated with the Zephyr Project or Linux Foundation. Content is provided for educational purposes.

This site uses Just the Docs, a documentation theme for Jekyll.