Hi Prasad,
question is: anyother way to access like iopl(3) function?.
FYI, With iopl it is possible. But in my kernel i could not locate iopl function. Is there any similar function like iopl so that i will set the permission as root id.
On Sun, Apr 3, 2011 at 3:47 PM, Prasad Joshi <prasadjoshi124@xxxxxxxxx> wrote:
On Sun, Apr 3, 2011 at 6:11 PM, Sengottuvelan SI am not sure, but after reading the manpage, it looks like iopl will
<sengottuvelan.s@xxxxxxxxx> wrote:
> Hi All,
>
> I am trying to access /dev/mem in my user process. I could not access
> because not a privileged access. I tried to use iopl(3) call in linux 2.6,
give access to the IO ports not the files.
If you look at the file permission, you will notice only root has
> but i am getting unresolved symbol for this. Is any other way to get access
> in user process. I am not sure how to solve this. Can you someone throw some
> light on this.
>
> if(iopl(3)){
> fprintf(stderr, "Cannot get I/O permissions (being root helps)");
> return -1;
> }
> if ((fd = open("/dev/mem", O_RDWR | O_SYNC)) < 0) {
> fprintf(stderr, "Failed to open /dev/mem");
> return -1;
> }
permission to write the /dev/mem
$ ls -l /dev/mem
crw-r----- 1 root kmem 1, 1 2011-04-03 08:42 /dev/mem
Opening it for read/write will surely fail.
Thanks and Regards,
Prasad
>
> --
> Regards,> _______________________________________________
> S. Sengottuvelan.
>
> --
> Regards,
> S. Sengottuvelan.
>
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
--
Regards,
S. Sengottuvelan.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies