[国嵌攻略][102][内核驱动开发环境搭建]
服务器环境搭建
1.配置tftp服务器
1.1.设置tftp目录
vim /etc/xinetd.d/tftp
server_args = -s .../tftp
disable = no
1.2.启动tftp服务
/etc/init.d/xinetd restart
2.配置nfs服务器
2.1.设置nfs目录
vim /etc/exports
.../nfs *(rw,sync,no_root_squash)
2.2.启动nfs服务
/etc/init.d/nfs restart
bootloader环境搭建
1.解压bootloader
tar zxvf uboot_mini2440.tar.gz
2.清除bootloader
cd uboot_mini2440
make distclean
3.配置bootloader
make mini2440_config
4.编译bootloader
make ARCH=arm CROSS_COMPILE=arm-linux-
5.下载bootloader
insmod usb.ko
./dnw u-boot.bin 30008000
6.设置网络环境变量
setenv ethaddr 12:34:56:78:9A:BC
setenv ipaddr 192.168.1.230
setenv serverip 192.168.1.xxx
saveenv
7.测试网络连接情况
ping 192.168.1.xxx
8.设置启动环境变量
8.1.设置tftp下载并启动内核
setenv bootcmd tftp 31000000 uImage \; bootm 31000000
8.2.设置nfs挂载根文件系统
setenv bootargs noinitrd console=ttySAC0,115200 init=/init root=/dev/nfs rw nfsroot=192.168.1.101:.../rootfs ip=192.168.1.230:192.168.1.101:192.168.1.1:255.255.255.0::eth0:off
saveenv
rootfs环境搭建
1.创建系统目录
mkdir rootfs
cd rootfs
mkdir bin dev etc lib mnt proc sbin sys tmp usr var
mkdir usr/bin usr/lib usr/sbin lib/modules
2.创建设备文件
cd dev
mknod -m 666 console c 5 1
mknod -m 666 null c 1 3
3.添加配置文件
tar zxvf etc.tar.gz
cp -rf etc/* rootfs/etc/
4.添加系统工具
4.1.解压busybox
tar zxvf busybox-1.13.3.tar.gz
4.2.清除busybox
make distclean
4.3.配置busybox
cd busybox-1.13.3
make menuconfig
busybox settings->build options->[*]build busybox as a static binary
busybox settings->build options->(arm-linux-)cross compiler prefix
busybox settings->installation options->[*]don’t use /usr
busybox settings->installation options->(.../rootfs)busybox installation prefix
4.4.编译busybox
make
4.5.安装busybox
make install
kernel环境搭建
1.解压kernel
tar zxvf linux-mini2440.tar.gz
2.清除kernel
cd linux-mini2440
make distclean
3.配置kernel
3.1.加载配置文件
make menuconfig ARCH=arm
load an alternate configuration file->.config->exit->save
3.2.配置文件系统
make menuconfig ARCH=arm
general setup->[ ]initial ram filesystem and ram disk
file systems->[*]network file systems->[*]root file system on nfs
4.编译kernel
4.1.复制mkimage工具
cp .../uboot_mini2440/tools/mkimage /bin
4.2.编译kernel
make uImage ARCH=arm CROSS_COMPILE=arm-linux-
5.编译kernel模块
make modules ARCH=arm CROSS_COMPILE=arm-linux-
6.安装kernel模块
make modules_install ARCH=arm INSTALL_MOD_PATH=.../rootfs
7.复制Image到tftp目录下
cp kernel/arch/arm/boot/uImage .../tftp
8.复制rootfs到nfs目录下
cp rootfs/* .../nfs -rf