ROM development

Author: Wrath of God X
Link : https://www.zhihu.com/question/20076944/answer/381539565
Source: Zhihu The
copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.

1. What is the Android system? Android is a Linux-based mobile terminal system platform released by Google in 2007. The reason why it is called a mobile terminal is that the gap between mobile phones, MIDs, and Tablets is getting smaller and smaller, and there is no longer an insurmountable gap. With the advantages of Google's services, the cooperation of various mobile device manufacturers, and the Android system's good affinity for developers, the Android system soon occupies a pivotal position in the field of mobile device operating systems. After all, Android is a Linux-based operating system, and the so-called Linux-based refers to the Linux kernel. In fact, in the field of mobile terminals, Android is not the first to do so, nor is it the last. For example, Web OS, Maemo, Moblin, Bada, Meego, etc. are based on the Linux kernel, which means that these systems have essential similarities, which also means that they have more openness and attract more developers. Therefore, aside from the hardware limitations, the first-generation God HD2 can run Android and it is destined to run Unbuntu and Meego. (However, it may involve driver development and restrictions on CPU and storage capacity) 2. Android system structure Next, let’s talk about the structure of the Android system. The understanding of the Android system structure is very important for Android software development and ROM production. Only when you really understand how Android is made can you have a deeper understanding of what each step is doing after that, and you can understand where the problem may be. (1) Macro Android is based on the Linux kernel. What does the Linux kernel do not know? Simply put, Linux is an operating system, Linux Kernel is the most basic part of this system, the core. For example, the Windows system with the largest number of users, the windows you see, the accessories for drawing, calculator, minesweeper, etc., are only built on top of the Windows kernel. The so-called kernel is the core called by the upper-level user library and user program. Just like there is a formula for calculating income tax, and its core is the four operations of addition, subtraction, multiplication and division... It's too far... Simply put, Android is: Linux kernel + third-party libraries (such as sqlite, webkit, etc.) + Android core library + Java virtual Some interfaces provided by Machine + Definition As long as you understand what each word above is, you can basically understand how Android works. The macro structure of Android is as follows from top to bottom: application layer, application framework layer (provided for applications to interface with low-level), support library and Android runtime environment (including core library and Java virtual machine), Linux What is the specific layer of the kernel, you can see it for yourself if you are good in English, google it if you are not good in English (2) Modules of each functional system module of Android (may be combined with this when looking at other parts): (Note: It also includes basic introduction and Macro structure, etc. ~~~~recommended~) (3) Android source code directory structure Android 2.-- vendor (厂商定制代码)bionic 目录|-- libc (C库)| |-- arch-arm (ARM架构,包含系统调用汇编实现)| |-- arch-x86 (x86架构,包含系统调用汇编实现)| |-- bionic (由C实现的功能,架构无关)| |-- docs (文档)| |-- include (头文件)| |-- inet | |-- kernel (Linux内核中的一些头文件)| |-- netbsd (?netbsd系统相关,具体作用不明)| |-- private (?一些私有的头文件)| |-- stdio (stdio实现)| |-- stdlib (stdlib实现)| |-- string (string函数实现)| |-- tools (几个工具)| |-- tzcode (时区相关代码)| |-- unistd (unistd实现)|– zoneinfo (time zone information) | – libdl (libdl implementation, dl is a dynamic link, provides functions to access dynamic link libraries) | – libm (implementation of libm math library,) | | – alpha (apaha architecture) | | – amd64 ( amd64 architecture) | |– arm (arm architecture) | |– bsdsrc (? bsd source code) | |– i386 (i386 architecture) | |– i387 (i387 architecture?) | |– ia64 (ia64 architecture) | |– include (header file) | |– man (mathematical functions, suffixed .3, some freeBSD library files) | |– powerpc (powerpc architecture) | |– sparc64 (sparc64 architecture) | -- src (源代码)|-- libstdc++ (libstdc++ C++实现库)| |-- include (头文件)|– src (source code) |– libthread_db (debugger library for multi-threaded programs) | -- include (头文件)– linker (dynamic linker) -- arch (支持arm和x86两种架构)bootable 目录.|-- bootloader (适合各种bootloader的通用代码)|– legacy (estimated not to be used directly, you can refer to) | |– arch_armv6 (V6 architecture, a few simple assembly files) | |– arch_msm7k (Qualcomm 7k Several basic drivers of the processor architecture) | |– include (general header files and Qualcomm 7k architecture header files) | |– libboot (startup libraries, all written very simply) | |– libc (some commonly used c functions) | |– nandwrite (nandwirte function implementation) | -- usbloader (usbloader实现)|-- diskinstaller (android镜像打包器,x86可生产iso)– recovery (system recovery related) |– edify (edify scripting language used by upgrade scripts) |– etc (init.rc recovery script) |– minui (a simple UI) |– minzip (a simple compression tool) |– mtdutils (mtd tool) |– res (resource) | -- images (一些图片) |-- tools (工具) |– ota (OTA Over The Air Updates upgrade tool)-- updater (升级器)build目录.|-- core (核心编译规则)|-- history (历史记录)|-- libs |– host (host-side library, replaced with android “cp” function) |– target (target machine compilation object) | |– board (development platform) | | |– emulator (emulator) | | |– generic (generic)| | |– idea6410 (added by myself) | | -- sim (最简单)|– product (compiling rules corresponding to the development platform) | -- security (密钥相关)– tools (tools and scripts used by the host during compilation) |– acp (Android “acp” Command) |– apicheck (api check tools) |– applypatch (patch tool) |– apriori (prelink tool) |– atree (tree tool) |– bin2asm (bin to asm tool) |– check_prereq (check build timestamp tool) |– dexpreopt (emulator) Related tools, the specific function is unknown) |– droiddoc (? The function is unknown, java language, some people on the Internet say it is related to JDK5) |– fs_config (This program takes a list of files and directories) |– fs_get_stats (gets the file system status) |– iself (to determine whether it is in ELF format) |– isprelinked (to determine whether it is prelinked) |– kcm (key related) |– lsd (List symbol dependencies) |– releasetools (tools and scripts for generating images) |– rgb2565 (rgb is converted to 565) |– signapk (apk signature tool) |– soslim (strip tool)-- zipalign (zip archive alignment tool)dalvik目录 dalvik虚拟机.|-- dalvikvm (main.c的目录)|-- dexdump (dex反汇编)|-- dexlist (List all methods in all concrete classes in a DEX file.)|-- dexopt (预验证与优化)|-- docs (文档)|-- dvz (和zygote相关的一个命令)|-- dx (dx工具,将多个java转换为dex)|-- hit (?java语言写成)|-- libcore (核心库)|-- libcore-disabled (?禁用的库)|-- libdex (dex的库)|-- libnativehelper (Support functions for Android's class libraries)|-- tests (测试代码)|-- tools (工具)– vm (virtual machine implementation) development directory (some routines and tools developers need) |– apps (some core applications) | |– BluetoothDebug (Bluetooth debugger) | |– CustomLocale (custom locale) | | – Development (development) | |– Fallback (a language-related program) | |– FontLab (font library) | |– GestureBuilder (gesture action) | |– NinePatchLab (?) | |– OBJViewer (OBJ viewer) | | – SdkSetup (SDK installer) | |– SpareParts (advanced setup) | |– Term (remote login) | -- launchperf (?)|-- build (编译脚本模板)|-- cmds (有个monkey工具)|-- data (配置数据)|-- docs (文档)|-- host (主机端USB驱动等)|-- ide (集成开发环境)|-- ndk (本地开发套件——c语言开发套件)|-- pdk (Plug Development Kit)|-- samples (演示程序)| |-- AliasActivity ()| |-- ApiDemos (API演示程序)| |-- BluetoothChat (蓝牙聊天)| |-- BrowserPlugin (浏览器插件)| |-- BusinessCard (商业卡)| |-- Compass (指南针)| |-- ContactManager (联系人管理器)| |-- CubeLiveWall** (动态壁纸的一个简单例程)| |-- FixedGridLayout (像是布局)| |-- GlobalTime (全球时间)| |-- HelloActivity (Hello)| |-- Home (Home)| |-- JetBoy (jetBoy游戏)| |-- LunarLander (貌似又是一个游戏)| |-- MailSync (邮件同步)| |-- MultiResolution (多分辨率)| |-- MySampleRss (RSS)| |-- NotePad (记事本)| |-- RSSReader (RSS阅读器)| |-- SearchableDictionary (目录搜索)| |-- **JNI (JNI例程)| |-- SkeletonApp (空壳APP)| |-- Snake (snake程序)| |-- SoftKeyboard (软键盘)| |-- Wiktionary (?维基)|– Wiktionary** (?wiki routines) |– scripts (scripts) |– sdk (sdk configuration) |– simulator (? emulator) |– testrunner (? for testing)-- tools (一些工具)external 目录.|-- aes (AES加密)|-- apache-http (网页服务器)|-- astl (ASTL (Android STL) is a slimmed-down version of the regular C++ STL.)|-- bison (自动生成语法分析器,将无关文法转换成C、C++)|-- blktrace (blktrace is a block layer IO tracing mechanism)|-- bluetooth (蓝牙相关、协议栈)|-- bsdiff (diff工具)|-- bzip2 (压缩工具)|-- clearsilver (html模板系统)|-- dbus (低延时、低开销、高可用性的IPC机制)|-- dhcpcd (DHCP服务)|-- dosfstools (DOS文件系统工具)|-- dropbear (SSH2的server)|-- e2fsprogs (EXT2文件系统工具)|-- elfcopy (复制ELF的工具)|-- elfutils (ELF工具)|-- embunit (Embedded Unit Project)|-- emma (java代码覆盖率统计工具)|-- esd (Enlightened Sound Daemon,将多种音频流混合在一个设备上播放)|-- expat (Expat is a stream-oriented XML parser.)|-- fdlibm (FDLIBM (Freely Distributable LIBM))|-- freetype (字体)|-- fsck_msdos (dos文件系统检查工具)|-- gdata (google的无线数据相关)|-- genext2fs (genext2fs generates an ext2 filesystem as a normal (non-root) user)|-- giflib (gif库)|-- googleclient (google用户库)|-- grub (This is GNU GRUB, the GRand Unified Bootloader.)|-- gtest (Google C++ Testing Framework)|-- icu4c (ICU(International Component for Unicode)在C/C++下的版本)|-- ipsec-tools (This package provides a way to use the native IPsec functionality )|-- iptables (防火墙)|-- jdiff (generate a report describing the difference between two public JavaAPIs.)|-- jhead (jpeg头部信息工具)|-- jpeg (jpeg库)|-- junit (JUnit是一个Java语言的单元测试框架)|-- kernel-headers (内核的一些头文件)|-- libffi (libffi is a foreign function inte**ce library.)|-- libpcap (网络数据包捕获函数)|-- libpng (png库)|-- libxml2 (xml解析库)|-- mtpd (一个命令)|-- netcat (** Unix utility which reads and writes dataacross network connections)|-- netperf (网络性能测量工具)|-- neven (看代码和JNI相关)|-- opencore (多媒体框架)|-- openssl (SSL加密相关)|-- openvpn (VPN开源库)|-- oprofile (OProfile是Linux内核支持的一种性能分析机制。)|-- ping (ping命令)|-- ppp (pppd拨号命令,好像还没有chat)|-- proguard (Java class file shrinker, optimizer, obfuscator, and preverifier)|-- protobuf (a flexible, efficient, automated mechanism for serializing structured data)|-- qemu (arm模拟器)|-- safe-iop (functions for performing safe integer operations )|-- skia (skia图形引擎)|-- sonivox (sole MIDI solution for Google Android Mobile Phone Platform)|-- speex (Speex编/解码API的使用(libspeex))|-- sqlite (数据库)|-- srec (Nuance 公司提供的开源连续非特定人语音识别)|-- strace (trace工具)|-- svox (Embedded Text-to-Speech)|-- tagsoup (TagSoup是一个Java开发符合SAX的HTML解析器)|-- tcpdump (抓TCP包的软件)|-- tesseract (Tesseract Open Source OCR Engine.)|-- tinyxml (TinyXml is a **, small, C++ XML parser)|-- tremor (I stream and file decoder provides an embeddable,integer-only library)|-- webkit (浏览器核心)|-- wpa_supplicant (无线网卡管理)|-- xmlwriter (XML 编辑工具)|-- yaffs2 (yaffs文件系统)– zlib (a general purpose data compression library) frameworks directory (core framework – java and C++ language).|– base (basic content) | |– api (all are xml files, defining java api) | |– awt (AWT library) | |– build (empty) | |– camera (camera service library) | |– cmds (important commands: am, app_proce, etc.) | |– core (core library) | |– data (font and Sound and other data files) | |– docs (documentation) | |– graphics (graphics related) | |– include (header file) | |– keystore (related to data signing certificate) | |– libs (library) | |– location (region library) | |– media (media related library) | |– obex (bluetooth transfer library) | |– opengl (2D-3D acceleration library) | |– packages (settings, TTS, VPN programs) | |– sax ( XML parser) | |– services (various service programs) | |– telephony (telephony management) | |– test-runner (test tool related) | |– tests (various tests) | |– tools (some called Unnamed tool) | |– vpn (VPN) | -- wifi (无线网络)|-- opt (可选部分)| |-- com.google.android (有个framework.jar)| |-- com.google.android.googlelogin (有个client.jar)|– emoji (standard message elements) -- policies (Product policies are operating system directions aimed at specific uses)– base |– mid (MID device) -- phone (手机类设备,一般用这个)hardware 目录 (部分厂家开源的硬解适配层HAL代码)|-- broadcom (博通公司)|– wlan (wireless card) |– libhardware (hardware library) | |– include (header file )|-- modules (Default (and possibly architecture dependents) HAL modules)| |-- gralloc (gralloc显示相关)|– overlay (Skeleton for the “overlay” HAL module.) |– libhardware_legacy (old hardware library) | |– flashlight (backlight) | |– gps (GPS) | |– include (header) | |– mount (old mounter) | |– power (power) | |– qemu (emulator) | |– qemu_tracing (emulator tracing) | |– tests (tests) | |– uevent (uevent) | |– vibrator (vibrator) | -- wifi (无线)|-- msm7k (高通7k处理器开源抽象层)| |-- boot (启动)| |-- libaudio (声音库)| |-- libaudio-qsd8k (qsd8k的声音相关库)| |-- libcamera (摄像头库)| |-- libcopybit (copybit库)| |-- libgralloc (gralloc库)| |-- libgralloc-qsd8k (qsd8k的gralloc库)| |-- liblights (背光库)|– librpc (RPC library) |– ril (radio abstraction layer) | |– include (header) | |– libril (library) | |– reference-cdma-sms (cdma SMS reference) | |– reference-ril ( ril reference) | -- rild (ril后台服务程序)– ti (TI company open source HAL) | – omap3 (omap3 processor) | | – dspbridge (DSP bridge) | | – libopencorehw (opencore hardware library) | |– liboverlay (overlay hardware library) | |– libstagefrighthw (stagefright hardware library) | -- omx (omx组件)– wlan (wireless network card) prebuilt directory (some resources precompiled under x86 and arm architecture).| – android-arm (arm-android related) | | – gdbserver (gdb debugger) | -- kernel (模拟的arm内核)|-- android-x86 (x86-android相关)|– kernel (empty)|– common (common compiled code, should be java)|– darwin-x86 (drawin x86 platform)|-- toolchain (工具链)| |-- arm-eabi-4.2.1 | |-- arm-eabi-4.3.1 |– arm-eabi-4.4.0 |– darwin-x86_64 (drawin x86 64bit platform) |– linux-x86 (linux x86 platform) | -- toolchain (工具链,我们应该主要用这个)| |-- arm-eabi-4.2.1 | |-- arm-eabi-4.3.1 | |-- arm-eabi-4.4.0 |– i686-unknown-linux-gnu-4.2.1 (x86 version compiler) |– linux-x86_64 (linux x86 64bit platform) |– windows (windows platform) -- windows-x86_64 (64bit windows平台)system 目录 (底层文件系统库、应用及组件——C语言).|-- Bluetooth (蓝牙相关)|-- core (系统核心工具盒接口)| |-- adb (adb调试工具)| |-- cpio (cpio工具,创建img)| |-- debuggerd (调试工具)| |-- fastboot (快速启动相关)| |-- include (系统接口头文件)| |-- init (init程序源代码)| |-- libacc (轻量级C编译器)| |-- libctest (libc测试相关)| |-- libcutils (libc工具)| |-- liblog (log库)| |-- libmincrypt (加密库)| |-- libnetutils (网络工具库)| |-- libpixelflinger (图形处理库)| |-- libsysutils (系统工具库)| |-- libzipfile (zip库)| |-- logcat (查看log工具)| |-- logwrapper (log封装工具)| |-- mkbootimg (制作启动boot.img的工具盒脚本)| |-- netcfg (网络配置netcfg源码)| |-- nexus (google最新手机的代码)| |-- rootdir (rootfs,包含一些etc下的脚本和配置)| |-- sh (shell代码)| |-- toolbox (toolbox,类似busybox的工具集)|– vold (SD card manager) |– extras (extra tools) | |– latencytop (a tool for software developers, identifying system latency happen) | |– libpagemap (pagemap library) | |– librank (Java Library Ranking System library) | |– procmem (pagemap related) | |– procrank (Java Library Ranking System related) | |– showmap (showmap tool) | |– showslab (showslab tool) ) | |– sound (sound related) | |– su (su command source code) | |– tests (some test tools) | -- timeinfo (时区相关)– wlan (wireless related) -- ti (ti网卡相关工具及库)packages 目录.|-- apps (应用程序库)| |-- AlarmClock (闹钟)| |-- Bluetooth (蓝牙)| |-- Browser (浏览器)| |-- Calculator (计算器)| |-- Calendar (日历)| |-- Camera (相机)| |-- CertInstaller (在Android中安装数字签名,被调用)| |-- Contacts (拨号(调用)、联系人、通话记录)| |-- DeskClock (桌面时钟)| |-- Email (Email)| |-- Gallery (相册,和Camera类似,多了列表)| |-- Gallery3D (3D相册)| |-- GlobalSearch (为google搜索服务,提供底层应用)| |-- GoogleSearch (google搜索)| |-- HTMLViewer (浏览器附属界面,被浏览器应用调用,同时提供存储记录功能)| |-- IM (即时通讯,为手机提供信号发送、接收、通信的服务)| |-- Launcher (登陆启动项,显示图片框架等等图形界面)| |-- Launcher2 (登陆启动项,负责应用的调用)| |-- Mms (彩信业务)| |-- Music (音乐播放器)| |-- PackageInstaller (安装、卸载程序的响应)| |-- Phone (电话拨号程序)| |-- Provision (预设应用的状态,使能应用)| |-- Settings (开机设定,包括电量、蓝牙、设备信息、界面、wifi等)| |-- SoundRecorder (录音机,可计算存储所需空间和时间)| |-- Stk (接收和发送短信)| |-- Sync (空) -------○1| |-- Updater (空)|– VoiceDialer (voice recognition call) |– inputmethods (input method) | | – LatinIME (Latin Input Method) | |– OpenWnn (OpenWnn Input Method) | -- PinyinIME (拼音输入法)|-- providers (提供器,提供应用程序、界面所需的数据)| |-- ApplicationsProvider (应用程序提供器,提供应用程序启动项、更新等)| |-- CalendarProvider (日历提供器)| |-- ContactsProvider (联系人提供器)| |-- DownloadProvider (下载管理提供器)| |-- DrmProvider (创建和更新数据库时调用)| |-- GoogleContactsProvider (联系人提供器的子类,用以同步联系人)| |-- GoogleSubscribedFeedsProvider(设置信息提供器)| |-- ImProvider (空)| |-- ManagementProvider (空)| |-- MediaProvider (媒体提供器,提供存储数据)| |-- TelephonyProvider (彩信提供器)| |-- UserDictionaryProvider (用户字典提供器,提供用户常用字字典)|– WebSearchProvider (null) |– services | |– EasService (null) |-- LockAndWipe (空)– wall**s (wallpapers) |– Basic (basic wallpapers, system built-in wallpapers) |– LivePicker (select live wallpapers) |– MagicSmoke (wallpaper special effects) -- MusicVisualization (音乐可视化,图形随音乐而变化)vendor 目录 (厂家定制内容)|-- aosp (android open source project)|– products (some board-level rules) |– htc (HTC) | |– common-open (common part) | | -- akmd (解压img用的工具)| |-- dream-open (G1开放部分)| |-- prebuilt-open (预编译开放部分)|– sapphire-open (open content for this model of sapphire) |– pv-open (nothing) |– qcom (basically empty inside) -- sample (google提供的样例) |-- apps (应用) | |-- client (用户) |– upgrade (upgrade) |– frameworks |-- PlatformLibrary (平台库) |-- products (产品) |-- sdk_addon (sdk添加部分)– skins (skin) `- WVGAMedDpi (WVGA-applicable picture) SDK and OUT directory are not listed (4) ROM structure For HD2, its ROM (whether simulation or direct brush) is mainly composed of initrd, zImage, system. These three parts should be familiar to those who are familiar with Linux. Initrd is responsible for startup, which is essentially a temporary system that is used during boot. (Hehe, it is said that the first and second screens of the various startups are here, such as the gray-backed DFT of the first direct ROM flashing...) zImage is the Linux kernel image. The so-called Android is based on the Linux kernel. In fact, it is also is based on it. In direct brushing, many companies usually package these two items separately into boot.img, which is a boot image. (These two parts will be introduced in detail later when there is an opportunity.) As for the frequently occurring system.img, system.bin, and system.ext2, they are system. Corresponds to the system directory in the update.zip used by the card swipe of the native machine, and everything in it makes various features of Android. In this part, only focus on the analysis of the system directory structure (cuts and cuts from other places, so the coverage is incomplete, and different systems have different contents due to their own customization) (add in advance, the user installation program will exist in the data directory , the sd card is mounted in the sdcard directory): system/app – the programs in this folder are the default components of the system, you can see that they are all files ending in APK format, but some self-made ROMs also contain and APK The odex file corresponding to the file name. [url=]\system\app\AlarmClock.apk[/url] alarm clock[url=]\system\app\Browser.apk[/url] browser[url=]\system\app\Bugreport.apk[/url ] bug report[url=]\system\app\Calculator.apk[/url] calculator[url=]\system\app\Calendar.apk[/url] calendar[url=]\system\app\CalendarProvider. SSL test[url=]\system\bin\su**ceflinger[/url] touch sensor driver[url=]\system\bin\svc[/url] service[url=]\system\bin\system_server[/url ][url=]\system\bin\telnetd[/url] Telnet component[url=]\system\bin\toolbox[/url][url=]\system\bin\wlan_loader[/url][url=]\ system\bin\wpa_cli[/url][url=]\system\bin\wpa_supplicant[/url][url=]\system\etc[/url] From the folder name, all saved system configuration files, Such as core configuration such as APN access point settings. [url=]\system\etc\apns-conf.xml[/url] APN Access Point Configuration File [url=]\system\etc\AudioFilter.csv[/url] Audio Filter Configuration File [url=]\ system\etc\AudioPara4.csv[/url][url=]\system\etc\bookmarks.xml[/url] Bookmarks database [url=]\system\etc\dbus.conf[/url] Bus monitoring configuration file [ url=]\system\etc\dhcpcd[/url][url=]\system\etc\event-log-tags[/url][url=]\system\etc\favorites.xml[/url] Favorites[ url=]\system\etc\firmware[/url] firmware info[url=]\system\etc\gps.conf[/url] GPS settings file[url=]\system\etc\hcid.conf[/url] Kernel HCID configuration file [url=]\system\etc\hosts[/url] Network DNS cache [url=]\system\etc\init. jar[/url][url=]\system\framework\services.odex[/url][url=]\system\framework\ssltest.jar[/url][url=]\system\framework\ssltest.odex[ /url][url=]\system\framework\svc.jar[/url] system service[url=]\system\framework\svc.odex[/url][url=]\system\lib[/url]lib The contents of the directory are mainly low-level libraries of the system, such as the platform runtime library. [url=]\system\lib\libaes.so[/url][url=]\system\lib\libagl.so[/url][url=]\system\lib\libandroid_runtime.so[/url] Android Runtime Time library [url=]\system\lib\libandroid_servers.so[/url] System service component [url=]\system\lib\libaudio.so[/url] Audio processing [url=]\system\lib\libaudioeq. so[/url] EQ equalizer[url=]\system\lib\libaudioflinger.so[/url] audio filter[url=]\system\lib\libbluetooth.so[/url] bluetooth component[url=]\ system\lib\libc.so[/url][url=]\system\lib\libcamera.so[/url] Ultra Camera Component[url=]\system\lib\libcameraservice.so[/url][url=] \system\lib\libcorecg.so[/url][url=]\system\lib\libcrypto.so[/url] encryption component [url=]\system\lib\libdrm1. so[/url] DRM parsing library[url=]\system\media[/url] Media folder, in addition to regular ringtones, there are some system prompt event sounds and boot animation (bootanimation.zip), etc. [url=]\ system\media\audio[/url][url=]\system\media\audio\alarms[/url] alarm sound [url=]\system\media\audio\notifications[/url] alert sound [url=] \system\media\audio\ringtones[/url] Ringtone[url=]\system\media\audio\ui[/url] Interface operation event sound[url=]\system\sounds[/url]Default music test file , there is only one test.mid file, which is used to play the test file. [url=]\system\sounds\test. mid[/url][url=]\system\usr[/url] user folder, including share, keyboard layout, time zone files, etc. [url=]\system\usr\keychars[/url][url=]\system\usr\keylayout[/url][url=]\system\usr\share[/url][url=]\system\usr \srec[/url] 4. The first step of ROM production - compiling if you just customize the ROM instead of making the ROM from scratch (that would be too labor-intensive, one is troublesome, but unnecessary, generally such work is done by the god-level The characters do it for us), then this part is unnecessary. Organic friends think I don’t update, I really don’t have time, and I have to eat one bite at a time, right? Take some time this time, in order to meet everyone's requirements for the amount of updates, I don't need to talk about it myself, I picked a compilation tutorial for the Android system from another website. In order to save space, send a text file: In fact, to put it bluntly, the compilation of the Generic Android system is very simple, and there is a makefile, so what else can you say? Does the make directly output compile? (Written to Xiaobai: makefile is a compilation script file, and its content is configured with source directory, library directory, compilation commands and compilation options. For details, please refer to Baidu or SUN's makefile user manual. The make command is based on the makefile Automatic compilation.) But the difficulty is that for different models, the source code, compilation options, etc. need to be modified... And if nothing is modified (as above), the compiled version is actually a general one, which is not all mobile phones. meaning can be used. In addition, it should be pointed out that due to the large amount of source code, it takes N hours to compile a time, and the data of G is generated, so... Anyway, I have never compiled it... Someday I don't really need to work and study, and then play it slowly and generate it after compilation. The directory structure is as described in the following file: The above is the compilation of the Android system described above, that is, from Google's open source code to the system. img process. At present, Google is open source of Android, and the so-called non-Sense version is the most original version after editing. HTC also has open source ROMs for several models, such as EVO. You can download and compile these source codes from the Internet, and make ROM from scratch. In addition, zImage was also mentioned earlier, which is the Linux kernel and is the bottom layer of the operation. (After you finish flashing the machine, look at the root directory with ES or the like, and you will find that in addition to the files in system.img, there are many other things that are not in the system image.) zImage is compiled by Linux Kernel, the method See attachment: The following is the compilation of zImage of the Caesar machine: you also need to pay attention to the configuration in the compilation of zImage. The above Android has been compiled to generate relevant directories and images, and then packaged (or created a mirror disk for writing) to get system.img or bin or ext2, etc. In fact, the above described methods are all basic methods, these methods are general , which means that it is not tailored to HD2. Therefore, simply by compiling as above, the code can be turned into the original file required for flashing (that is, zImage and the directory structure of the Android ROM mentioned on the previous floor). reboot). What's the problem? It's all about configuration. As for how to configure it, it needs to be explored, which is why many such as MDJ are always sending Kernel (in other words, MDJ has sent Kernel updates two or three times a day several times...) The problem may be caused by the Android system compiling according to the Gerneric method. Less (focus on those so files that are prone to problems, under lib), even if there is a problem, as long as it is not big, you can update some modules by compiling a single one. And because zImage is a whole (single file), once a problem occurs, it means a whole replacement... I often encounter various problems with the ROM, such as the DHD version cannot use the camera for a long time. These problems are caused by not being able to compile the source code and compile options to perfectly match the HD2 hardware. When the great gods repeatedly try to modify the source code and compile options, the problem can be solved. Edited on 2018-05-020​Add a comment​Share​Favorites​Thank you for collecting more answers Chen Yunhao linux, android, apple, Bicycle, network, program 85 people agree with this answer There are two types of third-party rom production: one is to modify and replace binary files, which have achieved certain effects and functions. (Most ROMs) One is to pull the code from an open source project to make modifications (MIUI, CM). The first one is more reliable, because it is all ready-made, as long as you are familiar with what each module does, If there are any advantages and disadvantages, just like building blocks, replace it with the original ROM, and then package the ROM. The basic knowledge of this kind of need is: 1. You need to know what effect you want, and what mobile phone or software is ready-made. 2. Take what you want out of the phone and put it in your ROM. Of course, you must first unpack your ROM. Among them, you need to pay attention to the permissions and dependencies of linux. The connotation here is not overnight, and there is no such systematic learning material. 3. You need to pack your ROM. In fact, every mobile phone in this place is different, so you need to learn. Pull the code down and modify it yourself: This is generally based on a better system that has been modified, such as CM, or MIUI for further modification. The advantage of this is the ability to fully control every aspect of the phone's ROM. The difficulty is that it is too tiring to do it alone, and more knowledge is needed, from kernel to JAVA, from packaging to compiling, and it is difficult for individuals to make an excellent third-party ROM. 1. Need to be familiar with linux2. Need to be familiar with linux kernel3. Need to be familiar with Andorid framework4. Need to be familiar with C, C++, JAVA, shell, python5. Need to be familiar with the hardware details of the target phone 6. Need a certain artist 7. Need an i5 or above or even i7 (Compiling the entire Android over and over again will make you crazy, especially 4.0, xeon 4 cores and 8 threads will take 32 minutes to compile 4.0) 8. It needs perfect testing. If you change it, your ROM will definitely be scolded of. You need to know what effect you want, and what mobile phone or software is already available. 2. Take what you want out of the phone and put it in your ROM. Of course, you must first unpack your ROM. Among them, you need to pay attention to the permissions and dependencies of linux. The connotation here is not overnight, and there is no such systematic learning material. 3. You need to pack your ROM. In fact, every mobile phone in this place is different, so you need to learn. Pull the code down and modify it yourself: This is generally based on a better system that has been modified, such as CM, or MIUI for further modification. The advantage of this is the ability to fully control every aspect of the phone's ROM. The difficulty is that it is too tiring to do it alone, and more knowledge is needed, from kernel to JAVA, from packaging to compiling, and it is difficult for individuals to make an excellent third-party ROM. 1. Need to be familiar with linux2. Need to be familiar with linux kernel3. Need to be familiar with Andorid framework4. Need to be familiar with C, C++, JAVA, shell, python5. Need to be familiar with the hardware details of the target phone 6. Need a certain artist 7. Need an i5 or above or even i7 (Compiling the entire Android over and over again will make you crazy, especially 4.0, xeon 4 cores and 8 threads will take 32 minutes to compile 4.0) 8. It needs perfect testing. If you change it, your ROM will definitely be scolded of. You need to know what effect you want, and what mobile phone or software is already available. 2. Take what you want out of the phone and put it in your ROM. Of course, you must first unpack your ROM. Among them, you need to pay attention to the permissions and dependencies of linux. The connotation here is not overnight, and there is no such systematic learning material. 3. You need to pack your ROM. In fact, every mobile phone in this place is different, so you need to learn. Pull the code down and modify it yourself: This is generally based on a better system that has been modified, such as CM, or MIUI for further modification. The advantage of this is the ability to fully control every aspect of the phone's ROM. The difficulty is that it is too tiring to do it alone, and more knowledge is needed, from kernel to JAVA, from packaging to compiling, and it is difficult for individuals to make an excellent third-party ROM. 1. Need to be familiar with linux2. Need to be familiar with linux kernel3. Need to be familiar with Andorid framework4. Need to be familiar with C, C++, JAVA, shell, python5. Need to be familiar with the hardware details of the target phone 6. Need a certain artist 7. Need an i5 or above or even i7 (Compiling the entire Android over and over again will make you crazy, especially 4.0, xeon 4 cores and 8 threads will take 32 minutes to compile 4.0) 8. It needs perfect testing. If you change it, your ROM will definitely be scolded of.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325494579&siteId=291194637