Linux驱动的配置和编译脚本
在完成了驱动程序代码的编写之后,接下来的任务就是编译。linux内核编译的过程是通过内核源码的根目录和各子目录中的Makefile分级管理的。其中根目录的Makefile是最重要的,它可以看成是其他Makefile最初的入口。它负责定义所有与体系结构无关的变量和目标,读取.config文件,并根据其信息最终生成vmlinux(elf格式的Linux内核)和modules(模块)。make通过向下递归调用子目录下的Makefile来编译这两个目标。
通常希望把驱动程序放在内核里,在配置内核时可以自由裁剪。这需要对内核配置脚本Kbuild有一定得了解。具体可以参考内核源码中的Documentation/kbuild目录下的相关文档
Kbuild是一组很容易使用的脚本。通常只需要关心个目录下的两个文件:Kconfig(2.6内核)和Makefile。
以hello模块为例
step1:代码编写
mini2440_hello_module.c 放置的位置/opt/FriendlyARM/mini2440/linux2.6.29/drivers/char
代码如下
/**********************************************************************************************/
/*文件:mini2440_hello_module.c */
/*简介:HelloWorld */
/***********************************************************************************************/
#include<linux/init.h>
#include<linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_module_init(void)
{
printk(KERN_ALERT"Hello,world\n");
return 0;
}
static void hello_module_exit(void)
{
printk(KERN_ALERT"Goodbye, world\n");
}
module_init(hello_module_init);
module_exit(hello_module_exit);
step2: 在char 目录下打开Kconfig(可以理解为是内核的配置脚本)
添加
config MINI2440_HELLO_MODULE
tristate "Mini2440/QQ2440 module sample"
depends on ARCH_S3C2440
default m if MACH_FRIE
相关文档:
1.监视内存
free -mt
total used free shared buffers cached
Mem: ......
来源:http://linux.chinaunix.net/ebook/doc/2009/09/17/1135830.shtml
本文介绍在centos 5.x环境下通过yum源的扩展使用munin、 monit、ntop工具来监管你的应用程序和服务器。题为懒人说说的是简便的安装方式而已,将强大的功能配置简单的应用起来是很重要的,可以节省时间并提高效率。
Monit:http:#www.tildeslas ......
我用的Java版本为1.4,用1.5的时候说是有不安全的操作,无法编译、运行。
下载最新版本,BRITE.tar.gz
$ gunzip BRITE.tar.gz
$ tar xvf BRITE.tar
$ cd BRITE/
$ make all
编译完成,运行BRITE
$ ./brite &
主要的问题 ......
Ubuntu 10.04 brings Linux closer to the mainstream
No Windows viruses. Free. Any questions?
Of course. Start with this one: How can an operation system with those virtues, the open-source Linux, remain confined to a tiny minority of desktop and laptop computers at home?
Linux may run TiVo video r ......
我用的是 fedora 12 自待的jdk 1.6 在 /usr/lib/jvm/java-1.6.0-openjdk
第一步:把apache-tomcat-6.0.26.tar.gz解压后放到/usr/local/下重命名为apache-tomcat-6.0.26
第二步:在/etc/profile文件中适当的位置添加如下环境变量
CATALINA_HOME=/usr/local/apache-tomcat-6.0.26
CATALINA_BASE=/usr/local/apache-tomcat ......