Embeded system 1
来源:互联网 发布:.js文件如何打开 编辑:程序博客网 时间:2024/06/05 15:24
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
应用程序字符设备文件
字符设备驱动
字符设备
块设备文件
块设备驱动
块设备
套接字
协议栈
网络设备驱动
网络接口设备
0 0
- Embeded system 1
- c for embeded system
- embeded system stuff
- embeded linux system create
- embeded system c
- 为什么选择嵌入式(Embeded System)开发
- My beginning in embeded system--ARM7
- 读书笔记《Building Embeded Linux System》第九章建立Bootloader
- Tomcat Embeded
- qt embeded
- Embeded Jetty
- perl embeded into c++
- Konqueror/Embeded 的移植
- fpga embeded devices center
- Embeded Software Design
- embeded 的相关链接
- Qt-embeded安装
- Embeded linux 技术博客
- 输入两个字符串,比如abdbcc和abc,输出第二个字符串在第一个字符串中的连接次序(递归方法)
- uva 10401 - Injured Queen Problem
- log4perl perl日志库
- FPGA系统设计之设计前的思考
- POJ 3254 Corn Fields(状态压缩dp)
- Embeded system 1
- 杭电 2149(巴什博弈)
- 3、通信工具编写HttpClient
- cocos2d-x 触屏事件详解
- 【UVA】10130-SuperSale(01背包)
- 内存池的内存地址对齐和长度按照2的幂取整
- 个人博客网建站优化经验总结(下)
- hdu 1272 小希的迷宫
- ios --- 动态获取键盘高度