Triple Fault的捕获与处理

前面有文章说Triple Fault无法捕获,经过几天资料搜寻,对于这个问题还是有办法的。如果可以,对于捕获Triple Fault,最简便的方法就是使用虚拟机来进行操作,这样在发生Triple Fault时影响的只是虚拟机,在host机器里我们仍然可以做进一步处理。当前虚拟机比较多,比如最常用的Vmware、Qemu、Bochs等,我就试了一下Vmware,发生Triple Fault时Vmware会弹个框进行提示CPU进入shutdown模式,按确定(虚拟机)重启,按取消(虚拟机)关机;这个对于我们调试Triple Fault帮助不大;另外几个虚拟机,网上搜索了一下,据称Qemu会有oops信息:
http://readlist.com/lists/netbsd.org/current-users/5/28250.html
Bochs也会有oops信息:
Operating Systems Development Series
Operating Systems Development Series

如果无法使用虚拟机怎么办?在实体机器上的Triple Fault捕获仍然有办法,但这需要更底层的操作,在Intel官方手册Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 3A System Programming Guide.pdf的266页:
If another exception occurs while attempting to call the double-fault handler, the processor enters shutdown mode. This mode is similar to the state following execution of an HLT instruction. In this mode, the processor stops executing instructions until an NMI interrupt, SMI interrupt, hardware reset, or INIT# is received. The processor generates a special bus cycle to indicate that it has entered shutdown mode. Software designers may need to be aware of the response of hardware when it goes into shutdown mode. For example, hardware may turn on an indicator light on the front panel, generate an NMI interrupt to record diagnostic information, invoke reset initialization, generate an INIT initialization, or generate an SMI. If any events are pending during shutdown, they will be handled after an wake event from shutdown is processed (for example, A20M# interrupts).
已经明确说明在硬件上可以做一些动作,不直接重启CPU,改而发送SMI或NMI这样的信号,让CPU仍有机会做一些事情,比如record diagnostic information。

IBM至少有一款架构的芯片组支持对triple fault的捕获并log一条日志:
IBM Support
1. Triple faults occur as follows:
a)A CPU enters an exception routine because of a fault.
b)While in this exception routine, if the CPU encounters another fault, the CPU will enter another exception routine (Double Fault).
c)If a third fault occurs, the CPU cannot handle it and issues a Shutdown Special Cycle (Triple Fault).
2. When a triple fault occurs on servers without IBM X3 Architecture chipsets, the Shutdown Special Cycle causes the southbridge to reset with no logged messages.
3. When a triple fault occurs on servers with IBM X3 Architecture (Hurricane) chipsets, the System Management Interrupt handle the Shutdown Special Cycle, logs a triple fault event through BIOS, and then resets the system. The triple fault message is an information only message because most triple faults are contained at the kernel or device driver level and is not necessarily a hardware error.
4. Identifying and determining the cause of the triple fault is very difficult and can require software and hardware development debug.

IBM提供的更详细的Triple Fault的捕获与处理方法:
Method of detecting and reporting triple faults in software
Prior Art Database - IP.com

  • 21
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值