码迷,mamicode.com
首页 > 移动开发 > 详细

S3C6410板子构建安卓2.2

时间:2015-07-14 17:02:02      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

准备:
1.配置yum源,卸载open JDK ,设置环境变量:
  vim /etc/yum.repos.d/Centos-Base-
 
   [base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

yum  clean all
yum install 测试

卸载open jdk
  yum remove *openjdk*
  yum remove gcc-java
安装jdk1.5
  find ./* -name *jdk*
 rpm -ivh ******jdk1.5.rpm
                                                            


设置环境变量

vim /etc/profile
加入:
PATH=$PATH:/usr/local/arm/4.5.1/bin

export JAVA_HOME=/usr/java/jdk1.5.0_22
export JRE_HOME=${JAVA_HOME}/jre
export CLASS_PATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASS_PATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=${JAVA_PATH}:$PATH

vim /etc/bashrc
加入:
export JAVA_HOME=/usr/java/jdk1.5.0_22
export JRE_HOME=${JAVA_HOME}/jre
export CLASS_PATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASS_PATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=${JAVA_PATH}:$PATH



2.软件及安装包:
andorid,teacher_liu


1.安装gperf软件:
   cd /android/android_patch/tools
   tar xvf gperf-
   ./configure
   make
   make install

2.编译生成文件系统
   cd android-2.2_froyo
   make
 
3.修改内核中的编译器,生成zImage镜像
  cd android-kernel-2.6.35
  vim Makefile
  192gg

   ARCH            ?= arm
CROSS_COMPILE   ?= /home/hongzhunzhun/hong/android/android/android-2.2_froyo/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-

 make

   在编译的同时,来制作bootloader

一.烧写bootloader
1.设置sd卡启动,烧写sd卡:
  (前提是需要找一张2G的SD卡,格式化,新建一个分区)
  cd /teacher_liu/smdk6410_resource/tools
  ./write /dev/sdb ../image/u-boot-move.bin
   看到指示灯闪烁了一下说明烧写成功,再烧就烧不进去说明正常

   板子上设置为SD卡启动,开机。
2.安装好minicom,配置minicom
   minicom -s
   no   no  save as de..
3.安装设置好tftp,烧写 nand启动。
   yum install *tftp/xinted*
   vim vi /etc/xinetd.d/tftp
   disable = no
 
   重启 tftp
   service xinted restart
   cp /android/teacher_liu/smdk6410_resource/images/u-boot-nand.bin
   /var/lib/tftpboot/

   在minicom 中 tftp nand u-boot 到板子
   tftp 52000000 u-boot-nand.bin
   nand erase clean
   nand write 52000000 0 30000
   设置为nand启动


4.安装nfs构建文件系统:
  yum install nfs
  vim /etc/export
  /work/android/nfsroot *(rw,no_root_squash)
  service nfs restart
  mount -t nfs 192.168.x.x:/work/android/nfsroot /mnt
  umount /mnt

  cd android/android-2.2_froyo/out/target/product/generic
  cp root/* /work/android/nfsroot  -rf
  cp system/ /work/android/nfsroot/system -rf
  cp data/ /work/android/nfsroot/data -rf

  cp /android/android/android_patch/init.rc    /android/android/android_patch

  vim init.rc
  27gg
  注释
 setenv bootargs console=ttySAC0 init=/init root=/dev/nfs nfsroot=192.168.1.10:/work/android/nfsroot ip=192.168.1.20
  tftp 50008000 zImage
  bootm 50008000



启动模拟器
ANDROID_PRODUCT_OUT=`pwd` emulator -shell    



    <library name="cow"
            file="/system/framework/cow.jar"/>



三.写一个app程序来点亮LED灯.


1.直接写一个led裸板内核程序内核模块


/home/androidproject/android/src/8th_led/ko 先看这个目录下的文件

led.c先看,然后make 把led.ko放到/home/androidproject/android/tftproot/

然后启动板子,启动好后,insmod led.ko
ls /dev/s3c6410_led,就能看到设备。




2.写一个内核模块,写一个应用程序来执行来控制灯的开关

然后看/home/androidproject/android/src/8th_led/exe目录下的test.c

然后再android-2.2_froyo目录下 mmm /home/androidproject/android/src/8th_led/exe

会在/home/androidproject/android/android-2.2_froyo/out/target/product/generic/system/bin 目录下生成test   
把test移到/home/androidproject/android/nfsroot/system/bin/目录下

在板子这边命令行输./test /dev/led_misc on led就亮了
         ./test /dev/led_misc off led就灭了




3.用app程序来控制灯的亮和灭(8th,mmm在android目录下编译

上层apk点灯
流程 文件jar->apk->so
按到顺序mmm ,


把生到的system目录拷贝到tftproot 下,然后重启




在/home/androidproject/android/nfsroot/system/etc/permissions/platform.xml
里加一句
<library name="cow"
                file="/system/framework/cow.jar"/>

 


开发板insmod led.ko
chmod 777 /dev/led_misc
 给权限
安卓就能控制灯亮,灯灭

 

S3C6410板子构建安卓2.2

标签:

原文地址:http://www.cnblogs.com/hongzhunzhun/p/4645640.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!