android linux 基础知识小结

android linux 基础知识总结

android linux 基础知识总结

===================================================
linux ,Android基础知识总结
1. Android编译系统分析
2. 文件系统分析
3. 制作交叉工具链
4. 软件编译常识
5. 设置模块流程分析
6. linux系统启动流程分析
7. linux下svn使用指南
8. LFS 相关
9. linux 内核的初步理解
====================================================

================
android系统开发指南(常用环境的搭建和使用)
说明:
有的步骤会用到脚本简化操作,脚本通过svn服务器获取:
svn co svn://192.168.2.148/smartphone/td0901/release/images/scripts
用户名为各位的姓名拼音,密码与用户名相同

一 编译android源码,制作文件系统
二 ubuntu下烧录内核和文件系统

一 编译android源码,制作文件系统
1. 开发主线源码位置:
svn://192.168.2.148/smartphone/td0901/trunk/cupcake-jianping //cupcake 源代码
svn://192.168.2.148/smartphone/td0901/trunk/linux-2.6.28-a1 //内核源代码
2. 打标的源代码位置
svn list svn://192.168.2.148/smartphone/td0901/tag
我们可以通过 svn list svn://192.168.2.148/smartphone 查看svn版本库内核
更多信息请参卡以下文档:
http://192.168.2.148/svn/smartphone/
http://192.168.2.148/svn/smartphone/智能平台开发部资料管理手册V1.0.doc
http://192.168.2.148/svn/smartphone/linux下svn操作指南及规范.doc
用户名为各位的姓名拼音,密码与用户名相同

3. 编译源码
进入 cupcake 工作拷贝的顶层目录,执行:
. ./make_image15.sh
部分执行结果:
out/target/product/littleton/root/ 内核需要使用的 initramfs
out/target/product/littleton/system 文件系统的系统分区
out/target/product/littleton/data/ 文件系统数据分区

4. 编译内核
此处内核编译主要针对驱动组之外的同事
1> 设置工具链
内核的 linux-2.6.28-a1/Makefile 中设定了:
CROSS_COMPILE ?= arm-linux-
所以设置PATH环境变量,保证能找到正确的工具链
假设工具链位于: /usr/local/marvell-arm-linux-4.1.1/ 设置为:
export PATH:=/usr/local/marvell-arm-linux-4.1.1/bin/:$PATH

2> 更改编译选项(网络启动或者本机启动)
内核顶层目录执行:
make menuconfig
General setup --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
() Initramfs source file(s) (NEW)
如果需要支持网络启动反选 [] Initial RAM filesystem and RAM disk (initramfs/initrd) support
如果需要支持本地启动选中 [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
设置 () Initramfs source file(s) (NEW) 为 root
拷贝 cupcake 编译结果 out/target/product/littleton/root/ 到内核顶层目录

3> 编译
内核顶层目录执行 make zImage
编译好的内核:
arch/arm/boot/zImage

5. 搭建网络开发环境
1> 安装nfs服务器
sudo apt-get install nfs-kernel-server nfs-common
2> 修改nfs服务器配置文件/etc/exports ,确保有以下配置项
/nfsroot/rootfs *(rw,no_root_squash,sync)
我们在内核中已经固定,手机通过网络方式启动,默认从 /nfsroot/rootfs
读取文件系统,修改配置项后需要重启nfs服务器:
sudo /etc/init.d/nfs-kernel-server restart
3> 配置网络根文件系统
拷贝 out/target/product/littleton/root/ 内容到 /nfsroot/rootfs 目录
拷贝 out/target/product/littleton/system 内容到 /nfsroot/rootfs/system
修改 /nfsroot/rootfs/init.rc 去掉几个mount命令
为了使大家的过程,结果统一,可以使用脚本 mkfs.cupcake 完成
在执行 mkfs.cupcake.nfs 脚本前先到 cupcake-jianping 目录下执行: . ./make_env15.sh设置环境变量,
获取通过手动输入android源码的位置,让脚本来设置环境变量。

二 ubuntu下烧录内核和文件系统
1. 硬件:
手机一台
usb转串口线一根
usb转网卡线一根

2. 软件环境
1> tftp 服务器
执行脚本: setup_tftpd.sh 安装和配置tftp服务器,我们默认以 /tftpboot
为 tftp服务器的根目录,需要下载的文件都放在该目录下。

2> 获取待烧录的镜像文件
svn list svn://192.168.2.148/smartphone/td0901/release/images 查看服务器上的
版本情况,通常我们下载最新的,例如,下载9月18号发布的版本:
svn co svn://192.168.2.148/smartphone/td0901/release/images/images20090918

3> 烧录镜像文件
用以下文件为例,示范通过tftp烧写内核和文件系统
内核 zImage0917
系统分区: system0918.img
数据分区 data0918.img
待烧写的以上文件必须存在于tftp服务器根目录/tftpboot下。
具体步骤:
首先连接好硬件设备进入blob下载模式
1> blob 起来后按任意键
Processing obm parameters...
Can't detect micco. Set PMIC as normal I2C mode.

NAND flash(Manu=0x98 Device=0xba) detected!
Slot 0 Found
get relocation table
Found Main Bad block table at address 0x0f000000, version 0x01
Found Mirror Bad block table at address 0x0efc0000, version 0x01

Consider yourself BLOBed!

blob version 2.0.5-pre3 for Marvell Littleton
Copyright (C) 1999 2000 2001 2002 2003 Jan-Derk Bakker and Erik Mouw
blob comes with ABSOLUTELY NO WARRANTY; read the GNU GPL for details.
This is free software, and you are welcome to redistribute it
under certain conditions; read the GNU GPL for details.
length not align with page size, change to 0x0
Read flash from 0x60000, length 0x0
Done
Autoboot (2 seconds) in progress, press any key to stop ..
Autoboot aborted
Type "help" to g

android linux 基础知识小结

相关文章:

你感兴趣的文章:

标签云: