English 中文(简体)
kernel software trap handling
原标题:

I m reading a book on Windows Internals and there s something I don t understand:

"The kernel handles software interrupts either as part of hardware interrupt handling or synchronously when a thread invokes kernel functions related to the software interrupt."

So does this mean that software interrupts or exceptions will only be handled under these conditions:

****a. When the kernel is executing a function from said thread related to the software exception(trap) b. when it is already handling a hardware trap****

Is my understanding of this correct?

The next bit:

"In most cases, the kernel installs front-end trap handling functions that perform general trap handling tasks before and after transferring control to other functions that field the trap."

I don t quite understand what it means by front-end trap handling functions and field the trap ?

Can anyone help me?

问题回答

Software interrupts are not traps but parts of hardware interrupt handling deferred out of hardware interrupt context. Example would be the TCP/IP stack - copying packets out of the NIC into the OS buffers is done/initiated from the hardware interrupt routine, but protocol processing (ethernet -> IP -> UDP/TCP) is deferred to a software interrupt. They are often called bottom halves in operating system literature (vs. top-halves that directly talk to the hardware.) This is done to reduce scope of hardware interrupt(s) being disabled and to reduce OS scheduling latency. As such they are usually invoked at the end of common trap/interrupt entry but after the interrupt(s) is/are re-enabled, and/or by a dedicated software interrupt kernel thread.





相关问题
handling exceptions IN Action Filters

Is there a better way to handle exceptions that occur inside an Action Filter itself in ASP .NET MVC? There re 2 ways I can think of at the moment. Using a try catch and setting the HTTP Status ...

既可捕获,又可举出例外。

我有一种办法,可以进入亚洲开发银行,因此,我国的亚行在多瑙河航道中的所有 st子都位于一个试捕区。 它正在追捕Kexception

Cross compiler exception handling - Can it be done safely?

I am doing some maintenance on a C++ windows dll library that is required to work with different VC++ compilers (as I don’t want to address different mangling schemes). I have already eliminated any ...

File Handling Issue

I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason ...

Watch a memory location/install data breakpoint from code?

We have a memory overwrite problem. At some point, during the course of our program, a memory location is being overwritten and causing our program to crash. the problem happens only in release mode. ...

Unit Test for Exceptions Message

Is there a simple (Attribute-driven) way to have the following test fail on the message of the exception. [TestMethod()] [ExpectedException(typeof(ArgumentException))] public void ExceptionTestTest() ...

热门标签