For what do I need GDT in long mode?
For what do I need GDT in long mode?
I don't understand it since GDT is used in segmentation, but long mode requires paging.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: For what do I need GDT in long mode?
Paging and segmentation are not mutually exclusive. You still use segment descriptors in long mode, although they are a little different. The programming manual explains it.
Re: For what do I need GDT in long mode?
This syllogism is one that it is doubtful whether Aristotle would approve of. There seems to be some hidden premise here. Would you care to explain what prompted you to think there would be a problem with logically reconciling those two statements?Roman wrote:I don't understand it since GDT is used in segmentation, but long mode requires paging.
As for the answer to the question itself, the GDT is used in the exact same way in long mode as in protected mode, except that a previously unused bit now indicates that a code segment is to be run in 64 bit mode. However, when in 64 bit mode, it should be noted that segment bases and limits are not applied except for the FS and GS bases.
Re: For what do I need GDT in long mode?
Thread Local Storage would be the most typical answer.
Re: For what do I need GDT in long mode?
You use the GDT in long mode for:
- TSS, to have a valid interrupt stack table that allows you to turn on the red zone again
And that's pretty much it.
- TSS, to have a valid interrupt stack table that allows you to turn on the red zone again
And that's pretty much it.