I am trying to invoke show_mem() from mm.h in a user defined kernel module. When I compile it shows show_mem undefined. I am running Ubuntu 14.04 and have a compiled linux kernel 3.19.
/*
* Author - [Deepak]
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/init.h> /* Needed for the macros */
#include <linux/mm.h> /* Needed for show_mem */
#include <asm/cacheflush.h>
#include <linux/mm.h>
static char *user_data1 __initdata = "Hello World";
static int *user_data2 __initdata = 2;
static int __init starter(void)
{
printk(KERN_INFO "[ds494] Loading Hello2 module - %s %d \n",user_data1,user_data2);
show_mem(1);
return 0;
}
static void __exit ending(void)
{
printk(KERN_INFO "[ds494] Exiting Hello2 module - Goodbye World 2\n");
}
module_init(starter);
module_exit(ending);
And below is the make file -
obj-m += memmod.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
And I get the below error -
**MODPOST 1 modules
WARNING: "show_mem" [/home/deepak/cs680/hw/homework_4/memmod.ko] undefined!
LD [M] /home/deepak/cs680/hw/homework_4/memmod.ko
make[1]: Leaving directory '/home/deepak/Downloads/linux-3.19'**
Any suggestions, please.
Aucun commentaire:
Enregistrer un commentaire