For my thesis I am creating a Manet using the protocol ARAN. To install the protocol I'm using this manual, but the first step, the creation of trace_route, I received errors such as:
对于我的论文,我正在使用协议ARAN创建一个Manet。为了安装这个协议,我使用了这个手册,但是第一步,创建trace_route,我收到了一些错误,比如:
-linux/module.h: No such file or directory
-linux/procs_Fs: No such file or directory
-linux/skbuff: No such file or directory
I searched the web and found out that the problem is in the headers, but I do not find the solution ...
我搜索了网页,发现问题在标题中,但我找不到解决方案……
P.S. I am using Ubuntu 10.04 LTS Kernel 2.6.33 recompiled
我正在使用Ubuntu 10.04 LTS内核2.6.33重新编译。
2 个解决方案
#1
9
You're missing the Linux kernel headers which allow you to compile code against the Linux kernel.
您丢失了Linux内核头,它允许您编译针对Linux内核的代码。
To install just the headers in Ubuntu:
安装在Ubuntu的头文件:
$ sudo apt-get install linux-headers-$(uname -r)
To install the entire Linux kernel source in Ubuntu:
在Ubuntu中安装整个Linux内核源代码:
$ sudo apt-get install linux-source
Note that you should use the kernel headers that match the kernel you are running.
注意,您应该使用与正在运行的内核相匹配的内核头。
#2
3
**/*source file name is basic.c */**
#include <linux/init.h>
#include <linux/module.h>
/*MODULE_LICENSE("Dual BSD/GPL");*/
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
=====================================
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
now make file for ubuntu
/*at first type on ur terminal that $(uname -r) then u will get the version.. that is using on ur system */
/*在你的终端上键入$(uname -r)后,你将得到这个版本。这是在你的系统上使用*/。
obj-m +=basic.o
KDIR =//usr/src/linux-headers-3.13.0-44-generic
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.o *.ko *.mod.* *.symvers *.order
================================================
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
To run the code
$sudo insmode basic.ko
$dmesg
u will get the output
$sudo rmmod basic.ko
$dmesg
#1
9
You're missing the Linux kernel headers which allow you to compile code against the Linux kernel.
您丢失了Linux内核头,它允许您编译针对Linux内核的代码。
To install just the headers in Ubuntu:
安装在Ubuntu的头文件:
$ sudo apt-get install linux-headers-$(uname -r)
To install the entire Linux kernel source in Ubuntu:
在Ubuntu中安装整个Linux内核源代码:
$ sudo apt-get install linux-source
Note that you should use the kernel headers that match the kernel you are running.
注意,您应该使用与正在运行的内核相匹配的内核头。
#2
3
**/*source file name is basic.c */**
#include <linux/init.h>
#include <linux/module.h>
/*MODULE_LICENSE("Dual BSD/GPL");*/
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
=====================================
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
now make file for ubuntu
/*at first type on ur terminal that $(uname -r) then u will get the version.. that is using on ur system */
/*在你的终端上键入$(uname -r)后,你将得到这个版本。这是在你的系统上使用*/。
obj-m +=basic.o
KDIR =//usr/src/linux-headers-3.13.0-44-generic
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.o *.ko *.mod.* *.symvers *.order
================================================
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
To run the code
$sudo insmode basic.ko
$dmesg
u will get the output
$sudo rmmod basic.ko
$dmesg