How is the RIP loaded when an interrupt arrives in an IA-32e 64-bit IDT Gate Descriptor?

Posted by Vern on Programmers See other posts from Programmers or by Vern
Published on 2011-11-27T10:15:59Z Indexed on 2011/11/27 18:04 UTC
Read the original article Hit count: 376

Filed under:
|
|

I need some help with the programming of an IA-32e Interrupt Descriptor as I'm pretty new to it. I don't think I quite understand how the RIP is loaded when an Interrupt arrives.

There is a Segment Selector in Intel's 64-bit IDT Gate Descriptor. However, from my understanding across the 5 part Intel manuals, the Linear Address of the Interrupt Handler is loaded into RIP from the 64-bit offset specified in the IDT Gate Descriptor.

The only use of the segment selector is to check:

  1. if there is a change in privilege levels
  2. the Interrupt Handler is truly pointing to a code segment

My questions are:

  1. Is RIP taken from the 64-bit offset only? Or is RIP = offset(sign extended to 64-bits) + segment selector base?
  2. Is the base address pointed to by the segment selector in the IDT Gate Descriptor ignored? Or does it have a use?

© Programmers or respective owner

Related posts about assembly

Related posts about x64