Re: what's the meaning of plain text file's executable attribute



DaVinci wrote:

Q2:
what's the difference between interrupt and trap.
what I know is that interrupt include software interrupt and hardware
interrupt.
handware interrupt : I/O ,NMI...
software interrupt : divisor is zero...
divisor is zero is a trap.
but,what's more about the difference?

Thought they are mostly named in this way, hardware or software interrupts are not the correct way of naming events.

According to the Intel manual for 486 _interrupts_ are those received on the INTR (maskable) and NMI (non maskable) inputs of the processor.
These are hardware generated events.

_Exceptions_ are those detected by the processor. These are further classified as faults, traps and aborts.
These are software generated events.

Faults are detected *before* instruction execution so the same instruction can be restarted (as page faults).

Traps are detected *after* instruction execution (as general protection or divide by zero faults).

Aborts are severe errors for which the processor can't identify the cause.

Intel defines also trap gates and interrupt gates (no reference to previous definitions). These gates are the pointers to the procedure to handle the interrupt or the exception. The difference between the two types of gates is that the latter resets the IF (interrupt flag) preventing further maskable interrupts till the IRET terminates the procedure (or the procedure itself sets IF). This prevents interrupt nesting.

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 <http://counter.li.org/>
.



Relevant Pages

  • Kernel trap 9 [FreeBSD 4.9]
    ... %Kernel trap 9 with interrupts disabled ... Fatal trap 9: general protection fault while in kernel mode ... processor eflags = interrupt enabled, ...
    (freebsd-hackers)
  • Re: whats the meaning of plain text files executable attribute
    ... G>>> to link the applications with the operating system. ... G> But this is exactly what an INT instruction does;-) ... This is in fact the main function of a trap ... interrupt vectors to someplace inside of itself, ...
    (comp.os.linux.misc)
  • [PATCH 7/7] lguest documentation:Chapter VII
    ... * Host can send more. ... * Guest, but the Guest needs the interrupts atomically disabled for an ... * interrupt gate. ... It can do this by pointing the trap gate at instructions ...
    (Linux-Kernel)
  • [PATCH 7/7] lguest: documentation pt VII: FIXMEs
    ... * Host can send more. ... * Guest, but the Guest needs the interrupts atomically disabled for an ... * interrupt gate. ... It can do this by pointing the trap gate at instructions ...
    (Linux-Kernel)
  • Re: problem in IST event getting signalled by the OS
    ... interrupt handler. ... we are able to trap the interrupt within the IRQHandler and a proper ... typedef struct ISTData // Declare the Structure to pass to IST ...
    (microsoft.public.windowsce.platbuilder)