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");
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.