Date: August 25, 2024

Topic: OS Design Principles and Protection Boundaries

Recall

Mechanisms and policies are optimized for common use-cases based on OS environment and workloads

Notes

Design Principles

Separation of mechanisms and policies

Optimize for common cases


Applications cannot directly access hardware due to the protection boundary

Protection Boundary

OS must have special privileges to have direct access to hardware

Privileged (kernel-level)

Unprivileged (user-level)


Applications live on the user-level while hardware lives in the kernel-level.

User-kernel switch allows them to talk to each other through:

Protection Boundary - User Kernel Switch

image.png

Kernel Mode:

User Mode:


Performing user/kernel transitions have some overhead costs

Crossing the User/Kernel Protection Boundary

User/kernel Transitions:

<aside> 💡 User/kernel transitions are not cheap

</aside>


<aside> 📌 SUMMARY: Design principles are for the separation of mechanisms and policies, optimized for common use-cases. Boundaries are put in place to separate the user and kernel, but special bits may allow transitions which can be expensive

</aside>