Lawson Whitney wrote:

> > Depending on just what the new %cs value is, the lcall instruction can
> > in fact perform a normal inter-segment call, or else a call via a call
> > gate, task gate, or to a task state segment.
> 
> These gates intel's equivalent of an entry descriptor in GCOS8? :-)

Well, if I knew what an entry descriptor in GCOS8 is, I could answer
that question ;-)  But it does sound like it ...

A call gate is a special descriptor that doesn't describe a segment,
but rather a 'gate', i.e. a defined entry point into privileged code
that can be called from non-privileged code.  (Normally, non-privileged
code is not allowed to call arbitrary code on a higher privilege level,
of course.)

Normally, a call gate can only be set up from privileged code; this
can be used to implement the system call features of an operating 
system.  (Often, however, interrupt gates are used instead of call
gates.  Those are then acessed via an 'int' instruction instead of
a 'lcall'.  Apart from this, they basically work the same way ...)

[ B.t.w. in Windows 9x, the descriptor table is writable for anyone;
  this means that user mode apps can write themselves call gates into
  the descriptor table and thus execute arbitrary code at ring-0.

  Some games appear to use this as copy protection (or anti-debugger)
  mechanism :-/  ]


Bye,
Ulrich

-- 
  Ulrich Weigand,
  IMMD 1, Universitaet Erlangen-Nuernberg,
  Martensstr. 3, D-91058 Erlangen, Phone: +49 9131 85-27688

Reply via email to