移植要领与策略分析AndroidPorting

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

AndroidPortingbyJollenChenemail:jollen@jollen.orgblog:jollen.org/blogplurk: TextText•Section1.AndroidKernel‣product‣‣AndroidPortingApplication(API)ProductFramework/LibraryAndroidkernelAndroidPortingnewproductAndroid‣cupcakearmv4/armv5/x86APILevel‣AndroidVanillaKernelConfigs‣AndroidframeworkNon-VanillaKernel‣MergeAndroidframeworkAndroidPorting:‣AndroidframeworklibraryAndroidframework‣ASHMEMwakelocksharedlibrary‣Androidframework‣casestudy:FreeRunnerAndroidPorting:2007.11.5:Android2007.11.12:AdnroidSDKearlylookversion2008.1.3:AdnroidDeveloperChallenge2008.2.13:AndroidSDKm5-rc152008.5.12:Top50AndroidApplicationSystemImageAPILevelReleaseAndroid1.532009.4.27Android1.122009.2.10Android1.012008.9.23APILevelPhoneNetbookDevicesARMv4/v5x86misc...MMSWebViewToucheventsWebViewSquirrelFish(JavaScriptengine)IMEBasicx86supportSIMApplicationToolkit1.0...Cupcakeandroid-portingandroid.git.kernel.org1.Cupcakex86ports2../.repo/manifest.xmleee_701platformx86portsAndroidSourceCodegit.koolu.orgarmv4Koolus3c2410/s3c244xNeoFreeRunnerAndroid/armv4Android/armv4$mkdirkoolu-android$cdkoolu-android$repoinit-ugit://git.koolu.org/freerunner/platform/manifest.git-bkoolu-1.0$reposyncMediaFrameworkSurfaceManagerSharedLibrariesApplicationsApplicationFrameworkDalvikVMSystemImagechangeLinuxKernelApplicationDevelopersProductBranchMaintainerMediaFrameworkSurfaceManagerSharedLibrariesApplicationsApplicationFrameworkDalvikVMLinuxKernelrebuildHardwareDevelopingMediaFrameworkSurfaceManagerSharedLibrariesApplicationsApplicationFrameworkDalvikVMLinuxKernelchangechangeArchitecturePortingMediaFrameworkSurfaceManagerSharedLibrariesApplicationsApplicationFrameworkDalvikVMLinuxKernelportingandroid-toolchain-20081019‣:EABI,AAPCS--with-float=soft--with=fpu-vfp--enable-threads(single)AndroidToolchainBinderAshmem(Androidsharedmemory)PMEM(Processormemoryallocator)logcat(AndroidLogger)wakelock(AndroidPowerManagement)AlarmAndroidKernelKeyFeatures2.6.232.6.252.6.272.6.291AlarmDriverOOOO2AndroidLoggerOOOO3LowMemoryKillerOOOO4PowerManagementOOOO5USBGadgetOOOO6ASHMEMXOOO7PMEMXXOO8x86SupportXXOO9./drivers/staging/Android/XXXOAndroidIPC/proc/binder‣state‣stats‣transactions‣transation_log‣failed_transation_logbinderkernel/mm/ashmem.c/dev/ashmemAshmemdrivers/misc/pmem.cuserspacedriverPMEM$arm-eabi-gcc-ohellohello.c-Wl,-rpath-link=./cupcake/out/target/product/generic/obj/lib-L./cupcake/out/target/product/generic/obj/lib-nostdlib./cupcake/out/target/product/generic/obj/lib/crtbegin_dynamic.o-lcAndroidOSnativeprogramAndroidAndroidsourcecode(Cupcake)ToolchainEeePCHardwareKernelglibc&sharedlibsnativeCprogramsS!#$%!&'((LinuxHardwareKernelApplicationAndroidFrameworkS!#$%!&'((JNIbionic&sharedlibsAndroidS!#$%!&'((JNIonCreate()ActivityonCreate()myActivityMediaPlayerOpenCorebionicAndroid•Section2.BuildAndroid(toolchain).Dalvik::JNIDalvik::InterpreterBionicSystemcallAndroidMakefilemacrosandroid/build/core/combodarwin-x86.mkjavac.mklinux-arm.mklinux-x86.mkselect.mktarget_linux-x86.mkwindows-x86.mk$(combo_target)GLOBAL_CFLAGS+=\-march=armv5te-mtune=xscale\-msoft-float-fpic\-mthumb-interwork\-ffunction-sections\-funwind-tables\-fstack-protector\-fno-short-enums\-D__ARM_ARCH_5__-D__ARM_ARCH_5T__\-D__ARM_ARCH_5E__-D__ARM_ARCH_5TE__\-include$(callselect-android-config-h,linux-arm)GLOBALCFLAGS$(combo_target)GLOBAL_CFLAGS+=\-march=armv4t-mcpu=arm920t-mtune=xscale\-msoft-float-fpic\-mthumb-interwork\-ffunction-sections\-funwind-tables\-fstack-protector\-fno-short-enums\-D__ARM_ARCH_4__-D__ARM_ARCH_4T__\-D__ARM_ARCH_5E__-D__ARM_ARCH_5TE__\-include$(callselect-android-config-h,linux-arm)GLOBALCFLAGSforARMv4JNIPortingandroid/dalvik/vm/archgeneric/arm/x86CallEABI.SCallOldABI.SCall386ABI.Sr0-r3holdfirst4argstoamethodr9isgivenspecialtreatmentinsomesituations,butnotforusr10(sl)seemstobegenerallyavailabler11(fp)isusedbygcc(unless-fomit-frame-pointerisset)r12(ip)isscratch--notpreservedacrossmethodcallsr13(sp)shouldbemanagedcarefullyincaseasignalarrivesr14(lr)mustbepreservedr15(pc)canbetinkeredwithdirectlyARMEABIr0JNIEnv(canbeleftalone)r1clazz(NULLforvirtualmethodcalls,non-NULLforstatic)r2arginfo*r3argc(numberof32-bitvaluesinargv)[sp]argv[sp,#4]shortsignature[sp,#8]func[sp,#12]pReturnJNIEntry.Lcopy_done:@callthemethodldrip,[r4,#8]@func#ifndef__ARM_ARCH_4__blxip#elsemovlr,pcbxip#endifAssemblyCode#1:armv4/armv5#ifndef__ARM_ARCH_4__ldmdbr4,{r4,r5,r6,r7,r8,r9,sp,pc}#elseldmdbr4,{r4,r5,r6,r7,r8,r9,sp,lr}bxlr#endifAssemblyCode#2:armv4/armv5DalvikInterpreterandroid/dalvik/vm/mterpcommon/armv4/armv5te/x86/SmallandcustomClibraryfortheAndroidplatform.AmainlyportofBSDClibrary.ItsownsmallimplementationofpthreadsbasedonLinuxfutexes.Supportforx86,ARMandARMthumb.BionicBionicandroid/bioniclibc/libdl/libm/libstdc++/libthread_db/linker/Bionic::libcandroid/bionic/libcarch-arm/arch-x86/kernel/arch-arm/asm/arch-x86/asm/bionic/libc/kerne

1 / 66
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功