/**执行****************************/
cd /opt/FriendlyARM/mini2440/linux-2.6.32.2
cp config_mini2440_n35 .config
make menuconfig
make zImage
/**生成****************************/
/opt/FriendlyARM/mini2440/linux-2.6.32.2/arch/arm/boot/zImage
/**执行****************************/
cd /opt/FriendlyARM/mini2440
mkyaffs2image root_qtopia root_qtopia.img
/**生成****************************/
/opt/FriendlyARM/mini2440/root_qtopia.img
/**开发板挂载NFS*******************/
mount -t nfs -o nolock 192.168.4.238:/opt/FriendlyARM/mini2440/root_qtopia /mnt/
/**驱动代码添加********************/
vi /opt/FriendlyARM/mini2440/linux-2.6.32.2/drivers/char/Kconfig //配置文件
~~~~添加格式如下:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
config MINI2440_HELLO_MODULE //对应的"驱动编译id"
tristate "Mini2440 module sample" //make menuconfig 中显示的"驱动id"
depends on MACH_MINI2440
default m if MACH_MINI2440
help
Mini2440 module sample.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cd /opt/FriendlyARM/mini2440/linux-2.6.32.2
make menuconfig //在新添加的"驱动id"切换'*''_''M'
vi /opt/FriendlyARM/mini2440/linux-2.6.32.2/drivers/char/Makefile
~~~~添加格式如下:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
obj-$(CONFIG_MINI2440_HELLO_MODULE) += mini2440_hello_module.o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--编译出.ok文件
cd /opt/FriendlyARM/mini2440/linux-2.6.32.2
make modules
--生成在/opt/FriendlyARM/mini2440/linux-2.6.32.2/drivers/char/mini2440_hello_module.ko
--拷贝至NFS目录
cd /opt/FriendlyARM/mini2440/linux-2.6.32.2/drivers/char/
cp 驱动名.ko /opt/FriendlyARM/mini2440/root_qtopia/
--切换到开发板终端,加载驱动模块
cd /mnt
mv 驱动名.ko /lib/modules/2.6.32.2-FriendlyARM/
cd /lib/modules/2.6.32.2-FriendlyARM/
insmod mini2440_hello_module.ko //装载,可为相对/绝对路径
rmmod mini2440_hello_module //卸载,注意不带.ko
/**NFS服务配置过程**************************/
服务器端: ubuntu 9.1.0 desktop PC
客户端 : firendlyARM linux-2.6.32.2开发板
以下是主要配置服务器端的NFS服务,使开发板可以直接访问到PC服务端的目录。
1 安装
sudo aptitude install nfs-kernel-server
sudo apt-get install nfs-common
2 改配置文件并生效
sudo gedit /etc/exports
sudo exportfs -r
3 重启服务
sudo /etc/init.d/portmap start
sudo /etc/init.d/nfs-kernel-server start
4 测试
mount -t nfs localhost:/opt/FriendlyARM/mini2440/root_qtopia /mnt/
mount -t nfs -o nolock 192.168.4.238:/opt/FriendlyARM/mini2440/root_qtopia /mnt/