IRQ 编号冲突

发布于 2024-08-09 01:41:50 字数 278 浏览 5 评论 0原文

从: http://software.intel.com/en-us /articles/introduction-to-pc-architecture/

异常编号 10h 对应于“浮点错误”,但软件中断 10h 也对应于“视频支持”BIOS 中断(均在实模式下)。

我缺少什么?

From:
http://software.intel.com/en-us/articles/introduction-to-pc-architecture/

Exception number 10h corresponds to a "Floating Point Error" but software interrupt 10h also corresponds to "Video support" BIOS interrupts (both in real mode).

What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

情绪操控生活 2024-08-16 01:41:50

好的,请查看这里,Watcom 的网站。我认为这是重要的部分,尽管关于 8087 的旧注释也很有趣。

由于广阔的市场现实
大多数 PC 用户仍在使用 PC
DOS 并需要 IBM PC
兼容性,IBM AT 的方式
没有处理数学错误
直截了当。因为IBM忽视了
设计时Intel的建议
PC、286 的数学错误或中断
16 与BIOS视频服务冲突
中断 10h(十进制 16)。在上面
现有软件期望数学
异常通过 INT 2 到达。

而不是连接CPU和FPU
ERROR 引脚,IBM AT 使用的
主板电路路由287
发送至级联第二个的错误信号
8259A PIC 并使用 IRQ 13 发送信号
CPU 的数学错误。默认
BIOS IRQ 13 处理程序(即 INT 75h
矢量 - 请记住 IRQ 8,
第二个 PIC 的第一条 IRQ 线,
对应中断向量70h)
包含调用 INT 2 的代码
与现有软件的兼容性。
因此 AT 上的软件仍然可以挂接
NMI向量并不变地运行
PC或AT。

IBM AT 中的外部电路
驱动 286 的 BUSY 输入引脚有效
当 287 置位其 ERROR 信号时。
这会阻止进一步执行 FPU
说明并需要避免
后时间窗内出现的问题
287 发出错误信号并在之前
286开始处理的时间
由此产生的中断。

OK, have a look here, on Watcom's site. This is the important part I think, although the old note about the 8087 is interesting too.

Due to the market reality of the vast
majority of PC users still running PC
DOS and requiring IBM PC
compatibility, the way the IBM AT
handled math errors was not
straightforward. Because IBM ignored
Intel's recommendation when designing
the PC, 286's Math Fault or interrupt
16 conflicted with BIOS video service
interrupt 10h (16 decimal). On top of
that, existing software expected math
exceptions to arrive through INT 2.

Instead of connecting the CPU and FPU
ERROR pins, the IBM AT used
motherboard circuitry to route the 287
ERROR signal to the cascaded second
8259A PIC and used IRQ 13 to signal
math errors to the CPU. The default
BIOS IRQ 13 handler (that is, INT 75h
vector - remember that IRQ 8, the
first IRQ line of the second PIC,
corresponds to interrupt vector 70h)
contains code to invoke INT 2 for
compatibility with existing software.
Software on the AT thus still can hook
the NMI vector and run unchanged on
the PC or AT.

External circuitry in the IBM AT
drives the 286's BUSY input pin active
when a 287 asserts its ERROR signal.
This prevents execution of further FPU
instructions and is required to avoid
problems in the time window after the
287 signaled an error and before the
time the 286 starts processing the
resulting interrupt.

执手闯天涯 2024-08-16 01:41:50

简单的答案是,int 10h 浮点错误是保护模式异常,而 int 10h BIOS 视频服务是实模式中断。

令人高兴的答案是,清除 CR0 寄存器中的 NE 位将防止异常发生,并允许在 PM32 中将其用作简单中断(例如在32 位保护模式 BIOS 扩展器)。

The simple answer is that the int 10h Floating Point Error is a protected mode exception, while the int 10h BIOS Video Services is a real mode interrupt.

The happy answer is that clearing the NE bit in the CR0 register will prevent the exception from occurring and allow it's use in PM32 as a simple interrupt (for example in a 32 bit protected mode BIOS extender).

风启觞 2024-08-16 01:41:50

浮点故障是由错误条件生成的 CPU 中断。这与 IRQ 不同。

PIC(可编程中断控制器)可用于修改哪些 IRQ 将映射到哪个 CPU 中断。如果您以正确的顺序发送 PIC 的 IO 端口(使用 OUT 指令),则可以以不与来自浮点异常的 CPU 中断冲突的方式映射 IRQ。

另请参阅本文档

编辑:但是现在我再次阅读了您的问题...我们不是在这里讨论 IRQ。 BIOS Int 10h 是一个完全不同的野兽......它是您的 BIOS 为视频例程实现的一些代码。如果您正在编写操作系统并想知道是否应该处理浮点错误,您可能应该忘记这个特定的 BIOS 中断的存在。 :-)

编辑 2:想想看,旧的 DOS 程序解决此问题的方法可能是备份 IVT 条目,将自己的异常处理程序放在其位置,执行一些浮点操作,并在以下情况下恢复旧的 IVT 条目: FPU 已经完成了。

The floating point fault is a CPU interrupt, generated by an error condition. This is different from an IRQ.

The PIC (Programmable Interrupt Controller) can be used to modify which IRQs will get mapped to which CPU interrupt. If you send the PIC's IO port the proper sequence (using the OUT instruction), you can map the IRQ in such a way that it doesn't conflict with the CPU interrupt from a floating point exception.

See also this document.

EDIT: But now that I read your question again... We're not talking about IRQs here. BIOS Int 10h is a different beast altogether... It's some code that your BIOS has implemented for video routines. If you're writing an OS and wondering if you should handle floating point faults, you should probably forget this particular BIOS interrupt exists. :-)

EDIT 2: Come to think of it, probably the way old DOS programs worked around this was to backup the IVT entry, put their own exception handler in its place, did some floating point ops, and restored the old IVT entry when they were done with the FPU.

無處可尋 2024-08-16 01:41:50

你没有遗漏任何东西。

8088 处理器(最初的 IBM PC 中使用的处理器)仅定义了异常 0、1、2、3 和 4。

因此 IBM 将 0x8 到 0xF 用于硬件中断处理程序,将 0x10 及以上用于 BIOS 例程。由于某种原因,IBM 忽略了这样一个事实:Intel 非常明确地为未来的处理器异常保留了编号 0x5 到 0x1F。

随着时间的推移,需要更多的例外,英特尔继续分配它们。大多数时候,旧版软件无论如何都不会触发这些异常,而较新的操作系统(在保护模式下运行的操作系统)可以分配不同的编号,以免与处理器异常发生冲突。

旧软件中添加了大量的技巧,以便在不破坏太多兼容性的情况下使用较新的处理器功能。虽然我不确定,但我怀疑较新的 BIOS 可能会尝试检测 INT10 是由软件中断触发还是由 INT10 处理程序中的协处理器触发。

仅供参考,来自 386 程序员手册:

<块引用>

协处理器错误向量至中断 16。任何具有协处理器的 80386 系统都必须使用中断向量 16 来处理协处理器错误异常。如果 8086/8088 系统使用另一个向量来处理 8087 中断,则两个向量都应指向协处理器错误异常处理程序。

You're not missing anything.

The 8088 processor (the one used in the original IBM PC) only defined exceptions 0, 1, 2, 3, and 4.

So IBM used 0x8 to 0xF for hardware interrupt handlers and 0x10 and above for BIOS routines. For some reason IBM ignored the fact that Intel had very clearly reserved numbers 0x5 to 0x1F for future processor exceptions.

As time went on, more exceptions were needed and Intel went ahead and assigned them. Most of the time, legacy software didn't trigger these exceptions anyway whilst newer operating systems (those that ran in protected mode) could assign different numbers so as not to clash with the processor exceptions.

There were plenty of hacks added to older software to gain some use of newer processor features without breaking too much compatibility. While I'm not sure, I suspect that perhaps newer BIOSes might have tried to detect whether INT10 was triggered by a software interrupt or by the coprocessor in their INT10 handler.

FYI, from the 386 programmers manual:

Coprocessor errors vector to interrupt 16. Any 80386 system with a coprocessor must use interrupt vector 16 for the coprocessor error exception. If an 8086/8088 system uses another vector for the 8087 interrupt, both vectors should point to the coprocessor-error exception handler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文