Android Architecture & File System

Taking notes on the Android architecture and file system from a variety of sources

Get Started. It's Free
or sign up with your email address
Rocket clouds
Android Architecture & File System by Mind Map: Android Architecture & File System

1. Partitions

1.1. boot

1.1.1. Kernel image `kernel`

1.1.2. RAM disk `ramdisk`

1.2. system

1.2.1. Mainly contains the Android framework

1.3. recovery

1.3.1. Stores the recovery image

1.3.2. Booted during the OTA (Over-the-air) process

1.4. cache

1.4.1. Stores temporary data

1.4.2. Doesn't need to be writable by bootloader, only erasable

1.5. misc

1.5.1. Used by /recovery and is 4KB or larger

1.6. userdata

1.6.1. Contains user-installed applications and data, including customization data

1.7. metadata

1.7.1. Used when device is encrypted and is 16MB or larger

1.8. vendor

1.8.1. Any binary not distributed via the AOSP. Any vendor-specific stuff. .Think Motorola, Samsung, Sprint, T-Mobile, etc.

1.9. radio

1.9.1. Only necessary for devices that include a radio that have a radio-specific software in a dedicated partiition

1.10. tos

1.10.1. Stores the binary of the Trusty OS. Used only if the device includes Trusty

2. The Android Open Source Project (AOSP)

2.1. Android Open Source Project Documentation

3. Five Data Storage Methods

3.1. Shared Preferences

3.2. Internal Storage

3.3. External Storage

3.4. SQLite

3.5. Network

4. Directories

4.1. /data

4.1.1. /data Common subdirectories of within shared_prefs lib files cache databases

4.2. /sdcard

4.2.1. /data

5. Bootloader

5.1. 1. Bootloader gets loaded first

5.2. 2. Bootloader inits memory

5.3. 3. (Optional) If A/B updates then determine the boot slot to use

5.4. 4. Determine if recovery mode should be booted instead

5.5. 5. Bootloader loads the image, which contains the kernel and RAM disk

5.5.1. If using Treble, then it loads a lot more...

5.5.2. In Android 8.0 they re-architected the Android OS framework

5.5.3. Known as Treble

5.6. 6. Bootloader starts loading the kernel into memory as a self-executable compressed binary

5.7. 7. Kernel decompresses itself and starts executing in memory

5.8. 8. Old vs. New

5.8.1. Old: Load `init` from the RAM disk

5.8.2. New: Load 'init' from the /system partition

5.9. 9. From /system, `init` launches and starts mounting all the other partitions, such as /vendor, /oem, and /odm, and then starts executing code to start the device