Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-06-2008, 05:34 PM   #1
LQ Newbie
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
Able to open but Unable to read /dev/kmem

Hello All,

I am a kernel newbie and I was trying to run the 'checkidt' program to display the content of the IDT table. It successfully opens '/dev/kmem' using the fd_kmem = open('/dev/kmem',O_RDWR); function. after this statement value of fd_kmem = 3.

However, my program exists in the readkmem function by printing " Error read kmem"
I instead a perror message and got "Invalid Identifier".

The readkmem function is as follows

 void readkmem(void *m,unsigned off,int size)
        if(lseek(fd_kmem,off,SEEK_SET) != off)
                fprintf(stderr,"Error lseek. Are you root? \n");
        if(read(fd_kmem,m,size)!= size)
                fprintf(stderr,"Error read kmem\n");
Anyideas as to what is to be done to make the read successful.
Any help is appreciated.

Thanks in advance.
Old 04-22-2008, 10:12 AM   #2
LQ Addict
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,291

Rep: Reputation: Disabled
since no one else has replied I will start the ball rolling.

I do not know your function but it sounds like you are missing a kernel config option.

in the kernel there is an entire section on debugging kernel....can I suggest you re-compile with the lot turned on and see it that helps?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to read /dev/sdc madunix Linux - Enterprise 2 11-25-2007 08:06 AM
Read /dev/kmem failed sailershen Programming 5 03-21-2006 05:33 AM
mmap() of /dev/kmem - can it work? wwc Programming 1 02-04-2006 01:47 PM
Missing file /dev/kmem in Fedora 3 deardron Fedora 0 04-16-2005 12:12 PM
Volume control is unable to run correctly. Unable to open audio device '/dev/mixer'. sevenreams Slackware 1 05-16-2003 07:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration