query /dev/port

Martijn van Oosterhout kleptog at svana.org
Sat Jun 15 19:24:29 EST 2002


On Sat, Jun 15, 2002 at 07:12:03PM +1000, adrian wrote:
> I wish to read and write to the serial port and its associated registers.
> 
> I can read and write to the parallel port using /dev/port and address 
> hex 378. I can also read the command and status registers by using port 
> 378 + 1 and 378 + 2
> 
> The serial port base address is hex 3f8 ( ttyS0 ) plus the various 
> command status registers, 6 in total.
> 
> My question is can the serial port be controlled in the same manner, 
> i.e. using /dev/port where the address is either 3f8 plus 3f8 +1, 3f8 +2 
> etc. ?
> 
> In other words is /dev/port a general purpose I/O port ?

Yes it is. You can access anything, even ports that don't exist and
associated undefined bahaviour.

Though in the case of the serial port, what can you do directly that you
cannot do via /dev/ttyS0?

-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.




More information about the linux mailing list