Introduction

User vs Kernel

Typical operating system architecture

../_images/ditaa-48374873962ca32ada36c14ab9a83b60f112a1e0.png

Monolithic kernel

../_images/ditaa-3dc899167df5e16a230c434cf5d6964cb5868482.png

Micro-kernel

../_images/ditaa-c8a3d93d0109b7be6f608871d16adff4aaa933da.png

Monolithic kernels can be modular

"Hybrid" kernels

Many operating systems and kernel experts have dismissed the label as meaningless, and just marketing. Linus Torvalds said of this issue:

"As to the whole 'hybrid kernel' thing - it's just marketing. It's 'oh, those microkernels had good PR, how can we try to get good PR for our working kernel? Oh, I know, let's use a cool name and try to imply that it has all the PR advantages that that other system has'."

Address space

User and kernel sharing the virtual address space

../_images/ditaa-a5f93e0d17ccdc2ba24828b620d7227f7fc75e33.png

Execution contexts

Multi-tasking

Preemptive kernel

Preemptive multitasking and preemptive kernels are different terms.

A kernel is preemptive if a process can be preempted while running in kernel mode.

However, note that non-preemptive kernels may support preemptive multitasking.

Pageable kernel memory

A kernel supports pageable kernel memory if parts of kernel memory (code, data, stack or dynamically allocated memory) can be swapped to disk.

Kernel stack

Each process has a kernel stack that is used to maintain the function call chain and local variables state while it is executing in kernel mode, as a result of a system call.

The kernel stack is small (4KB - 12 KB) so the kernel developer has to avoid allocating large structures on stack or recursive calls that are not properly bounded.

Portability

Asymmetric MultiProcessing (ASMP)

../_images/ditaa-cb16db58a2489307b74d4f70256a48c81c65f6c6.png

Symmetric MultiProcessing (SMP)

../_images/ditaa-08aff771b3ff7a5525df7b0c090e28c836502788.png

CPU Scalability

Linux development model

Maintainer hierarchy

Linux source code layout

../_images/ditaa-f45246aade5ecc7cfb71f7f103a57f95fc7c2b9e.png

Linux kernel architecture

../_images/ditaa-b9ffae65be16d30be11b5eca188a7a143b1b8227.png

arch

Device drivers

Process management

Memory management

Block I/O management

../_images/ditaa-0a96997f269a7a9cd0cdc9c9125f6e62e549be94.png

Virtual Filesystem Switch

../_images/ditaa-afa57a07e21b1b842554278abe30fea575278452.png

Networking stack

../_images/ditaa-a2ded49c8b739635d6742479583443fb10ad120a.png

Linux Security Modules