Reasons To (Not) Prefer An Operating System Over Bare Metal#
Conceived as a pair programming session (trainer hacks, audience gives input), this course gives
An understanding of the problems solved by operating systems
An overview of the building blocks that any operating system brings
Threads/tasks and multitasking
Scheduling multiple tasks, in the presence of task priorities
Synchronization and communication primitives like mutexes, semaphores and message queues
An introduction to event driven programming, a technique to simultaneously react on multiple events withing a single task [1]
Course Flow#
Interrupt Madness
We start with a relatively simple bare-metal, purely interrupt-driven, application. After fixing a hard to detect race condition due to interrupt nesting, we add considerable complexity by adding CAN communication (and thus another interrupt).
Summary
Basic OS Building Blocks
Planning to master complexity by being able to wait, lets talk about basic building blocks of an operating system.
Partition application into multiple threads
Being able to wait requires to move complex code out of interrupt service routines, into dedicated threads.
Advanced: Event Multiplexing
Threads are not free - here’s a technique that can be used to collapse functionality from multiple threads into one.
Additional Material#
OS Primitives#
Futher Reads#
Demo Project: Nuclear Power Plant Controller#
Demo Project: Datalogger#
Footnotes