下载系统分区镜像文件到pc内存 0x80800000 地址处
java代码:
二:
烧写内存 0x80800000 开始 实际长度为 3145156 的内核数据到起始地址为 0x100000 的内核分区 java代码: blob> nandwrite -z 0x80800000 0x100000 3145156 the current NAND chip does not support Block Unlocking. Write 0x2ffdc4 length data from RAM: 0x80800000 to flash: 0x100000 Write flash from 0x100000, length 0x2ffdc4 Erase flash from 0x100000, length 0x300000 复制代码 下载系统分区镜像文件到pc内存 0x80800000 地址处 java代码: blob> tftp system0918.img TFTPing system0918.img OK. received 113138 blocks (57925824 bytes) 复制代码 擦除原来的flash系统分区 java代码: blob> nanderase -z 0x500000 0x4000000 the current NAND chip does not support Block Unlocking. Erase 0x3e0f800 length data from flash: 0x400000 Erase flash from 0x400000, length 0x3e0f800 复制代码 烧写数据到flash系统分区 java代码: blob> nandwrite -y 0x80800000 0x500000 57925824 the current NAND chip does not support Block Unlocking. Write 0x373e0c0 length data from RAM: 0x80800000 to flash: 0x400000 Write flash from 0x400000, length 0x3591800 Erase flash from 0x400000, length 0x3591800 复制代码 擦除原来的flash数据分区 java代码: blob> nanderase -z 0x4500000 0xBB00000 the current NAND chip does not support Block Unlocking. Erase 0xa81f000 length data from flash: 0x4400000 Erase flash from 0x4400000, length 0xa81f000 复制代码 烧写数据镜像到flash数据分区 java代码: blob> nandwrite -y 0x80800000 0x4500000 17402880 the current NAND chip does not support Block Unlocking. Write 0x1098c00 length data from RAM: 0x80800000 to flash: 0x4400000 Write flash from 0x4400000, length 0x1018000 Erase flash from 0x4400000, length 0x1018000 复制代码
三:
下载系统分区镜像文件到pc内存 0x80800000 地址处 java代码: blob> tftp system0918.img TFTPing system0918.img received 113138 blocks (57925824 bytes) tftp_cmd: file 'system0918.img' loaded via tftp to address 0x80800000. 复制代码 擦除原来的flash系统分区 java代码: blob> nanderase -z 0x500000 0x4000000 the current NAND chip does not support Block Unlocking. Erase 0x3e0f800 length data from flash: 0x400000 Erase flash from 0x400000, length 0x3e0f800 复制代码 烧写数据到flash系统分区 java代码: blob> nandwrite -y 0x80800000 0x500000 57925824 the current NAND chip does not support Block Unlocking. Write 0x373e0c0 length data from RAM: 0x80800000 to flash: 0x400000 Write flash from 0x400000, length 0x3591800 Erase flash from 0x400000, length 0x3591800 复制代码 下载数据分区镜像文件到pc内存 0x80800000 地址处 java代码: blob> tftp data0918.img TFTPing data0918.img received 33992 blocks (17402880 bytes) tftp_cmd: file 'data0918.img' loaded via tftp to address 0x80800000. blob> 复制代码 擦除原来的flash数据分区 java代码: blob> nanderase -z 0x4500000 0xBB00000 the current NAND chip does not support Block Unlocking. Erase 0xa81f000 length data from flash: 0x4400000 Erase flash from 0x4400000, length 0xa81f000 复制代码 烧写数据镜像到flash数据分区 java代码: blob> nandwrite -y 0x80800000 0x4500000 17402880 the current NAND chip does not support Block Unlocking. Write 0x1098c00 length data from RAM: 0x80800000 to flash: 0x4400000 Write flash from 0x4400000, length 0x1018000 Erase flash from 0x4400000, length 0x1018000 复制代码
flash分区图: java代码: nanderase -z 0x100000 0x400000 tftp zImage nandwrite -z 0x80800000 0x100000 //烧写system.img: nanderase -z 0x500000 0x4000000 tftp system.img nandwrite -y 0x80800000 0x500000 //烧写 userdata.img : nanderase -z 0x4500000 0xBB00000 tftp userdata.img nandwrite -y 0x80800000 0x4500000 复制代码 涉及的内容: svn服务器的使用 android的编译系统,原理,工具链,辅助工具,参数等,环境变量,怎样单独添加编译一个单独的模块等。 android 的编译结果:文件系统分析 文件系统的使用,启动流程 设置模块流程分析 1. Android编译系统分析 编译脚本及系统变量 build/envsetup.sh脚本分析 在编译源代码之前通常需要在android源代码顶层目录执行 . ./build/envsetup.sh 目的是为了使用脚本 envsetup.sh 里面定义了一些函数: java代码: function help() function get_abs_build_var() function get_build_var() function check_product() function check_variant() function setpaths() function printconfig() function set_stuff_for_environment() function set_sequence_number() function settitle() function choosetype() function chooseproduct() function choosevariant() function tapas() function choosecombo() function print_lunch_menu() function lunch() function gettop function m() function findmakefile() function mm() function mmm() function croot() function pid() function gdbclient() function jgrep() function cgrep() function resgrep() function getprebuilt function tracedmdump() function runhat() function getbugreports() function startviewserver() function stopviewserver() function isviewserverstarted() function smoketest() function runtest() function runtest_py() function godir () 复制代码 choosecombo 命令分析: java代码: function choosecombo(){ choosesim $1 echo echo choosetype $2 echo echo chooseproduct $3 echo echo choosevariant $4 echo set_stuff_for_environment printconfig } 复制代码
会依次进行如下选择: java代码: Build for the simulator or the device? 1. Device 2. Simulator Which would you like? [1] Build type choices are: 1. release 2. debug Which would you like? [1] Product choices are: 1. emulator 2. generic 3. sim 4. littleton You can also type the name of a product if you know it. Which would you like? [littleton] Variant choices are: 1. user 2. userdebug 3. eng Which would you like? [eng] user 复制代码 默认选择以后会出现: java代码: TARGET_PRODUCT=littleton TARGET_BUILD_VARIANT=user TARGET_SIMULATOR=false TARGET_BUILD_TYPE=release TARGET_ARCH=arm HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID= 复制代码 function chooseproduct()函数分析: java代码: choices=(`/bin/ls build/target/board/*/BoardConfig.mk vendor/*/*/BoardConfig.mk 2> /dev/null`) //读取 build/target/board/* 目录下的板配置文件:BoardConfig.mk //读取 vendor/*/*/目录下的板配置文件:BoardConfig.mk //choices 的值为: build/target/board/emulator/BoardConfig.mk build/target/board/generic/BoardConfig.mk build/target/board/sim/BoardConfig.mk vendor/marvell/littleton/BoardConfig.mk 复制代码 经过: java代码: for choice in ${choices[@]} do # The product name is the name of the directory containing # the makefile we found, above. prodlist=(${prodlist[@]} `dirname ${choice} | xargs basename`) done //的处理,prodlist的值为: emulator generic sim littleton //所以选择菜单为: Product choices are: 1. emulator 2. generic 3. sim 4. littleton //如果选择 4,那么 TARGET_PRODUCT 被赋值为: littleton。 board_config_mk := \ $(strip $(wildcard \ $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \ vendor/*/$(TARGET_DEVICE)/BoardConfig.mk \ )) 复制代码 怎样添加一个模块 java代码: LOCAL_PATH:= $(call my-dir) #编译静态库 include $(CLEAR_VARS) LOCAL_MODULE = libhellos LOCAL_CFLAGS = $(L_CFLAGS) LOCAL_SRC_FILES = hellos.c LOCAL_C_INCLUDES = $(INCLUDES) LOCAL_SHARED_LIBRARIES := libcutils LOCAL_COPY_HEADERS_TO := libhellos LOCAL_COPY_HEADERS := hellos.h include $(BUILD_STATIC_LIBRARY) #编译动态库 include $(CLEAR_VARS) LOCAL_MODULE = libhellod LOCAL_CFLAGS = $(L_CFLAGS) LOCAL_SRC_FILES = hellod.c LOCAL_C_INCLUDES = $(INCLUDES) LOCAL_SHARED_LIBRARIES := libcutils LOCAL_COPY_HEADERS_TO := libhellod LOCAL_COPY_HEADERS := hellod.h include $(BUILD_SHARED_LIBRARY) BUILD_TEST=true ifeq ($(BUILD_TEST),true) 复制代码
六:
java代码:
http://www.eoeandroid.com/thread-91316-1-1.html