Question: *NEED help to correct these errors (as showed below). Please provide the actual solution file jiffies.c with fixed error. ___________________________________ jiffies.c #include #include #include #include

*NEED help to correct these errors (as showed below). Please provide the actual solution file jiffies.c with fixed error.

*NEED help to correct these errors (as showed below). Please provide the

___________________________________

jiffies.c

#include #include #include #include #include #include #include #include #include

#define PROC_NAME "jiffies"

MODULE_LICENSE("GPL 2");

static int myInit(void); static void myExit(void);

struct proc_dir_entry *my_proc;

/* Read operation on proc */ ssize_t read_data(struct file *fp, char *buf, size_t len, loff_t * off) { static int completed=0; if(completed) { completed=0; return 0; } completed=1;

/* find out current value of jiffies */

sprintf(buf, "Value of jiffies %lu ", jiffies); return strlen(buf); }

/* File operation on proc */ static struct file_operations fops = { .owner=THIS_MODULE, .read=read_data, };

/* Init of kernel module */ static int __init myInit(void) {

/* Create proc file with name of jiffies */ my_proc = proc_create(PROC_NAME, 0666, NULL, &fops);

if(my_proc == NULL){ printk(KERN_INFO "Error to create proc File "); return -1; }

return 0; } /* exit of kernel module */ static void myExit(void) { remove_proc_entry(PROC_NAME,NULL); return; }

module_init(myInit); module_exit(myExit);

__________________________

Makefile

obj-m += jiffies.o

all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

student@ubuntu:/assign2 $ make make -C /lib/modules/2.6.11/build M=/home/student/assign2 modules make[1]: Entering directory ./home/student/linux-2.6.11' CC [M] /home/student/assign2/jiff.o home/student/assign2/jiff.c:34: warning: initialization from incompatible point er type home/student/assign2/jiff.c: In function 'my Init': home/student/assign2/jiff.c:39: warning: implicit declaration of function proc _create' home/student/assign2/jiff.c:39: warning: assignment makes pointer from integer without a cast home/student/assign2/jiff.c: In function exittest': home/student/assign2/jiff.c:54: error: myEit' undeclared (first use in this fu mction) home/student/assign2/jiff.c:54: error: (Each undeclared identifier is reported only once home/student/assign2/jiff.c:54: error: for each function it appears in.) home/student/assign2/jiff.c: At top level: home/student/assign2/jiff.c:48: warning: myExit' defined but not used make[2]: *** [/home/student/assign2/jiff.o] Error 1 make[1]: *** [_module_/home/student/assign2] Error 2 make[1]: Leaving directory home/student/linux-2.6.11' make: *** [all] Error 2 student@ubuntu:/assign2 $

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!