Page 1 of 1

Higher Half Kernel and GDT

Posted: Thu Feb 28, 2008 3:52 pm
by pini
I successfully wrote a HigherHalf kernel with paging enabled which gets loaded through Tim Robinson's GDT trick (as described in the wiki http://www.osdev.org/osfaq2/index.php/HigherHalfWithGdt).

My question is the following : once paging has been set up and enabled, what is the purpose of setting up a new 0-based GDT instead of keeping the base-biased GDT ?

Posted: Thu Feb 28, 2008 4:02 pm
by JamesM
Because segmentation isn't fully supported in x86_64, many instructions (such as SYSCALL, SYSRET) assume a flat memory model.

Generally speaking, segmentation is deprecated. Not only that, but paging is a much more portable concretion of the virtual memory abstraction, and is implemented in many more architectures than segmentation is.

Posted: Fri Feb 29, 2008 1:20 am
by pini
yeah I thought about that in my sleep...

Posted: Fri Feb 29, 2008 1:24 am
by 01000101
you dream about OS Devving? :shock:
weird.

Posted: Fri Feb 29, 2008 5:55 am
by pini
01000101 wrote:you dream about OS Devving? :shock:
weird.
If I go to sleep just after some deving (not os-specifically), I sometimes find the solution in my dreams. I'm getting very frustrated when I wake up having forgotten everything except the fact that I did find the solution, but that doesn't happen too often (fortunately)