Protected Mode (32-bit) Enabled
I got into protected mode in my stage 2 bootloader.
1. A20 Line
First, I have to enable the A20 line to give the computer permission to access more than 1MB memory.
2. E820 Memory Map
Next, I write a part of code that informs the computer of the safe physical memory access range (tells the computer about memory areas)
3. Global Descriptor Table (GDT)
Before switching to protected mode, the kernel has to know what memory areas is for what. That is why we have GDT to inform the kernel.
4. CR0.PE = 1
Finally, I enable protected mode through the register CR0.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.