Start From What You Are Curious About#

The book builds up from Chapter 1, but you do not have to read it in order. Pick whatever you are curious about below. If you run into a term you do not know, go back to an earlier chapter at that point.

I want to see it running first#

Run your own OS in the browser

The same firmware as on the real board, running in QEMU inside your browser. Nothing to install.

Appendix: Running Without the Board
Walk the quadruped in the browser

The trained walking policy in a physics simulation. Steer it forward and turn with sliders.

Learning to walk (reinforcement learning)

“Why?” about the computer you use every day#

Why do other apps keep running while one does heavy work?

Chapter 4: a timer interrupt forcibly switches the running task.

Chapter 4: The Preemptive Scheduler
Why does the OS survive when an app crashes?

Chapter 6: catch a divide by zero or a write to a bad address, and stop only the task that caused it.

Chapter 6: Memory Protection
How do top and Task Manager count CPU %?

Chapter 7: show the CPU usage the OS counts on the LED matrix.

Chapter 7: LED Matrix Visualization
What does the CPU do the moment you power it on?

Chapter 1: follow the path from reset to main().

Chapter 1: Boot Sequence
What happens inside malloc?

Advanced 3: write malloc / free yourself.

Advanced 3: Writing Your Own Heap
How is a “file” made?

Advanced 4: put a filesystem on top of the flash memory.

Advanced 4: A Minimal Filesystem — LittleFS

Start from what you like#

I want to make a robot walk

Chapter 13: drive eight servos from your own OS to walk a quadruped. Parts and assembly are in Quadruped Assembly.

Chapter 13: Walking a Quadruped
I like Python

Chapter 11: build a small Python that runs on the microcontroller. Chapter 8 before it builds an even smaller language.

Chapter 11: TinyPython — Python on a Microcontroller
I use FreeRTOS at work

Chapter 10: solve the same problem with FreeRTOS and compare the designs.

Chapter 10: The Same Thing with FreeRTOS
I like electronics

Chapter 12: understand PWM generation and A/D conversion at the register level.

Chapter 12: Hardware Deep Dive — PWM and ADC

I want to break something that works#

Chapters 4, 6, and 7 end with “break it” experiments: change one place in the code, predict what will happen, then run it. They also work in the browser version.