On Fri, 18 Jan 2002 18:20:18 Rahul Saxena wrote:
hi everyone,
I was tryign to read/write bits to 0x378 I/O port, using the ioperm() system call. But this allows only the root to access.
I think you should explore better ways than directly allowing the users to access the port, like writing a device driver module. Not that I've ever done that, but I have this wariness for allowing users to access the hardware directly. That was the DOS way of doing it, right?
HOw do normal users access the port? i did read about SETUID(), but i dont really understand how it works for me ??
# chown root:root <filename> # chmod a+sx <filename>
does anyone have any pointers on this ??
Also i am trying to uderstand how ot access using read and write. for that i would need to add the user as part of the group, which can access /dev/port.
How do i add myself to the group? i guess.. in that case i wont be in my original group.
I really think it would be best if you do it the accepted way (I consiously avoided the word "right" :-). Normal users aren't supposed to be accessing I/O ports directly. Try going thru _Linux Device Drivers_ by O'Rilley Publications for enlightenment.
Thanks for reading
-rahul
-- Tahir Hashmi (VSE, NCST) http://tahirhashmi.scriptmania.com mailme@tahirhashmi.scriptmania.com
We, the rest of humanity, wish GNU luck and Godspeed
--- Tahir Hashmi tahirbond@lycos.com wrote:
# chown root:root <filename> # chmod a+sx <filename>
Thanks for the help !
Also i am trying to uderstand how ot access using
read
and write. for that i would need to add the user as part of the group, which can access /dev/port.
How do i add myself to the group? i guess.. in that case i wont be in my original group.
I really think it would be best if you do it the accepted way (I consiously avoided the word "right" :-). Normal users aren't supposed to be accessing I/O ports directly. Try going thru _Linux Device Drivers_ by O'Rilley Publications for enlightenment.
Actually i was asking this because, we are planning to inteface external hardware to the paralle port and its a stand alone system. (in that case even if we are the root) it wont make a difference, i suppose?
would it be better if we ran the system in single user mode ???
-rahul
__________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/
Sometime on Jan 19, Rahul Saxena assembled some asciibets to say:
How do i add myself to the group? i guess.. in that case i wont be in my original group.
No, you can be a member of n groups at one time. Pick your choice of n.
would it be better if we ran the system in single user mode ???
No, it isn't a good idea. It isn't a good idea to work as root either, even if you trust everyone involved. Mistakes happen.