linux 2.6 内核模块的Makefile
Linux 2.6 下内核模块的Makefile
收藏
Linux 2.6 下内核模块的Makefile
# Makefile 2.6
obj-m += hello.o
KDIR:=/lib/modules/$(shell uname -r)/build
# PWD=$(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
obj-m := hello.o表示编译后生成hello.o模块。
$(KDIR) 指定了内核源码的路径,“M=”表示这是个外部模块,M=$(PWD) 指定了该模块文件所在的路径。
注: makefile
预定义了$(PWD)
变量,此处可以不必重复定义。
如果是多个源文件编译出一个模块,假设模块名是test.ko,那么源文件名不能有test.c
obj-m := test.o
test-objs := file1.o file2.o file3.o
KDIR := /lib/modules/$(shell uname -r)/build
#PWD := $(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
一个简单的内核模块示例:hello.c
#include <linux/module.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
static int __iinit hello_init(void)
{
printk("hello, world\n");
return 0;
}
static void __exit hello_exit(void)
{
printk("goodbe\n");
}
module_init(hello_init);
module_exit(hello_exit);
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
At first, GCC is used for GNU C Compiler. At present,it supports JAVA Ada C++ and so on.
GCC编译流程分为:
1.Pre-Processing(预处理)
gcc -E -o hello.i hello.c
选项-E 使得编译器在预处理结束时停止编译
选项-o 指定GCC的输 ......
运行了Oracle的Linux服务器更改主机名
假如要把主机名改为oratest。
$表示oracle用户操作;
#表示root用户操作。
DB:oracle10.2
OS:RHEL4.5
第一步,关闭数据库和监听,dbconsole:
$ dbshut
$ lsnrctl stop
第二部:
# hostname oratest
第三步:
# vi /etc/sysconfig/network
更改hostname参数。
第四步 ......
来源: http://www.xxlinux.com/linux/article/accidence/technique/20070125/7209.html
User Debug 日志记录
调试一个崩溃的程序的第一步是弄清哪里出了错。zSeries 上的Linux内核具有这样一个内置特性,它在用户进程崩溃时记录一些基本的调试信息。要启用这个特性,请以 root 用户身份执行如下命令:
echo 1 >& ......
这里记录Redhat Linux中的一些常用服务和配置工具。版本基于AS4。
1.Firewall
通过命令行配置:lokkit
图形界面配置:Applications->System Settings->Security Level
2.samba
/etc/init.d/smb start | /etc/init.d/smb stop | /etc/init.d/smb restart
或者
service smb start | service smb stop | servic ......