这个问题是纯粹学术性质的,因为现在没有人再使用MS-DOS了,但我仍然想知道原因。
一些书籍和文章中指出,如果在调用DOS中断时再次调用另一个DOS中断,可能会导致死锁。这就是为什么MS-DOS不可重入的原因。 例如,驻留程序,还有另一本书,如下所述:
A interrupt occurs B interrupt handling C DOS command starts D new interrupt occurs E interrupt handling F DOS COMMAND starts G DOS command finished H interrupt finished I return to the original interrupt handling J return to original DOS command
It says, when I is finished, going to J, which is trying to return to the point the first DOS command was interrupted, but as all DOS variables and stack are changed by F and G, when you try to go back to the original interrupt (B), you actually go back to the second interrupt (E), and that causes the deadlock.
但就我而言,中断就像是一个调用。保存当前的CS:IP状态,检查向量,找到中断处理程序,执行,然后返回到中断发生的地方。就像call
一样。
这种死锁情况根本就不合理。
所以我的问题是,是什么原因导致了死锁?能提供一个具体的例子吗?