VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

What is the value of the CS selector when jumping/calling a call gate? I know the call gate contains CS and EIP, but is the resulting value of CS(and CS.RPL by extension) the one that's loading(pointing to) the call gate, or is it the value that's within the call gate descriptor? What about the resulting privilege level? Is it simply the low 2 bits of the CS selector in the call gate descriptor?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 3, by crazyc

User metadata
Rank Member
Rank
Member

Calls though call gates to conforming segments don't change stacks so the DPL of SS (CPL) and RPL would be equal.

Reply 2 of 3, by superfury

User metadata
Rank l33t++
Rank
l33t++

What about the resulting value of the CS selector? Is it the value of the call(e.g. call 0008:0000 resulting in CS being 0008) or the value within the call gate descriptor?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 3, by crazyc

User metadata
Rank Member
Rank
Member

It has to be the destination code segment. If it were the call gate any subsequent far calls would return to the call gate which would be bad.