Module gdt

Module gdt 

Source
Expand description

the x86 gdt struct is so obscure and it’s not worth the lines of code to write proper high level representaion. Also since it only needs to be written to once or twice, I’ll live with the hard coded stuffs in this mod. You need to suffer all this pain exists because intel/amd doens’t want to ditch segmentation due to backward compatibility. THIS REALLY SUCKS.

Structs§

GDTDescriptor 🔒
gdtd describes the gdt, don’t be confused, gdtd is not a gdt entdy (segment descriptor)
TaskStateSegment

Functions§

gdt 🔒
gdt_80 🔒
init
promote the gdt to high address. unsafe: only call this before dropping low memory mapping. and only call this once
set_tss_ksp
to_tss_desc 🔒
tss0 🔒
tss_desc 🔒