易截截图软件、单文件、免安装、纯绿色、仅160KB

Compile Linux Kernel Modules

我正在学习写linux device driver for embedded system.
我有一个linux嵌入式设备,也有这个设备的linux源代码。也有cross compiler tool chain.
第一步,就是写一个简单的hello模块,然后装到设备中。以验证我这个开发环境。
在网上搜索了一下, how to cross compile linux device driver
发现在linux代码根目录的Makefile中有关于cross compile的描述
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
# When performing cross compilation for other architectures ARCH shall be set
# to the target architecture. (See arch/* for the possibilities).
# ARCH can be set during invocation of make:
# make ARCH=ia64
# Another way is to have ARCH set in the environment.
# The default ARCH is the host where make is executed.
# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin-utils executables
# are prefixed with $(CROSS_COMPILE).
# CROSS_COMPILE can be set on the command line
# make CROSS_COMPILE=ia64-linux-
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
只要指定ARCH和CROSS_COMPILE就可以了。
在我的这个Makefile中,已经指定了ARCH=arm,CROSS_COMPILE=arm-linux-
因为在编译module的时候,使用的是内核构造系统,也就是使用的上面所说的这个在内核源码根目录的Makefile。所以我就不需要在我调用make的命令行中指定ARCH和CROSS_COMPILE了。
用来测试的hello模块的源码来自 http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html
hello.c
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/init.h> /* Needed for the macros */
static int __init hello_start(void)
{
printk(KERN_INFO "Loading hello module...\n");
printk(KERN_INFO "Hello world\n");
return 0;
}
static void


相关文档:

Amlogic open linux 编译环境安装 学习笔记

     由于工作需要现在开始从头学习linux,下面先记录amlogic openlinux安装步骤。(前提是安装了虚拟机)
Amlogic open linux 编译环境安装
一、gcc工具的安装
1、从Amlogic网站上下载gcc工具
  在下面下载Index of /download/linux/gnutools
 gnutools-arc2.2-p4-ubuntu-9.04-2010- ......

编译命令(amlogic open linux) 学习笔记

•所有编译调试命令都在ui_ref/trunk/bld_xxx下面执行,具体哪个bld要根据您使用的板子决定;
•Make #编译全部,包括kernel, busybox, packages等;
•Make root #编译文件系统;
•Make yaffs#把文件系统打包生成yaffs文件系统的映像rootfs.yaffsimage,并保存在build目录;
•编译内核
▫Make k. ......

Linux下安装MyEclipse

在安装完jdk以后,就来安装MyEclipse了。
 有一些安装了jdk以后没有生效,出现的还是1.4版本的。
所以安装MyEclipse7.0或者是6.5、6.6的都会出错
[root@gupt aaaa]# ll
总用量 380
dr-xr-xr-x  6 root root   4096
2009-01-17  configuration
-r--r--r--  1 root root   7 ......

libjpeg的ARM linux移植

一、下载jpeg库
二、配置编译,生成Makefile文件。
#./configure --prefix=/usr/arm/arm-linux --exec-prefix=/usr/arm/arm-linux \
--enable-shared --enable-static
注意:prefix是最后安装时库存放的文件,shared是编译成动态库,static是编译成静态库
三、修改生成的Makefile。
使用gedit Makefile
将CC ......

linux上使用rlwrap 解决oracle可以上下键查看命令

linux 上的oracle sqlplus 不能利用 上, 下 键来查看命令,搜索到解决问题的办法,整理如下
安装软件rlwrap可以解决这个问题,该软件是用c写的程序
官方下载地址:http://utopia.knoware.nl/~hlub/uck/rlwrap/
安装过程:
我们也可以查看解压后的tar包,查看README帮助文件
shell>tar -zxvf rlwrap-0.36.tar.gz
sh ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号