WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Best way to access hardware ports?  (Read 2239 times)

Offline Paulo.

  • Newbie
  • *
  • Posts: 7
Best way to access hardware ports?
« on: April 02, 2014, 04:08:31 AM »
Hi all

What would be the best way to access some hardware ports with respect to security, ease and any other TC related advantages/disadvantages?
The options I was thinking 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

Any comments very welcome.
TIA.