作者:喵喵方小幺 | 来源:互联网 | 2023-09-12 18:35
FirefoxOS 的编译过程依赖了 android 的 SDK 和 NDK,并且为了减少开发成本,它利用了android 现有的驱动以及底层的工具如 adb 等。
当刷机 Firefox OS 之后我们的 adb 命令依然可以像操作 android 一样使用。接下来我们简要分析 Firefox 的系统结构,主要根据就是 adb shell ps 得到的进程列表。
Linux 内核
从前面的进程可以看出 Firefox 是基于Linux 内核,这一点没有任何疑问。
firefoxOS 和 android 的关系
可以从基础服务进程的对比中发现: firefox 主要去除了 zygote, sufaceflinger 增加了 b2g
所以 firefox 没有 java 的执行环境,它的视图显示的方法也完全不同于android
而新增的 b2g 则是 boot to Gecko 的缩写,推测其为系统的核心进程
b2g
在运行几个应用之后发现,在 top 命令下排在第一第二位子的是 b2g 和 plugin-container 所以可以推测其执行方式类似于浏览器和浏览器插件
PID | CPU% | #THR | VSS | RSS | PCY | UID | Name |
473 | 38% | 12 | 75604K | 39468K | fg | app_473 | /system/b2g/plugin-container |
77 | 31% | 45 | 196096K | 85448K | fg | root | /system/b2g/b2g |
53 | 1% | 1 | 0K | 0K | fg | root | irq/173-k3g |
490 | 0% | 1 | 996K | 404K | fg | root | top |
42 | 0% | 1 | 0K | 0K | fg | root | kworker/u:1 |
4 | 0% | 1 | 0K | 0K | fg | root | kworker/0:0 |
进程列表
USER | PID | PPID | NAME |
root | 1 | 0 | /init |
root | 2 | 0 | kthreadd |
root | 3 | 2 | ksoftirqd/0 |
root | 4 | 2 | kworker/0:0 |
root | 6 | 2 | khelper |
root | 7 | 2 | suspend |
root | 8 | 2 | sync_supers |
root | 9 | 2 | bdi-default |
root | 10 | 2 | kblockd |
root | 11 | 2 | khubd |
root | 12 | 2 | kinteractiveup |
root | 14 | 2 | kswapd0 |
root | 15 | 2 | fsnotify_mark |
root | 16 | 2 | crypto |
root | 29 | 2 | kapmd |
root | 30 | 2 | pvr_timer |
root | 31 | 2 | sec_jack_wq |
root | 32 | 2 | irq/38-sec_head |
root | 33 | 2 | irq/167-fsa9480 |
root | 34 | 2 | mtdblock0 |
root | 35 | 2 | mtdblock1 |
root | 36 | 2 | mtdblock2 |
root | 37 | 2 | mtdblock3 |
root | 38 | 2 | mtdblock4 |
root | 39 | 2 | mtdblock5 |
root | 40 | 2 | mtdblock6 |
root | 41 | 2 | spi_gpio.3 |
root | 43 | 2 | kworker/u:2 |
root | 50 | 2 | f_mtp |
root | 51 | 2 | file-storage |
root | 52 | 2 | irq/308-mxt224_ |
root | 53 | 2 | irq/173-k3g |
root | 54 | 2 | gp2a_wq |
root | 56 | 2 | irq/172-s3c-sdh |
root | 57 | 2 | binder |
root | 58 | 2 | krfcommd |
root | 59 | 2 | irq/334-cypress |
root | 60 | 2 | max8998-charger |
root | 61 | 2 | irq/39-max8998- |
root | 62 | 1 | /sbin/ueventd |
root | 63 | 2 | yaffs-bg-1 |
root | 64 | 2 | mmcqd/0 |
root | 65 | 2 | mmcqd/0boot0 |
root | 66 | 2 | mmcqd/0boot1 |
root | 67 | 2 | yaffs-bg-1 |
root | 68 | 2 | jbd2/mmcblk0p1- |
root | 69 | 2 | ext4-dio-unwrit |
root | 71 | 2 | jbd2/mmcblk0p2- |
root | 72 | 2 | ext4-dio-unwrit |
system | 73 | 1 | /system/bin/servicemanager |
root | 74 | 1 | /system/bin/vold |
root | 77 | 1 | /system/bin/fakeperm |
root | 78 | 1 | /system/b2g/b2g |
radio | 79 | 1 | /system/bin/rilproxy |
root | 80 | 1 | /system/bin/netd |
root | 81 | 1 | /system/bin/debuggerd |
radio | 82 | 1 | /system/bin/rild |
drm | 83 | 1 | /system/bin/drmserver |
media | 84 | 1 | /system/bin/mediaserver |
bluetooth | 85 | 1 | /system/bin/dbus-daemon |
root | 86 | 1 | /system/bin/installd |
keystore | 87 | 1 | /system/bin/keystore |
gps | 88 | 1 | /system/vendor/bin/gpsd |
shell | 89 | 1 | /system/bin/sh |
root | 90 | 1 | /sbin/adbd |
root | 119 | 2 | pvr_workqueue |
root | 170 | 2 | flush-179:0 |
root | 230 | 2 | iscan_sysioc |
root | 231 | 2 | dhcp_sysioc |
root | 232 | 2 | dhd_watchdog |
root | 233 | 2 | dhd_dpc |
root | 234 | 2 | dhd_sysioc |
wifi | 242 | 1 | /system/bin/wpa_supplicant |
app_249 | 249 | 78 | /system/b2g/plugin-container |
app_252 | 252 | 78 | /system/b2g/plugin-container |
dhcp | 261 | 1 | /system/bin/dhcpcd |
app_339 | 339 | 78 | /system/b2g/plugin-container |
root | 356 | 90 | /system/bin/sh |
app_442 | 442 | 78 | /system/b2g/plugin-container |
root | 453 | 2 | kworker/u:1 |
root | 454 | 2 | flush-31:4 |
root | 455 | 2 | flush-31:6 |
app_462 | 462 | 78 | /system/b2g/plugin-container |
root | 500 | 2 | kworker/u:3 |
root | 509 | 2 | kworker/0:1 |
app_558 | 558 | 78 | /system/b2g/plugin-container |
app_572 | 572 | 78 | /system/b2g/plugin-container |
app_593 | 593 | 78 | /system/b2g/plugin-container |