Question: I've already completed part 1 and now working on part II. These codes are what i have so far: simple-solution.c: #include #include #include #include #include

 I've already completed part 1 and now working on part II.

These codes are what i have so far: simple-solution.c: #include #include #include

#include #include struct birthday { int month; int day; int year; char

*name; struct list_head list; }; static LIST_HEAD(birthday_list); int simple_init(void) { ________________________________ Makefile:

obj-m += simple-solution.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 Programming Projects Linux Kernel Modules

In this project, you will learn how to create a kernel module

and load it into the Linux kernel. The project can be completed

I've already completed part 1 and now working on part II.

These codes are what i have so far:

simple-solution.c:

#include

#include

#include

#include

#include

struct birthday

{

int month;

int day;

int year;

char *name;

struct list_head list;

};

static LIST_HEAD(birthday_list);

int simple_init(void)

{

________________________________

Makefile:

obj-m += simple-solution.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

Programming Projects Linux Kernel Modules In this project, you will learn how to create a kernel module and load it into the Linux kernel. The project can be completed using the Linux virtual machine that is available with this text. Although you may use an editor to write these C programs, you will have to use the terminal application to compile the programs, and you will have to enter commands on the command line to manage the modules in the kernel. As you'll discover, the advantage of developing kernel modules is that it is a relatively easy method of interacting with the kernel, thus allowing you to write programs that directly invoke kernel functions. It is important for you to keep in mind that you are indeed writing kernel code that directly interacts with the kernel. That normally means that any errors in the code could crash the system! However, since you will be using a virtual machine, any failures will at worst only require rebooting the system. Part I-Creating Kernel Modules The first part of this project involves following a series of steps for creating and inserting a module into the Linux kernel. Programming Projects 97 You can list all kernel modules that are currently loaded by entering the lsmod. This command will list the current kernel modules in three columns: name, size, and where the module is being used The following program (nam simple.c and available with the source code for this text) illustrates a very basic kernel module that prints appropriate messages when the kernel module is loaded and unloaded

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!