資訊工程系碩士班碩士學位論文Android作業系統移植之研究與實現TheStudyandImplementationofOperatingSystemPortingforAndroid研究生:鍾文昌指導教授:梁文耀中華民國九十八年七月摘要論文名稱:Android作業系統移植之研究與實現頁數:132校所別:國立臺北科技大學資訊工程系碩士班畢業時間:九十七學年度第二學期學位:碩士研究生:鍾文昌指導教授:梁文耀博士關鍵詞:Android、ARM、Cell、Devicedriver、Embedded、GNUMake、Google、Kernel、Linux、Mobile、OpenSource、OperatingSystem、Phone、Porting、PXA270、手機、作業系統、移植、嵌入式近年來,智慧型手機崛起,伴隨著手機作業系統也逐漸受到重視,以往手機系統大多是各手機大廠自行研發且封閉的系統;但自從Google開始覬覦手機市場的廣告商機,而著手開發一個完全免費且開放式的手機軟體平台Android,全球各相關產官學界便開始爭相研究,也替Linux在智慧型手機市場注入一劑強心針。一般有能力移植Android的業界不願公開移植的步驟及流程,而學界則恐缺資源及人才,因此不易將Android移植至實際平台,我們不僅成功地將Android移植至PXA270,並公開移植的步驟、流程、所撰寫及修改的程式碼,使他人可以仿照此流程,建立Android的執行環境。本論文的重點在於移植的流程,而非硬體平台,此流程適用於多數的硬體平台,但不可能百分之百適用於所有的開發環境。我們為此打造一個全新的開發環境,使其在GNUMake支援下盡可能執行parallelmake以縮短編譯時間。我們希望透過本論文能夠一窺Android的運作方式,並分享移植過程中所遇到的問題及解決方法。iABSTRACTTitle:TheStudyandImplementationofOperatingSystemPortingforAndroidPages:132School:NationalTaipeiUniversityofTechologyDepartment:DepartmentofComputerScienceandInformationEngineerTime:July,2009Degree:MasterResearcher:Wen-ChangChungAdvisor:Wen-YewLiangKeywords:Android,ARM,Cell,Devicedriver,Embedded,GNUMake,Google,Kernel,Linux,Mobile,OpenSource,OperatingSystem,Phone,Porting,PXA270Inrecentyears,withtheappearanceofsmartphones,developmentoftheoperatingsystemsforhandhelddeviceshasattractedmoreandmoreattention.Inthepast,thespecificationsanddevelopmentsofthehandhelddevicesareusuallydefinedbythevendorsinapropritorymethod.Withtheambitiontoextendthemarketshareinthemobilephonerelatedindustry,Googlehasstartedtodevelopafreeandopensourcebasedsoftwareplatform,calledAndroid,forthesekindsofdevices.Sincethen,Androidsoongetsfocusfromtheworld-wideindustrycompanies,governmentdepartments,andacademicorganization.ThisalsohelpstheLinuxcommunityinitsapplicationsinembeddedsystems.WenotonlyhaveportedAndroidintooneofourembeddedplatform(aPXA270board),butalsowe’dliketoshareourexperienceanddetailedprocedurestoanyonewhoareinterestedinAndroidporting.Thekeypointofthisthesisistoemphasizetheprocessofporting,insteadofhowtoportittoanyparticularhardwareplatform.However,thisprocessstilldependsonsomeofthehardwarecomponentsthatareused.Theportingprocessinvolvesmanyissuesrelatedtothehardware.Theseincludetheworkofkernelporting,driverporting,andalsosomemodificationtotheAndroidiiapplicationframeworkandlibraries.Basedonourwork,wehopethatpeoplewhoareinterestedinAndroidhavethechancetogetmoreunderstandingonhowitworkandhowtorealizeitontheirownplatforms.iii誌謝首先要感謝指導教授梁文耀老師悉心教誨並指示研究方向,促使本論文能夠順利完成。感謝口試委員方志鵬老師、張陽郎老師、蘇慶龍老師以及指導教授梁文耀老師百忙之餘,撥冗擔任學生的口試委員,感謝各位老師的悉心指教,並提出諸多寶貴建議,使本論文更加完善。謝謝家人、朋友及實驗室各位夥伴的幫忙及協助,讓我可以順利完成碩士學業。最後特別感謝正浩幫我拍攝論文中所需的照片。iv目錄中文摘要...........................................................................................................................i英文摘要..........................................................................................................................ii誌謝..........................................................................................................................iv目錄...........................................................................................................................v表目錄..........................................................................................................................ix圖目錄...........................................................................................................................x第一章緒論...................................................................................................................11.1前言................................................................................................................11.2研究動機與目的............................................................................................11.3研究貢獻........................................................................................................21.4論文架構........................................................................................................3第二章Android簡介....................................................................................................42.1硬體限制........................................................................................................42.2軟體特色........................................................................................................52.3開發環境........................................................................................................82.4Linux手機聯盟..............................................................................................8第三章一般EmbeddedLinuxSystem簡介...........................................................103.1系統架構......................................................................................................103.2開機流程......................................................................................................103.2.1在ARM架構下的開機流程..............................................................113.3開發流程......................................................................................................17第四章Android移植步驟