Higher Half Kernel and GDT

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
pini
Member
Member
Posts: 26
Joined: Wed Oct 18, 2006 5:12 am
Location: Nancy, France

Higher Half Kernel and GDT

Post 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 ?
Don't think you can. Know you can.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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.
User avatar
pini
Member
Member
Posts: 26
Joined: Wed Oct 18, 2006 5:12 am
Location: Nancy, France

Post by pini »

yeah I thought about that in my sleep...
Don't think you can. Know you can.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

you dream about OS Devving? :shock:
weird.
User avatar
pini
Member
Member
Posts: 26
Joined: Wed Oct 18, 2006 5:12 am
Location: Nancy, France

Post 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)
Don't think you can. Know you can.
Post Reply