لطفا وارد شوید یا ثبت‌نام کنید تا به انجمن‌ها دسترسی کامل داشته باشید.



 
امتياز موضوع :
  • 0 رأي - معدل امتيازات : 0
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with writing module
2005-10-15, 07:05 PM,
ارسال : #1
Problem with writing module
Hello
I am new in making module in linux ,I treid the first module programming as you see as follows
/*
* hello-1.c - The simplest kernel module.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}

Then the tutorials told me for comoling the module I should use the following commands

obj-m += hello-1.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

would you please explain me what is $(sehll uname –r) and M=$(PWD)

Sincerely yours Mohsena
نقل قول این ارسال در یک پاسخ


پيام هاي اين موضوع
Problem with writing module - توسط مهمان - 2005-10-15, 07:05 PM
[بدون عنوان] - توسط مهمان - 2005-10-17, 07:59 AM,
[بدون عنوان] - توسط Saied - 2005-10-17, 06:20 PM,

رفتن به انجمن :


کاربران در حال مشاهده موضوع : 1 مهمان