1

These are safe, low-privilege ways to call kernel functions.

I don't know the difference between the two.

donald jiang
  • 171
  • 1
  • 6

1 Answers1

4

You can look through the intel manuals for all the gory bits; but in a nutshell:

  1. Call Gate does not disable interrupts.
  2. Call Gate can copy N arguments between the stacks on a privity switch.
  3. Call Gate can be LDT private
  4. Call Gate can be disguised as a normal function pointer, if your compiler happens to support intel medium,large compilations models.
  5. Given 4, a normal "ret" instruction undoes a call gate entry.
  6. Almost nobody every used Call Gates.

whereas:

  1. Interrupt gates disable interrupts.
  2. Interrupt gates don't care about arguments.
  3. The IDT is a global resource.
  4. The invocation sequence for interrupts is pretty unique from functions.
mevets
  • 10,070
  • 1
  • 21
  • 33
  • Interrupt gates *may* keep interrupts enabled - it depends if they are declared as "interrupt" or as "trap" in the IDT. (I was spending days searching for a bug until I found this out...) Solaris (SunOS) was using "Call Gates" - at least in older versions. And according to Wikipedia, they were also commonly used in OS/2 and Windows 95. – Martin Rosenau Nov 19 '21 at 09:20