From: telent997@gmail.com (Pei Lin)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Cannot get I/O permissions
Date: Wed, 6 Apr 2011 11:30:32 +0800 [thread overview]
Message-ID: <BANLkTins5L7BNcULtsJfAdnijR7Npc+3Vw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikL-Tyeanmu2ehCqh+n-p9QJbaVaA@mail.gmail.com>
2011/4/2 Sengottuvelan S <sengottuvelan.s@gmail.com>:
>
> On Fri, Apr 1, 2011 at 3:32 PM, Sengottuvelan S <sengottuvelan.s@gmail.com>
> wrote:
>>
>> Hi All,
>>
>> I am trying to access /dev/mem in my user process. I could not access
Check the kernel config CONFIG_STRICT_DEVMEM
>> because not a privileged access. I tried to use iopl(3) call in linux 2.6,
>> 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;
>> ??? }
>>
>> --
>> Regards,
>> S. Sengottuvelan.
>
>
>
> --
> Regards,
> S. Sengottuvelan.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
--
Best Regards
Lin
prev parent reply other threads:[~2011-04-06 3:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BANLkTimVusN58K-aUpkYmshHKh3Hy8Bb6g@mail.gmail.com>
2011-04-01 22:32 ` Cannot get I/O permissions Sengottuvelan S
2011-04-06 3:30 ` Pei Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTins5L7BNcULtsJfAdnijR7Npc+3Vw@mail.gmail.com \
--to=telent997@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).