Sniffing IOCTL and serial port communication

view story

http://stackoverflow.com – I'm trying to reverse the protocol used by an early nineties logic analyzer an its PC software. The device is connected via RS-232 (propietary wiring) and communicates with a DOS program, successfully running on DOSBOX. I'm able to control the device with the original software but it would be useful to autimathe the downloading of data from the analyzer using a custom program but to do so I need to know what is going on the serial port. Ineed to know what mode is the serial port set, while I know for sure the datarate is either 1200 or 9600 bps (configurable on the device) I don't know the f (HowTos)