I have old DOS
program which works with serial port. And I need to port it to linux
. I've connected my serial device to linux via USB (using rs232 cable). It appears as /dev/ttyUSB0.
Can I use functions inb
, outb
(instead of DOS
equivalent inp, outp) for reading or writing in device from my code? (inb
and outb
special function for lowlevel reading-writing bytes to specific port address). I don't understand how to determine proper port number.
Maybe there is another approach - for example open file '/dev/ttyUSB0'. But in this case I have a problem reading device registers such as modem control register (MCR) or line status register (LSR).