Re: [rtl] NMI handling under RTL?

2001-01-19 Thread Ian Soanes

Nicholas Mc Guire wrote:

> > Sorry if this is a silly question - I'm not remarkably familiar with
> > RTLinux.
> > I'm trying to decide if using RTL is a good way to approach a problem.
> >
> > Is it possible to intercept an NMI (specifically an interrupt generated
> > by an ISA bus IO CHANNEL CHECK condition)? I have a device
> > (a hw watchdog) which will generate an IOCHCHK upon timeout.
> >
> > I want to do some logging on this condition before the board is reset ...
> >
> > I see an rtl_request_irq() interface to register a handler, but I'm not
> > sure what the irq passed here actually indicates - a vector number?
>
> not realy its a IRQ number that maps to vector NUM_IRQ+32
>
> >
> > If anyone could clarify this for me, I'd appreciate it! I'm not really an
> > expert on x86 interrupt controller architecture ...
>
> I'll try
>
> basically there is no difference between IRQ's and NMI's , that is the
> mechanism of handling them is the same, the diffenence is only that the
> NMI's (obviously) ignore the IF and that NMI's have vectors of 0-31 as
> opposed to IRQ's that are at IRQ_NUM+32 .
>
> To catch an NMI you need to modify the handler, which is set up during system
> initialization. All vectors are set to a dummy handler first (setup.S: rp_sidt)
> that will only printk a message about a unknown interrupt exept for the ones
> that are associated with real exeptions those are later initialized to point
> to the appropriate handlers (traps.c:trap_init() by calling set_trap_gate()
> and set_system_gate()). So if you do receive a message on the console or in
> the logfiles ("unknown interrupt") then you should be able to install a real
> handler for this event and thus catch it or modify the dummy handler to dump
> the stack or whatever you need (the dummy handler should never be called
> anyway).
>

Hi Matt,

You could also take a look at RTAI's trap and exception handling. It intercepts
vectors 0-31 before (by default) passing them onto Linux. If you were to use RTAI
then you could perhaps adapt its trap interceptor for your own purposes.
Alternatively you could wait for the next rtai_24.1.x release... it will have some
improvements in this area (task specific trap handlers, debugging hooks,  faulting
task cleanup, etc).

Best regards,
Ian

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




Re: [rtl] NMI handling under RTL?

2001-01-19 Thread Nicholas Mc Guire

> Sorry if this is a silly question - I'm not remarkably familiar with
> RTLinux.
> I'm trying to decide if using RTL is a good way to approach a problem.
> 
> Is it possible to intercept an NMI (specifically an interrupt generated
> by an ISA bus IO CHANNEL CHECK condition)? I have a device 
> (a hw watchdog) which will generate an IOCHCHK upon timeout.
> 
> I want to do some logging on this condition before the board is reset ...
> 
> I see an rtl_request_irq() interface to register a handler, but I'm not
> sure what the irq passed here actually indicates - a vector number? 

not realy its a IRQ number that maps to vector NUM_IRQ+32 

> 
> If anyone could clarify this for me, I'd appreciate it! I'm not really an
> expert on x86 interrupt controller architecture ... 

I'll try

basically there is no difference between IRQ's and NMI's , that is the 
mechanism of handling them is the same, the diffenence is only that the
NMI's (obviously) ignore the IF and that NMI's have vectors of 0-31 as
opposed to IRQ's that are at IRQ_NUM+32 .

To catch an NMI you need to modify the handler, which is set up during system 
initialization. All vectors are set to a dummy handler first (setup.S: rp_sidt)
that will only printk a message about a unknown interrupt exept for the ones
that are associated with real exeptions those are later initialized to point
to the appropriate handlers (traps.c:trap_init() by calling set_trap_gate()
and set_system_gate()). So if you do receive a message on the console or in 
the logfiles ("unknown interrupt") then you should be able to install a real 
handler for this event and thus catch it or modify the dummy handler to dump 
the stack or whatever you need (the dummy handler should never be called 
anyway).

hofrat
**
*THERE   {__} Universitaet Wien  *
*IS  oo )  Inst. f. Materialphysik   *
*LIFE   O_   `_---.  Mc  Guire  Nicholas *
*IN   (-. ,-\*
*THE   || )---<  )[EMAIL PROTECTED] *
*NET ! ||| | |  privat: [EMAIL PROTECTED] *
* [EMAIL PROTECTED]   *
**
*ASCII-COW (C) 1996-2001 [EMAIL PROTECTED]   http://www.hofr.at   *
**
 Hinweis fuer HNA und HAA: englisch ist KEIN verschluesselungsverfahren ! 

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/




[rtl] NMI handling under RTL?

2001-01-16 Thread Matt Hughes

Sorry if this is a silly question - I'm not remarkably familiar with
RTLinux.
I'm trying to decide if using RTL is a good way to approach a problem.

Is it possible to intercept an NMI (specifically an interrupt generated
by an ISA bus IO CHANNEL CHECK condition)? I have a device 
(a hw watchdog) which will generate an IOCHCHK upon timeout.

I want to do some logging on this condition before the board is reset ...

I see an rtl_request_irq() interface to register a handler, but I'm not
sure what the irq passed here actually indicates - a vector number? 

If anyone could clarify this for me, I'd appreciate it! I'm not really an
expert on x86 interrupt controller architecture ... 
Thanks!
Matt Hughes
[EMAIL PROTECTED]
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/