I need to write a program to react to the modem control lines changing in the serial port on my FreeBSD 10.3 machine. I don't want to read any data from it (there won't be any). I'm aware I can configure the port to raise (in my instance) IRQ4 when this happens, but how could my program pick up on the interrupt? Do I have to install a function pointer in the interrupt descriptor table, and if so, how? Or is there something simpler I can piggyback off?
For lack of rep I was unable to comment against plonk's helpful answer here: Viewing (monitoring) line status of a serial port
I did something similar for a parallel port in MS-DOS a while back when I made a digital readout for my milling machine, but as far as I remember that was in real mode and hooked into the IVT, which I suspect will have been simple by comparison.
(Explanation: I inherited a working but simple UPS which lacks a comms port. I figured I could 'read' the panel LEDs and beeper via electrical isolation/level conversion to the control lines in my server's serial port. Basically if anything about the machine's UPS changes from the norm, a shutdown script will be initiated. Crusty, I know, but if I can get it set up fairly quickly it'll save me £100 on a newer one.)