何时使用中断门或陷阱门? [英] When to use Interrupt Gate or Trap Gate?

查看:431
本文介绍了何时使用中断门或陷阱门?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于英特尔手册所示,无论中断门和陷阱门可以用来访问处理程序。而一些例外,即使中断共用向量编号。当通过CPU检测到这样的共享矢量我想知道,怎么可能CPU知道它是否代表了一个异常或中断?

As the Intel Manual illustrated, both Interrupt Gate and Trap Gate can be used to access a handler routine. And some exceptions even share vector numbers with interrupts. I am wondering when such a shared vector is detected by the CPU, how could CPU know whether it stands for an exception or an interrupt?

我有点困惑之中以下几点逻辑:

I am kind of confused about the logic among the following things:

(1)的栅极类型的在IDT的决定

(1) the decision of the gate types in the IDT

(2)的向量是否代表一个异常或中断的判断。

(2) the judgement of whether the vector stands for an exception or an interrupt

(1)和(2),它决定哪个?

(1) and (2), which decides which?

我希望我自己清楚......

I hope I made myself clear...

感谢号的答复。你的意思是我要告诉CPU哪些矢量代表中断或陷阱?我知道,CPU的享受EFLAGS [IF]不同的问候中断和陷阱,如何CPU知道如何做出这个决定?并根据对应于该矢量的IDT入口的类型字段的CPU化妆决定?或者更确切地说,它取决于系统是如何连接起来,我们必须将根据该IDT项的类型?即是类型完全个行业对我们的插图或必要的CPU?

Thanks for nos' reply. Do you mean I have to tell CPU which vector stands for an Interrupt or Trap? I know that CPU treat EFLAGS[IF] differently with regards to Interrupt and Trap, how does CPU know how to make this decision? Does CPU make decision based on the type fields of the IDT entry corresponding to the vector? Or rather it depends on how the system is wired up and we must set the type of the IDT entry according to that? i.e. Is the type fileds totally an illustration for us or imperative to the CPU?

和一个相关的问题:<一href=\"http://stackoverflow.com/questions/3425085/the-difference-between-call-gate-interrupt-gate-trap-gate\">http://stackoverflow.com/questions/3425085/the-difference-between-call-gate-interrupt-gate-trap-gate

推荐答案

您必须将CPU,什么是一个中断门编程,什么是一个给定的ISR一个陷阱门。

You have to program the CPU as to what is an interrupt gate and what is a trap gate for a given ISR.

这是由40-43位在IDT入口设置。这里的信息: http://wiki.osdev.org/Interrupt_Descriptor_Table

This is set by bit 40-43 in an IDT entry. Info here: http://wiki.osdev.org/Interrupt_Descriptor_Table

这篇关于何时使用中断门或陷阱门?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆