Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: Paulo. on April 02, 2014, 01:08:31 AM

Title: Best way to access hardware ports?
Post by: Paulo. on April 02, 2014, 01: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.