linuxAndroid基础知识总结.docx

上传人:b****0 文档编号:9341800 上传时间:2023-05-18 格式:DOCX 页数:138 大小:80.24KB
下载 相关 举报
linuxAndroid基础知识总结.docx_第1页
第1页 / 共138页
linuxAndroid基础知识总结.docx_第2页
第2页 / 共138页
linuxAndroid基础知识总结.docx_第3页
第3页 / 共138页
linuxAndroid基础知识总结.docx_第4页
第4页 / 共138页
linuxAndroid基础知识总结.docx_第5页
第5页 / 共138页
linuxAndroid基础知识总结.docx_第6页
第6页 / 共138页
linuxAndroid基础知识总结.docx_第7页
第7页 / 共138页
linuxAndroid基础知识总结.docx_第8页
第8页 / 共138页
linuxAndroid基础知识总结.docx_第9页
第9页 / 共138页
linuxAndroid基础知识总结.docx_第10页
第10页 / 共138页
linuxAndroid基础知识总结.docx_第11页
第11页 / 共138页
linuxAndroid基础知识总结.docx_第12页
第12页 / 共138页
linuxAndroid基础知识总结.docx_第13页
第13页 / 共138页
linuxAndroid基础知识总结.docx_第14页
第14页 / 共138页
linuxAndroid基础知识总结.docx_第15页
第15页 / 共138页
linuxAndroid基础知识总结.docx_第16页
第16页 / 共138页
linuxAndroid基础知识总结.docx_第17页
第17页 / 共138页
linuxAndroid基础知识总结.docx_第18页
第18页 / 共138页
linuxAndroid基础知识总结.docx_第19页
第19页 / 共138页
linuxAndroid基础知识总结.docx_第20页
第20页 / 共138页
亲,该文档总共138页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

linuxAndroid基础知识总结.docx

《linuxAndroid基础知识总结.docx》由会员分享,可在线阅读,更多相关《linuxAndroid基础知识总结.docx(138页珍藏版)》请在冰点文库上搜索。

linuxAndroid基础知识总结.docx

linuxAndroid基础知识总结

===================================================

linux,Android基础知识总结

1.Android编译系统分析

2.文件系统分析

3.制作交叉工具链

4.软件编译常识

5.设置模块流程分析

6.linux系统启动流程分析

7.linux下svn使用指南

8.LFS相关

9.linux内核的初步理解

====================================================

================

android系统开发指南(常用环境的搭建和使用)

说明:

有的步骤会用到脚本简化操作,脚本通过svn服务器获取:

svncosvn:

//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.打标的源代码位置

svnlistsvn:

//192.168.2.148/smartphone/td0901/tag

我们可以通过svnlistsvn:

//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/设置为:

exportPATH:

=/usr/local/marvell-arm-linux-4.1.1/bin/:

$PATH

2>更改编译选项(网络启动或者本机启动)

内核顶层目录执行:

makemenuconfig

Generalsetup--->

[*]InitialRAMfilesystemandRAMdisk(initramfs/initrd)support

()Initramfssourcefile(s)(NEW)

如果需要支持网络启动反选[]InitialRAMfilesystemandRAMdisk(initramfs/initrd)support

如果需要支持本地启动选中[*]InitialRAMfilesystemandRAMdisk(initramfs/initrd)support

设置()Initramfssourcefile(s)(NEW)为root

拷贝cupcake编译结果out/target/product/littleton/root/到内核顶层目录

3>编译

内核顶层目录执行makezImage

编译好的内核:

arch/arm/boot/zImage

5.搭建网络开发环境

1>安装nfs服务器

sudoapt-getinstallnfs-kernel-servernfs-common

2>修改nfs服务器配置文件/etc/exports,确保有以下配置项

/nfsroot/rootfs*(rw,no_root_squash,sync)

我们在内核中已经固定,手机通过网络方式启动,默认从/nfsroot/rootfs

读取文件系统,修改配置项后需要重启nfs服务器:

sudo/etc/init.d/nfs-kernel-serverrestart

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>获取待烧录的镜像文件

svnlistsvn:

//192.168.2.148/smartphone/td0901/release/images查看服务器上的

版本情况,通常我们下载最新的,例如,下载9月18号发布的版本:

svncosvn:

//192.168.2.148/smartphone/td0901/release/images/images20090918

3>烧录镜像文件

用以下文件为例,示范通过tftp烧写内核和文件系统

内核zImage0917

系统分区:

system0918.img

数据分区data0918.img

待烧写的以上文件必须存在于tftp服务器根目录/tftpboot下。

具体步骤:

首先连接好硬件设备进入blob下载模式

1>blob起来后按任意键

Processingobmparameters...

Can'tdetectmicco.SetPMICasnormalI2Cmode.

NANDflash(Manu=0x98Device=0xba)detected!

Slot0Found

getrelocationtable

FoundMainBadblocktableataddress0x0f000000,version0x01

FoundMirrorBadblocktableataddress0x0efc0000,version0x01

ConsideryourselfBLOBed!

blobversion2.0.5-pre3forMarvellLittleton

Copyright(C)19992000200120022003Jan-DerkBakkerandErikMouw

blobcomeswithABSOLUTELYNOWARRANTY;readtheGNUGPLfordetails.

Thisisfreesoftware,andyouarewelcometoredistributeit

undercertainconditions;readtheGNUGPLfordetails.

lengthnotalignwithpagesize,changeto0x0

Readflashfrom0x60000,length0x0

Done

Autoboot(2seconds)inprogress,pressanykeytostop..

Autobootaborted

Type"help"togetalistofcommands

blob>

2>通过tftp下载内核到pc内存0x80800000地址处

blob>tftpzImage0917

Begininitetherusbnet!

!

!

*****Plug-inUSBcable&configusbdnetnow******

exitcheck_usb_connection:

1

TFTPingzImage0917*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OK.

received6144blocks(3145156bytes)

tftp_cmd:

file'zImage0917'loadedviatftptoaddress0x80800000.

3>擦除原来的内核分区,0x100000为分区起始地址,0x300000为分区长度

blob>nanderase-z0x1000000x400000

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Erase0x300000lengthdatafromflash:

0x100000

Eraseflashfrom0x100000,length0x300000

........................Done

4>烧写内存0x80800000开始实际长度为3145156的内核数据到起始地址为0x100000的内核分区

blob>nandwrite-z0x808000000x1000003145156

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Write0x2ffdc4lengthdatafromRAM:

0x80800000toflash:

0x100000

Writeflashfrom0x100000,length0x2ffdc4

Eraseflashfrom0x100000,length0x300000

........................Done

........................Done

5>下载系统分区镜像文件到pc内存0x80800000地址处

blob>tftpsystem0918.img

TFTPingsystem0918.img*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OK.

received113138blocks(57925824bytes)

tftp_cmd:

file'system0918.img'loadedviatftptoaddress0x80800000.

6>擦除原来的flash系统分区

blob>nanderase-z0x5000000x4000000

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Erase0x3e0f800lengthdatafromflash:

0x400000

Eraseflashfrom0x400000,length0x3e0f800

...................................................................................

...................................................................................

...................................................................................

..........................Done

7>烧写数据到flash系统分区

blob>nandwrite-y0x808000000x50000057925824

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Write0x373e0c0lengthdatafromRAM:

0x80800000toflash:

0x400000

Writeflashfrom0x400000,length0x3591800

Eraseflashfrom0x400000,length0x3591800

....................................................................................

.....................................................................................

................................................................................Done

....................................................................................

....................................................................................

................................................................Done

8>下载数据分区镜像文件到pc内存0x80800000地址处

blob>tftpdata0918.img

TFTPingdata0918.img*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OK.

received33992blocks(17402880bytes)

tftp_cmd:

file'data0918.img'loadedviatftptoaddress0x80800000.

blob>

9>擦除原来的flash数据分区

blob>nanderase-z0x45000000xBB00000

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Erase0xa81f000lengthdatafromflash:

0x4400000

Eraseflashfrom0x4400000,length0xa81f000

.....................................................................................

.....................................................................................

.....................................................................................

.....................................................................................

...................................................Done

10>烧写数据镜像到flash数据分区

blob>nandwrite-y0x808000000x450000017402880

thecurrentNANDchipdoesnotsupportBlockUnlocking.

Write0x1098c00lengthdatafromRAM:

0x80800000toflash:

0x4400000

Writeflashfrom0x4400000,length0x1018000

Eraseflashfrom0x4400000,length0x1018000

..................................................................................Done

..................................................................................Done

blob>

flash分区图:

*******************************************

*****

*blob*kernel*system*data*

*****

*******************************************

nanderase-z0x1000000x400000

tftpzImage

nandwrite-z0x808000000x100000

烧写system.img:

nanderase-z0x5000000x4000000

tftpsystem.img

nandwrite-y0x808000000x500000

烧写userdata.img:

nanderase-z0x45000000xBB00000

tftpuserdata.img

nandwrite-y0x808000000x4500000

============================

涉及的内容:

svn服务器的使用

android的编译系统,原理,工具链,辅助工具,参数等,环境变量,怎样单独添加编译一个单独的模块等。

android的编译结果:

文件系统分析

文件系统的使用,启动流程

设置模块流程分析

============================

====================================================

1.Android编译系统分析

编译脚本及系统变量

build/envsetup.sh脚本分析

在编译源代码之前通常需要在android源代码顶层目录执行../build/envsetup.sh目的是为了使用

脚本envsetup.sh里面定义了一些函数:

functionhelp()

functionget_abs_build_var()

functionget_build_var()

functioncheck_product()

functioncheck_variant()

functionsetpaths()

functionprintconfig()

functionset_stuff_for_environment()

functionset_sequence_number()

functionsettitle()

functionchoosetype()

functionchooseproduct()

functionchoosevariant()

functiontapas()

functionchoosecombo()

functionprint_lunch_menu()

functionlunch()

functiongettop

functionm()

functionfindmakefile()

functionmm()

functionmmm()

functioncroot()

fun

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高中教育 > 高中教育

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2