Andrew Huang
如果是一个ARM-Linux的开发者,不难很快分析出来的Android的分区。
关于分区,可以看一下如下文章:
<>
<>
一.检测Android 手机各种信息
首先安装HTC的USB 驱动。
基本上用Android SDK自带的命令行工具adb 就可以分析各个分区了.
运行如下命令进入Android精减的shell : toolbox
adb shell
下面是直接执行相应命令,这个应当是LINUX开发者比较熟悉一些指令了。
查看Nand flash的分区(即一般人称为ROM)的分区,这是我的HTC G8的分区
adb shell cat /proc/mtd
- E:\huisen\android\sdk\tools>adb shell cat /proc/mtd
-
dev: size erasesize name
-
mtd0: 000a0000 00020000 "misc"
-
mtd1: 00420000 00020000 "recovery"
-
mtd2: 002c0000 00020000 "boot"
-
mtd3: 0fa00000 00020000 "system"
-
mtd4: 02800000 00020000 "cache"
-
mtd5: 0af20000 00020000 "userdata"
查看所有分区adb shell cat /proc/partitions
- E:\huisen\android\sdk\tools>adb shell cat /proc/partitions
-
major minor #blocks name
-
-
31 0 640 mtdblock0
-
31 1 4224 mtdblock1
-
31 2 2816 mtdblock2
-
31 3 256000 mtdblock3
-
31 4 40960 mtdblock4
-
31 5 179328 mtdblock5
-
179 0 1921024 mmcblk0
-
179 1 1920000 mmcblk0p1
显示CPU信息adb shell cat /proc/cpuinfo
- E:\huisen\android\sdk\tools>adb shell cat /proc/cpuinfo
-
Processor : ARMv6-compatible processor rev 2 (v6l)
-
BogoMIPS : 478.41
-
Features : swp half thumb fastmult edsp java
-
CPU implementer : 0x41
-
CPU architecture: 6TEJ
-
CPU variant : 0x1
-
CPU part : 0xb36
-
CPU revision : 2
-
Hardware : buzz
-
Revision : 0081
-
Serial : 0000000000000000
显示运行设备结点
- E:\huisen\android\sdk\tools>adb shell cat /proc/devices
-
Character devices:
-
1 mem
-
5 /dev/tty
-
5 /dev/console
-
5 /dev/ptmx
-
10 misc
-
13 input
-
29 fb
-
81 video4linux
-
90 mtd
-
108 ppp
-
128 ptm
-
136 pts
-
200 ttySA
-
216 rfcomm
-
245 BtPort
-
246 msm_camera
-
247 ttyHSUSB
-
248 adsp
-
249 ttyHS
-
250 ttyHS
-
251 ttyHS
-
252 ttyMSM
-
253 oncrpc
-
254 smd
-
-
Block devices:
-
259 blkext
-
7 loop
-
31 mtdblock
-
179 mmc
-
254 device-mapper
查看运行中进程 adb shell ps
查看/dev设备结点文件 adb shell ls -l /dev
- E:\huisen\android\sdk\tools>adb shell ls -l /dev
-
drwxr-xr-x system system 2011-08-23 14:22 cpuctl
-
drwxr-xr-x root root 2011-08-23 14:22 msm_camera
-
crw-rw---- radio vpn 108, 0 2011-08-23 14:22 ppp
-
drwxr-xr-x root root 2011-08-23 14:22 mtd
-
drwxr-xr-x root root 2011-08-23 14:22 input
-
drwxr-xr-x root root 2011-08-24 15:43 block
-
drwxr-xr-x root root 2011-08-23 14:22 oncrpc
-
crw------- root root 200, 105 2011-08-23 14:22 ttySA1
-
crw------- root root 200, 104 2011-08-23 14:22 ttySA0
-
crw-rw-rw- root root 5, 2 2011-08-24 16:30 ptmx
-
crw------- root root 5, 1 2011-08-23 14:22 console
-
crw-rw-rw- root root 5, 0 2011-08-23 14:22 tty
-
crw------- root root 254, 27 2011-08-23 14:22 smd27
-
crw------- system system 254, 9 2011-08-23 14:22 smd9
-
crw------- root root 254, 1 2011-08-23 14:22 smd1
-
crw-r----- radio radio 254, 0 2011-08-24 15:43 smd0
-
crw------- root root 1, 11 2011-08-23 14:22 kmsg
-
crw-rw-rw- root root 1, 9 2011-08-23 14:22 urandom
-
crw-rw-rw- root root 1, 8 2011-08-23 14:22 random
-
crw-rw-rw- root root 1, 7 2011-08-23 14:22 full
-
crw-rw-rw- root root 1, 5 2011-08-23 14:22 zero
-
crw-rw-rw- root root 1, 3 2011-08-23 14:22 null
-
crw------- root root 10, 21 2011-08-23 14:22 system_bus_freq
-
crw------- root root 10, 22 2011-08-23 14:22 network_throughput
-
crw------- root root 10, 23 2011-08-23 14:22 network_latency
-
crw------- root root 10, 24 2011-08-23 14:22 cpu_dma_latency
-
crw------- root root 10, 25 2011-08-23 14:22 htc-portlist
-
crw-rw---- radio radio 10, 26 2011-08-23 14:22 btdiag
-
drwxr-xr-x root root 2011-08-23 14:22 log
-
crw-rw-rw- root root 10, 31 2011-08-23 14:22 binder
-
crw------- root root 10, 32 2011-08-23 14:22 device-mapper
-
crw-r----- compass system 10, 33 2011-08-23 14:22 akm8973_aot
-
crw-r----- compass system 10, 34 2011-08-23 14:22 akm8973_daemon
-
crw-rw-r-- system radio 10, 35 2011-08-23 14:22 alarm
-
crw-r----- system system 10, 36 2011-08-23 14:22 lightsensor
-
crw-rw---- system bluetooth 10, 223 2011-08-23 14:22 uinput
-
crw------- root root 10, 37 2011-08-23 14:22 keychord
-
crw-r----- compass system 10, 38 2011-08-23 14:22 cm3602
-
crw-rw---- radio radio 10, 39 2011-08-23 14:22 diag_arm9
-
crw-rw---- radio radio 10, 40 2011-08-23 14:22 diag
-
crw-rw---- adb adb 10, 41 2011-08-23 14:22 android_adb_enable
-
crw-rw---- adb adb 10, 42 2011-08-23 14:22 android_adb
-
crw-r----- vpn vpn 10, 200 2011-08-23 14:22 tun
-
crw-r----- compass system 10, 43 2011-08-23 14:22 bma150
-
crw-rw---- system camera 10, 2 2011-08-23 14:22 pmem_camera
-
crw-rw---- system audio 10, 1 2011-08-23 14:22 pmem_adsp
-
crw-rw---- system graphics 10, 0 2011-08-23 14:22 pmem
-
crw-rw-rw- root root 10, 44 2011-08-23 14:22 ashmem
-
crw-rw---- media media 10, 45 2011-08-23 14:22 perflock
-
crw-rw---- system audio 10, 46 2011-08-23 14:22 htc-acoustic
-
crw------- root root 10, 47 2011-08-23 14:22 voc_tx_playback
-
crw------- root root 10, 48 2011-08-23 14:22 voc_tx_record
-
crw------- root root 10, 49 2011-08-23 14:22 voc_rx_playback
-
crw------- root root 10, 50 2011-08-23 14:22 voc_rx_record
-
crw-rw---- system audio 10, 51 2011-08-23 14:22 msm_snd
-
crw-rw---- system audio 10, 52 2011-08-23 14:22 msm_pcm_ctl
-
crw------- root root 10, 53 2011-08-23 14:22 msm_aac
-
crw-rw---- system audio 10, 54 2011-08-23 14:22 msm_mp3
-
crw-rw---- system audio 10, 55 2011-08-23 14:22 msm_audpre
-
crw-rw---- system audio 10, 56 2011-08-23 14:22 msm_pcm_in
-
crw-rw---- system audio 10, 57 2011-08-23 14:22 msm_pcm_out
-
crw------- root root 10, 58 2011-08-23 14:22 smem_log
-
crw-r----- radio radio 10, 59 2011-08-23 14:22 qmi2
-
crw-r----- radio radio 10, 60 2011-08-23 14:22 qmi1
-
crw-r----- radio radio 10, 61 2011-08-23 14:22 qmi0
-
crw------- root root 10, 62 2011-08-23 14:22 radio_feedback
-
crw------- root root 10, 63 2011-08-23 14:22 rfkill
-
drwxr-xr-x root root 2011-08-23 14:22 adsp
-
drwxr-xr-x root root 2011-08-23 14:22 graphics
-
crw------- root root 247, 2 2011-08-23 14:22 ttyHSUSB2
-
crw------- root root 247, 1 2011-08-23 14:22 ttyHSUSB1
-
crw------- system system 247, 0 2011-08-23 14:22 ttyHSUSB0
-
crw------- root root 252, 2 2011-08-23 14:22 ttyMSM2
-
crw------- bluetooth bluetooth 249, 0 2011-08-23 14:22 ttyHS0
-
drwxr-xr-x root root 2011-08-23 14:22 socket
-
drwxr-xr-x root root 1970-01-01 08:00 pts
-
-
E:\huisen\android\sdk\tools>adb shell ls -l /dev/msm_camera
-
crw-rw---- system system 246, 2 2011-08-23 14:22 frame0
-
crw-rw---- system system 246, 1 2011-08-23 14:22 config0
-
crw-rw---- system system 246, 0 2011-08-23 14:22 control0
显示支持文件系统
- E:\huisen\android\sdk\tools>adb shell cat /proc/filesystems
-
nodev sysfs
-
nodev rootfs
-
nodev bdev
-
nodev proc
-
nodev cgroup
-
nodev tmpfs
-
nodev debugfs
-
nodev sockfs
-
nodev pipefs
-
nodev anon_inodefs
-
nodev inotifyfs
-
nodev devpts
-
ext3
-
ext2
-
nodev ramfs
-
vfat
-
yaffs
-
yaffs2
实际文件系统使用情况
- E:\huisen\android\sdk\tools>adb shell cat /proc/mounts
-
rootfs / rootfs ro,relatime 0 0
-
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
-
devpts /dev/pts devpts rw,relatime,mode=600 0 0
-
proc /proc proc rw,relatime 0 0
-
sysfs /sys sysfs rw,relatime 0 0
-
none /acct cgroup rw,relatime,cpuacct 0 0
-
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
-
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
-
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
-
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev,relatime 0 0
-
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
输入设备信息
- E:\huisen\android\sdk\tools>adb shell cat /proc/bus/input/devices
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="h2w headset"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input0
-
U: Uniq=
-
H: Handlers=cpufreq event0 keyreset keychord
-
B: EV=3
-
B: KEY=84 0 38 0 e0800 0 0 0
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="projector_input"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input1
-
U: Uniq=
-
H: Handlers=cpufreq event1
-
B: EV=b
-
B: KEY=400 0 4 0 0 0 0 0 0 0 0
-
B: ABS=11030003
-
-
I: Bus=0019 Vendor=0123 Product=5220 Version=0100
-
N: Name="projector-Keypad"
-
P: Phys=input2
-
S: Sysfs=/devices/virtual/input/input2
-
U: Uniq=
-
H: Handlers=cpufreq event2
-
B: EV=3
-
B: KEY=40008800 40 0 0 0
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="synaptics-rmi-touchscreen"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input3
-
U: Uniq=
-
H: Handlers=cpufreq event3
-
B: EV=b
-
B: KEY=400 0 4 0 0 0 0 0 0 0 0
-
B: ABS=650c00 0
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="proximity"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input4
-
U: Uniq=
-
H: Handlers=cpufreq event4
-
B: EV=9
-
B: ABS=2000000
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="buzz-keypad"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input5
-
U: Uniq=
-
H: Handlers=cpufreq event5 keyreset keychord
-
B: EV=3
-
B: KEY=10000 0 0 0 0 1c0000 0 0 0
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="buzz-nav"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input6
-
U: Uniq=
-
H: Handlers=cpufreq event6
-
B: EV=1
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="lightsensor-level"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input7
-
U: Uniq=
-
H: Handlers=cpufreq event7
-
B: EV=9
-
B: ABS=100 0
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="curcial-oj"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input8
-
U: Uniq=
-
H: Handlers=cpufreq event8 keyreset keychord
-
B: EV=7
-
B: KEY=10000 0 0 0 0 1680 0 0 0
-
B: REL=3
-
-
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
-
N: Name="compass"
-
P: Phys=
-
S: Sysfs=/devices/virtual/input/input9
-
U: Uniq=
-
H: Handlers=cpufreq event9
-
B: EV=9
-
B: ABS=307ff
-
-
-
E:\huisen\android\sdk\tools>
查看完整的启动信息,因为太长了,重定向到c:/hxy/dmesg.txt 查看
adb shell dmesg > c:/hxy/dmesg.txt
阅读(2628) | 评论(0) | 转发(0) |