long mode GDT reload

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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: long mode GDT reload

Post by gerryg400 »

Found a couple of vague references to this on various websites. Seems that Intel supports the 16:64 indirect jump and AMD does not.

- gerryg400
If a trainstation is where trains stop, what is a workstation ?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: long mode GDT reload

Post by gerryg400 »

I never reload the GDT following that. At no point do I need to reload CS except for when I do my initial entry to long mode.
Owen, don't you need to reload cs to get to ring 3 to run user mode code ?

Btw, I agree with StephanVanSchaik and use iret for this.

- gerryg400
If a trainstation is where trains stop, what is a workstation ?
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: long mode GDT reload

Post by Owen »

gerryg400 wrote:
I never reload the GDT following that. At no point do I need to reload CS except for when I do my initial entry to long mode.
Owen, don't you need to reload cs to get to ring 3 to run user mode code ?

Btw, I agree with StephanVanSchaik and use iret for this.

- gerryg400
Sure, but thats done implicitly in the iret or sysret, rather than by a direct jump. I mean the kernel CS.
Post Reply