Protected mode: how your OS can protect itself
Channel: nanobyte
Date: 2021-08-15

In depth explanation of what x86 protected mode is, how it works, and how to switch to this mode.


Links:
- Patreon: https://www.patreon.com/nanobyte
- Discord channel: https://discord.gg/RgHc5XrCEw
- Source code: https://github.com/chibicitiberiu/nanobyte_experiments/tree/master/ProtectedMode
- Bochs config file: https://github.com/chibicitiberiu/nanobyte_os/blob/master/bochs_config


Documentation:
- Protected mode (wikipedia): https://en.wikipedia.org/wiki/Protected_mode
- Protected mode (osdev): https://wiki.osdev.org/Protected_Mode
- Intel manual: https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html
- NMI interrupts: https://wiki.osdev.org/Non_Maskable_Interrupt
- GDT: https://wiki.osdev.org/GDT
- Printing to the screen: https://wiki.osdev.org/Printing_To_Screen


Chapters:
0:00 Intro
0:37 History of x86
8:17 What is protected mode
8:57 Privilege levels
10:39 Segmentation
11:36 Paging
13:24 Switching from real to protected mode
17:36 A20 gate
23:38 GDT
27:26 Finishing the switch
33:18 Printing text from protected mode
36:46 Switching back to real mode
40:02 Conclusion