LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-06-2008, 06:34 PM   #1
hshrishrimal
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

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

Thanks in advance.
 
Old 04-22-2008, 11:12 AM   #2
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

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?
 
  


Reply


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 09:06 AM
Read /dev/kmem failed sailershen Programming 5 03-21-2006 06:33 AM
mmap() of /dev/kmem - can it work? wwc Programming 1 02-04-2006 02:47 PM
Missing file /dev/kmem in Fedora 3 deardron Fedora 0 04-16-2005 01:12 PM
Volume control is unable to run correctly. Unable to open audio device '/dev/mixer'. sevenreams Slackware 1 05-16-2003 08:29 PM


All times are GMT -5. The time now is 08:40 AM.

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