by jlmunix » Thu Apr 15, 2010 11:08 pm
by jlmunix
Thu Apr 15, 2010 11:08 pm
I want to use the GPIO ports of the Roboard without sudo command. So i decided to make a simple program to enable permissions to the ports.
- Code: Select all
void main(void)
{
int alm;
iopl(3);
if (ioperm(0x98, 3, 1)) //Set the permission to the port.
{
perror("ioperm");
exit(1);
}
}
If i run this program with sudo when i turn on the roboard, i will be able to use the ports from user speace without specifying the sudo command! It works (i tested)
But my question is, what´s up if i let all GPIO with write permission always? can i make a damage?
From here im enabled to R/W port with simple instruction:
- Code: Select all
outportb(0x98, 0xff);
I want to use the GPIO ports of the Roboard without sudo command. So i decided to make a simple program to enable permissions to the ports.
- Code: Select all
void main(void)
{
int alm;
iopl(3);
if (ioperm(0x98, 3, 1)) //Set the permission to the port.
{
perror("ioperm");
exit(1);
}
}
If i run this program with sudo when i turn on the roboard, i will be able to use the ports from user speace without specifying the sudo command! It works (i tested)
But my question is, what´s up if i let all GPIO with write permission always? can i make a damage?
From here im enabled to R/W port with simple instruction:
- Code: Select all
outportb(0x98, 0xff);