1、查看编译器默认搜索路径 http://www.tuicool.com/articles/AbyeimN
echo 'main(){}'|arm-linux-gcc -E -v - 正常情况下,makefile都不用设置include和lib路径,会自动寻找,但不要在交叉编译makefile中添加-I /usr/include等类似选项,否则回到本地gcc路径找,-I选项头文件搜索优先级高于默认;
2、头文件搜索路径
http://blog.csdn.net/melong100/article/details/6823262
※所以 header file 的搜寻会从 -I 开始
※然后找 gcc 的环境变量 C_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATH
※再找内定目录
3、printenv
printenv PATH
setenv file test //set
setenv file test1 //modify
setenv file //del
saveenv //to flash
tftp:
setenv ethaddr 12:34:56:78:9A:BC
setenv ipaddr 192.168.0.103 board ip
setenv serverip 192.168.0.102 tftp serverip
tftp c0008000 uImage
memory look up:
md.b c0008000 (.w .l) look
mm c0008000 modify
nand:
nand info
nand erase start length
nand write c0008000(mem addr) 80000(flash addr) 500000(length)
nand read c0008000(mem addr) 80000(flash addr) 500000(length)
download kernel to mem addr
tftp c0008000 uImage
bootm c0008000
bdinfo (show board info)
auto boot:
setenv bootcmd tftp c0008000 uImage \; bootm c0008000
saveenv
make uImage ARCH=arm CROSS_COMPILE=arm-linx- (uImage uboot_header)
cd arch/arm/boot uImage
make bzImage
cd rootfs
mkdir bin dev etc lib proc sbin sys usr mnt tmp var
mkdir usr/bin usr/lib usr/sbin lib/modules
cd dev
mknod -m 666 console c 5 1
mknod -m 666 null c 1 3
cd ..
tar etc.tar.gz -C /xxx/rootfs
make modules ARCH=arm CROSS_COMPILE=arm-linx-
make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs
a.进入 Busybox Settings ->
build Options->
v 选中 “Build busybox as a staticbinary ”, 静态链接
v Cross Compilerprefix (arm-linux-)
Installation Options->
v 选中 “Don‘t use/usr”, 选中该项可以避免busy box 被安装到宿主系统的
/usr目录下,破坏宿主系统
v BusyboxInstallation Prefix(/xxx/rootfs)
该选项表明编译后的busy box的安装位置
make ARCH=arm CROSS_COMPILE=arm-linx-
make install
cd rootfs/bin (so many command...!)
make menuconfig ARCH=arm (set your rootfs path...)
cd rootfs
ln -s ./bin/busybox init
cd linux_kernel
make uImage ARCH=arm CROSS_COMPILE=arm-linx- (add rootfs to uImage)
...tftp download and boot
make menuconfig ARCH=arm (set nfs and rootfs path...)
make uImage ARCH=arm CROSS_COMPILE=arm-linx-
...tftp download and bootm
字符设备文件
字符设备驱动
字符设备
块设备文件
块设备驱动
块设备
套接字
协议栈
网络设备驱动
网络接口设备
echo 'main(){}'|arm-linux-gcc -E -v - 正常情况下,makefile都不用设置include和lib路径,会自动寻找,但不要在交叉编译makefile中添加-I /usr/include等类似选项,否则回到本地gcc路径找,-I选项头文件搜索优先级高于默认;
2、头文件搜索路径
http://blog.csdn.net/melong100/article/details/6823262
※所以 header file 的搜寻会从 -I 开始
※然后找 gcc 的环境变量 C_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATH
※再找内定目录
3、printenv
printenv PATH
setenv file test //set
setenv file test1 //modify
setenv file //del
saveenv //to flash
tftp:
setenv ethaddr 12:34:56:78:9A:BC
setenv ipaddr 192.168.0.103 board ip
setenv serverip 192.168.0.102 tftp serverip
tftp c0008000 uImage
memory look up:
md.b c0008000 (.w .l) look
mm c0008000 modify
nand:
nand info
nand erase start length
nand write c0008000(mem addr) 80000(flash addr) 500000(length)
nand read c0008000(mem addr) 80000(flash addr) 500000(length)
download kernel to mem addr
tftp c0008000 uImage
bootm c0008000
bdinfo (show board info)
auto boot:
setenv bootcmd tftp c0008000 uImage \; bootm c0008000
saveenv
4 arm kernel compile:
make menuconfig ARCH=armmake uImage ARCH=arm CROSS_COMPILE=arm-linx- (uImage uboot_header)
cd arch/arm/boot uImage
x86 kernel compile:
make menuconfigmake bzImage
4-1 linux os: kernel + file system (how to create file system ?)
mkdir rootfscd rootfs
mkdir bin dev etc lib proc sbin sys usr mnt tmp var
mkdir usr/bin usr/lib usr/sbin lib/modules
cd dev
mknod -m 666 console c 5 1
mknod -m 666 null c 1 3
cd ..
tar etc.tar.gz -C /xxx/rootfs
make modules ARCH=arm CROSS_COMPILE=arm-linx-
make modules_install ARCH=arm INSTALL_MOD_PATH=/xxx/rootfs
busybox:
进入busybox目录执行 make menuconfiga.进入 Busybox Settings ->
build Options->
v 选中 “Build busybox as a staticbinary ”, 静态链接
v Cross Compilerprefix (arm-linux-)
Installation Options->
v 选中 “Don‘t use/usr”, 选中该项可以避免busy box 被安装到宿主系统的
/usr目录下,破坏宿主系统
v BusyboxInstallation Prefix(/xxx/rootfs)
该选项表明编译后的busy box的安装位置
make ARCH=arm CROSS_COMPILE=arm-linx-
make install
cd rootfs/bin (so many command...!)
4- 3.3 initramfs: release
cd linux_kernelmake menuconfig ARCH=arm (set your rootfs path...)
cd rootfs
ln -s ./bin/busybox init
cd linux_kernel
make uImage ARCH=arm CROSS_COMPILE=arm-linx- (add rootfs to uImage)
...tftp download and boot
nfs: debug
cd linux_kernelmake menuconfig ARCH=arm (set nfs and rootfs path...)
make uImage ARCH=arm CROSS_COMPILE=arm-linx-
...tftp download and bootm
5 driver
应用程序字符设备文件
字符设备驱动
字符设备
块设备文件
块设备驱动
块设备
套接字
协议栈
网络设备驱动
网络接口设备