Best way to access hardware ports?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

Best way to access hardware ports?

#1 Post by Pete »

Hi

Can anyone give me the advantages and disadvantages of the different methods of accessing hardware ports?

The four ways I know of are:

1) Use a script (for example to send something on the serial port) like echo -n "SomeData" > /dev/ttyS0

2) Access the hardware registers directly by way of a C pgm using outb

3) Some hardware also maps to sections in /dev/mem so could directly read/write to it

4) Use IOCTL

Thanks in advance.

Post Reply