We are developing an operating system for my personal research
and practical education.
For the academic purpose, this motivation is similar to MINIX,
but we do not focus on theories.
Our main objective is to provide knowledges on hardware-related
programming. This is one of the most difficult and complex parts
when we start the development of operating system from scratch.
Checkpoint 9: Setup global descriptor table and interrupt descriptor table
Now we have got into the 64-bit long mode kernel in C.
As the first step of the kernel, we configure the global descriptor table (GDT)
and interrupt descriptor table (IDT).
GDT was already once configured just before entering 32 bit mode,
but they are temporary ones and they did not support ring protection of CPUs.
In this checkpoint, we prepare four sets of GDT entries for ring 0 to 3.