Download Solution: Click to Download Solution
Solution File Name: CLinuxKernelIterateBirthdayStruct.docx
Unzip Password: prestobear.com
1.assignment.c
#include < linux/init.h >
#include < linux/module.h >
#include < linux/kernel.h >
#include < linux/list.h >
#include < linux/slab.h >
struct birthday {
int day;
int month;
int year;
struct list_head list;
};
struct list_head birthday_list;
struct birthday *createBirthday(int day, int month, int year) {
}
void printInfo(char *str) {
printk(KERN_INFO "The info: %s", str);
}
/* This function is called when the module is loaded. */
int simple_init(void) {
}
/* This function is called when the module is removed. */
void simple_exit(void) {
}
/* Macros for registering module entry and exit points. */
module_init( simple_init );
module_exit( simple_exit );
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Simple Module");
MODULE_AUTHOR("My Name");
2.Makefile
obj-m+=assignment.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