Role of the code segment register during "far" CALLs



Hello,

My question is in view of the memory management unit's role in address
translation, whereby for example, to access code (CALL <address>), the
CS register is first used as a selector to retrieve a Segment
Descriptor that specifies the base of the code segment, to which an
offset gets added to form a linear address which is then forwarded to
the paging unit to generate a physical address. Fine?

The question is, at what step, in the course of executing a far CALL
does the CS register change, and who changes it and where are segment
information for each module stored (PE file?). Since a far call crosses
code segment boundaries i presume that the code segment register also
should change to point to the code segment of the module in which the
called function resides. Just not sure when it happens and who makes it
happen after the far CALL instruction is issued.

I might also be doing something wrong in my experiments, but i don't
see the CS register value (register window) change when i call
CoInitialize (which resides in ole32.dll) from my application's main
method.

Thanks for any guidance on this one.
Ranjit

.



Relevant Pages

  • Re: Role of the code segment register during "far" CALLs
    ... I see..So that's why every page has permissions such as READ,WRITE, ... EXECUTE, etc and the protection checks happen directly on the page ... CS register is first used as a selector to retrieve a Segment ... code segment boundaries i presume that the code segment register also ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Role of the code segment register during "far" CALLs
    ... When you say only 2 code segments do you mean 2 in terms of privilege ... boundaries to reach into the code segment of ole32.dll which would be ... page-level protection. ... have changed CS register as a result of far call via the call gate ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Role of the code segment register during "far" CALLs
    ... When you say only 2 code segments do you mean 2 in terms of privilege ... boundaries to reach into the code segment of ole32.dll which would be ... page-level protection. ... have changed CS register as a result of far call via the call gate ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Role of the code segment register during "far" CALLs
    ... Windows does not use far calls, because it uses only 2 code segments ... CS register is first used as a selector to retrieve a Segment ... code segment boundaries i presume that the code segment register also ... called function resides. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [PATCH] ASoC: Fix wm8753 register cache size and initialization
    ... elements where as there are 63 register which should be cached. ... In the register cache access code you subtract one from the ... registers index to get it's index in the register cache array, ...
    (Linux-Kernel)