Hi John, Thanks for your reply, I'll have a look into the oprofile software. I agree that it would be easier to patch the kernel. I was thinking of the situation where the system is already up and running, but the user prefers not to bring the system down, for whatever reason, they could simply load the module to update their system with the hot swap features. But maybe this is a case of trying to cater for a very small minority of cases... Thanks again, Simon. -----Original Message----- From: John Levon [SMTP:movement@marcelothewonderpenguin.com] Sent: 10 July 2002 03:34 To: kernelnewbies@nl.linux.org Subject: Re: Customising the NMI handler > I am using Linux on a Compact PCI system with a System Controller and > a set > of Peripheral boards. Each time one of these peripheral boards is hot > swapped a NMI interrupt is generated on the System Controller board. > I have > in mind to write a driver that handles these NMI interrupts. I don't > really > want to start hacking the kernel source, but would rather like to > build a > module that can be loaded at some point. Why ? Modify the kernel source, it's not difficult and is almost definitely the best solution. > My idea is to get the module to > replace the NMI vector to the existing NMI handler function (in > linux/arch/i386/kernel/entry.S that is set from the trap_init function > in > /linux/arch/i386/kernel/traps.c) with my own handler function, calling > the > previous handler if necessary after my handler has done its bit. A > pretty > standard idea. Now, in terms of swimming, I still have my inflatable > armbands on here! So I was wondering if this were possible? It's possible, but is horrifically ugly. If you really really want to do this, check out oprofile.sf.net source code, particularly the code that calls _set_gate(). > module? Looking through the traps.c file I see that there is a > function > trap_init_f00f_bug which makes the IDT read only? It makes a copy read only iirc john -- "I know I believe in nothing but it is my nothing" - Manic Street Preachers -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/