免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3009 | 回复: 1
打印 上一主题 下一主题

android-编译 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-06 22:26 |只看该作者 |倒序浏览

               
首先要编译内核,因为Android是用的NOEABI,所以得先修改Makefile中的交叉编译工具为arm-none-linux-eabi-,ARCH为ARM,然后是内核配置选项,以下几个选项必选的:
        CONFIG_AEABI=y    
        CONFIG_SHMEM=y    
        CONFIG_ASHMEM=y
        CONFIG_ARM_THUMB=y
        CONFIG_ANDROID_BINDER_IPC=y
        CONFIG_ANDROID_LOGGER=y
生成zImage。
QT2410是ARMV4,用Freerunner的应用层,一步步按照http://trac.koolu.org/要求所做
make TARGET_PRODUCT=freerunner无误后可以看到在目录out/target/product/freerunner/下生成的IMG文件及所有应用层的东西。
其中root目录下的sbin/init即是内核层运行应用层的第一个进程,所以还要修改内核目录init/main.c文件中运行的第一个进程run_init_process(/root/sbin/init),它所对应的源码目录是/system/core/init/,从中可以看出它所做的工作主要有:
1.       Initialize log system. 
2.       Parse /init.rc and /init.%hardware%.rc. 
3.       Execute early-init action in the two files parsed in step 2. 
4.       Device specific initialize. For example, make all device node in /dev and download firmwares. 
5.       Initialize property system. Actually the property system is working as a share memory. Logically it looks like a registry under Windows system. 
6.       Execute init action in the two files parsed in step 2. 
7.       Start property service. 
8.       Execute early-boot and boot actions in the two files parsed in step 2. 
9.       Execute property action in the two files parsed in step 2. 
10.   Enter into an indefinite loop to wait for device/property set/child process exit events. For example, if an SD card is plugined, init will receive a device add event, so it can make node for the device. Most of the important process is forked in init, so if any of them crashed, init will receive a SIGCHLD then translate it into a child process exit event, so in the loop init can handle the process exit event and execute the commands defined in *.rc(it will run command onrestart). 
到目前,可以运行Android的shell,LCD是可以显示ANDROID字符,但ANDROID的启动画面仍没看到,有侍继续。。。
在终端可以看到启动的进程:
USER     PID   PPID  VSIZE RSS   WCHAN    PC         NAME
root     1     0     272   180   c009e3c8 0000c35c S /root/sbin/init
root     2     0     0     0     c0058f84 00000000 S kthreadd
root     3     2     0     0     c0049d98 00000000 S ksoftirqd/0
root     4     2     0     0     c00557b4 00000000 S events/0
root     5     2     0     0     c00557b4 00000000 S khelper
root     12    2     0     0     c00557b4 00000000 S suspend
root     54    2     0     0     c00557b4 00000000 S kblockd/0
root     58    2     0     0     c01adbf0 00000000 S kseriod
root     80    2     0     0     c0077264 00000000 S pdflush
root     81    2     0     0     c0077264 00000000 S pdflush
root     82    2     0     0     c007b1d0 00000000 S kswapd0
root     84    2     0     0     c00557b4 00000000 S aio/0
root     85    2     0     0     c00557b4 00000000 S nfsiod
root     673   2     0     0     c018609c 00000000 S kapmd
root     706   2     0     0     c01a5470 00000000 S mtdblockd
root     715   2     0     0     c00557b4 00000000 S rpciod/0
root     1380  1     752   348   00000000 afe0b13c R /system/bin/sh
system   1381  1     816   256   c019cf30 afe0b81c S /system/bin/servicemanager
root     1382  1     1844  344   ffffffff afe0c18c S /system/bin/mountd
root     1383  1     684   308   c01c1a00 afe0c18c S /system/bin/debuggerd
radio    1384  1     3300  628   ffffffff afe0be8c S /system/bin/rild
root     1387  1     45792 8536  00000000 ad57696e R zygote
root     1389  1     808   272   c01c1a00 afe0c18c S /system/bin/installd
root     1394  1380  896   340   00000000 afe0b5dc R ps
LOG信息:
I/DEBUG   ( 1383): debuggerd: Jan 20 2009 18:15:28
E/mountd  ( 1382): could not read initial mass storage state
D/AndroidRuntime( 1387): 
D/AndroidRuntime( 1387): >>>>>>>>>>>>>> AndroidRuntime START >> /system/bin/mediaserver >> /system/bin/mediaserver  library (Cannot find library)
I/SurfaceFlinger( 1395): EGL informations:
I/SurfaceFlinger( 1395): # of configs : 4
I/SurfaceFlinger( 1395): vendor    : Android
I/SurfaceFlinger( 1395): version   : 1.2 Android META-EGL
I/SurfaceFlinger( 1395): extensions: EGL_ANDROID_query_string_config EGL_ANDROID_swap_rectangle
I/SurfaceFlinger( 1395): ext/config: EGL_ANDROID_swap_rectangle
I/SurfaceFlinger( 1395): Client API: OpenGL ES
W/EGLDisplaySurface( 1395): FBIOPUT_VSCREENINFO failed, page flipping not supported
W/EGLDisplaySurface( 1395): page flipping not supported (yres_virtual=320, requested=640)
I/EGLDisplaySurface( 1395): using (fd=18)
I/EGLDisplaySurface( 1395): id           = s3c2410fb
I/EGLDisplaySurface( 1395): xres         = 240 px
I/EGLDisplaySurface( 1395): yres         = 320 px
I/EGLDisplaySurface( 1395): xres_virtual = 240 px
I/EGLDisplaySurface( 1395): yres_virtual = 320 px
I/EGLDisplaySurface( 1395): bpp          = 16
I/EGLDisplaySurface( 1395): r            = 11:5
I/EGLDisplaySurface( 1395): g            =  5:6
I/EGLDisplaySurface( 1395): b            =  0:5
I/EGLDisplaySurface( 1395): width        = 240 mm (25.400000 dpi)
I/EGLDisplaySurface( 1395): height       = 320 mm (25.400000 dpi)
I/EGLDisplaySurface( 1395): refresh rate = 116.46 Hz
I/SurfaceFlinger( 1395): OpenGL informations:
I/SurfaceFlinger( 1395): vendor    : Android
I/SurfaceFlinger( 1395): renderer  : Android PixelFlinger 1.0
I/SurfaceFlinger( 1395): version   : OpenGL ES-CM 1.0
I/SurfaceFlinger( 1395): extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get GL_OES_query_matrix GL_ARB_texture_compression GL_ARB_texture_non_power_of_two GL_ANDROID_direct_texture GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap 
I/sysproc ( 1395): System server: starting Android runtime.
I/sysproc ( 1395): System server: starting Android services.
I/SystemServer( 1395): Entered the Android system server!
I/sysproc ( 1395): System server: entering thread pool.
E/GLLogger( 1395): couldn't load  library (Cannot find library)
I/SystemServer( 1395): Starting Power Manager.
I/SystemServer( 1395): Starting Activity Manager.
I/dalvikvm( 1395): Ignoring DDM send req for type=0x41504e4d len=32
I/SystemServer( 1395): Starting telephony registry
I/SystemServer( 1395): Starting Package Manager.
I/Installer( 1395): connecting...
I/installd( 1389): new connection
W/PackageManager( 1395): Library not found: /system/framework/com.google.android.gtalkservice.jar
W/PackageManager( 1395): Library not found: /system/framework/com.google.android.maps.jar
D/PackageManager( 1395): Scanning app dir /system/framework
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
W/PackageParser( 1395): Bad element under : eat-comment
D/PackageManager( 1395): Scanning app dir /system/app
D/dalvikvm( 1395): GC freed 6283 objects / 260232 bytes in 19ms
I/ARMAssembler( 1395): generated scanline__00000177:03545404_00001A04_00000000 [100 ipp] (139 ins) at [0x1b68f0:0x1b6b1c] in 0 ns
I/ARMAssembler( 1395): generated scanline__00000177:03010104_00001A01_00000000 [ 58 ipp] (97 ins) at [0x1b8e80:0x1b9004] in 0 ns
I/ARMAssembler( 1395): generated scanline__00000177:03545404_00000A01_00000000 [ 69 ipp] (107 ins) at [0x1b9008:0x1b91b4] in 0 ns
I/        ( 1415): ServiceManager: 0xaab8
E/AudioHardwareALSA( 1415): Unable to attach mixer to device AndroidPlayback: No such file or directory
E/AudioHardwareALSA( 1415): Unable to attach mixer to device default: No such file or directory
E/AudioHardwareALSA( 1415): Unable to attach mixer to device AndroidRecord: No such file or directory
E/AudioHardwareALSA( 1415): Unable to attach mixer to device default: No such file or directory
I/DEBUG   ( 1383): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1383): Build fingerprint: 'neo/freerunner/freerunner/:1.0/TC3/eng.pub.20090205.161349:eng/test-keys'
I/DEBUG   ( 1383): pid: 1415, tid: 1415  >>> /system/bin/mediaserver >> /system/bin/mediaserver >> /system/bin/mediaserver >> /system/bin/mediaserver
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/92532/showart_1816264.html

论坛徽章:
0
2 [报告]
发表于 2010-06-23 19:45 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP