Since i have moved to India, getting a UPS for my work station was a must - with between 1 and 10 power-cuts a day, working without power backup is simply not possible.
However, having a UPS alone might not be enough, because in case the power is off for more than just a few minutes while your are not there, the battery will run empty and the computer will of course power off without doing a clean shutdown. So, nothing gained...
However, most UPS have either a serial or USB port, so that you can monitor its state and run scripts depending on certain conditions, such as the remaining capacity.
So, to make a long story short, i had to buy a serial-port expansion card for my machine, since the mainboard did not have a serial port bulilt-in. I went to the local computer wallah and bought a PCI card with 2 serial ports on it.
The card is identified by lspci as:
Communication controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
Googling for it gave me the impression, that the in-kernel serial driver should do the trick. In dmesg i found:
[ 0.636515] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.637319] 00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
Unfortunately, trying to hook up the UPS two one of the ports, ttyS0 remained dead.
After googling for quite some time, i discovered, that apparently the chip on the card not only provides two serial ports, but also a parallel port. However, since the chip is o cheap, many manufacturers use these chips also for serial-port only cards.
Now, the interesting part is, although the kernel finds some serial port (as dmesg shows), the kernel serial driver does not handle it. Instead, you need to build "parport_serial" either into the kernel or as a module. After I modprobe it, dmesg shows this:
47102.184128] parport_serial 0000:05:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[47102.184149] parport1: PC-style at 0xd200 [PCSPP(,...)]
[47102.184313] 0000:05:01.0: ttyS1 at I/O 0xd000 (irq = 19) is a 16550A
[47102.184434] 0000:05:01.0: ttyS2 at I/O 0xd100 (irq = 19) is a 16550A
And now i have two working serial ports on ttyS1 and ttyS2.
Just for completeness: Netmos sometimes sells this chip labeled as "NetMost 222N-2" and sometimes as "NetMos 9835". To all my knowledge, it is the same product...