Monday, April 2, 2012

As Headless as an Android gets

Minor changes and now it's Headless. See the updated patch page.

Here is my ps of my currently running system:

# ps
USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
root      1     0     324    188   800d4fa4 0000875c S /init
root      2     0     0      0     8006d344 00000000 S kthreadd
root      3     2     0      0     8005cf24 00000000 S ksoftirqd/0
root      4     2     0      0     8008d2cc 00000000 S watchdog/0
root      5     2     0      0     80069bdc 00000000 S events/0
root      6     2     0      0     80069bdc 00000000 S khelper
root      9     2     0      0     80073e50 00000000 S async/mgr
root      10    2     0      0     80069bdc 00000000 S pm
root      13    2     0      0     80069bdc 00000000 S suspend
root      87    2     0      0     80041cf4 00000000 S usb_wakeup thre
root      227   2     0      0     800a5588 00000000 S sync_supers
root      229   2     0      0     800a5ff0 00000000 S bdi-default
root      231   2     0      0     80069bdc 00000000 S kblockd/0
root      241   2     0      0     80069bdc 00000000 S mxc_spi.0
root      249   2     0      0     80069bdc 00000000 S otg_switch/0
root      255   2     0      0     80268948 00000000 S khubd
root      277   2     0      0     80069bdc 00000000 S kmmcd
root      299   2     0      0     80069bdc 00000000 S rpciod/0
root      317   2     0      0     8008d514 00000000 S khungtaskd
root      318   2     0      0     8009fe28 00000000 S kswapd0
root      366   2     0      0     80069bdc 00000000 S aio/0
root      376   2     0      0     80069bdc 00000000 S nfsiod
root      380   2     0      0     80069bdc 00000000 S crypto/0
root      997   2     0      0     80210978 00000000 S kapmd
root      1068  2     0      0     802913c4 00000000 S file-storage
root      1116  2     0      0     80069bdc 00000000 S kstriped
root      1119  2     0      0     80069bdc 00000000 S kconservative/0
root      1126  2     0      0     80069bdc 00000000 S vpu_wq/0
root      1128  2     0      0     802e9fec 00000000 S hwevent
root      1133  2     0      0     80069bdc 00000000 S esdhc_wq/0
root      1136  2     0      0     80069bdc 00000000 S esdhc_wq/0
root      1143  2     0      0     80069bdc 00000000 S usbhid_resumer
root      1146  2     0      0     80069bdc 00000000 S binder
root      1156  2     0      0     802fe5c4 00000000 S mmcqd
root      1197  1     300    156   800d4fa4 0000875c S /sbin/ueventd
root      1958  2     0      0     80143604 00000000 S jbd2/mmcblk0p2-
root      1959  2     0      0     80069bdc 00000000 S ext4-dio-unwrit
root      1961  2     0      0     80143604 00000000 S jbd2/mmcblk0p5-
root      1962  2     0      0     80069bdc 00000000 S ext4-dio-unwrit
root      1963  2     0      0     80143604 00000000 S jbd2/mmcblk0p6-
root      1964  2     0      0     80069bdc 00000000 S ext4-dio-unwrit
root      1966  1     744    268   8005ac1c 6fd0c3ac S /system/bin/sh
system    1967  1     816    176   80313b44 6fd0b6fc S /system/bin/servicemanager
root      1968  1     3872   380   ffffffff 6fd0bdac S /system/bin/vold
root      1969  1     3868   452   ffffffff 6fd0bdac S /system/bin/netd
root      1970  1     820    204   800d4fa4 6fd0b844 S /system/bin/dispd
root      1971  1     676    148   8034ab44 6fd0c0cc S /system/bin/debuggerd
root      1972  1     83412  26312 800d4fa4 6fd0b844 S zygote
media     1973  1     24288  4492  ffffffff 6fd0b6fc S /system/bin/mediaserver
bluetooth 1974  1     1264   184   800d4fa4 6fd0c59c S /system/bin/dbus-daemon
root      1975  1     824    208   803c9edc 6fd0b45c S /system/bin/installd
keystore  1976  1     1752   284   8034ab44 6fd0c0cc S /system/bin/keystore
radio     1977  1     4444   396   ffffffff 6fd0bdac S /system/bin/rild
system    2032  1972  127452 29024 ffffffff 6fd0b6fc S system_server
root      2170  1966  904    308   00000000 6fd0b45c R ps

7 comments:

  1. Interesting project. Thanks for sharing the details on your blog.
    How does the free memory comparison from /proc/meminfo look like here -- with and without the UI components? Just trying to understand how minimum RAM requirements change with headless Android.

    ReplyDelete
  2. I will reload my development board and get you meminfo comparisons. In the mean time, what I'm seeing is a decrease of around 180MB (189,579,736 bytes) of RAM usage, just in the base default running packages.

    ReplyDelete
  3. I pulled some information together regarding the changes on the same board with the same kernel, etc, running and the only changes being the changes in Headless Android. I'll post a new blog post with that information so I can format it so it's easy to read. Take a look at that blog post for the details.

    ReplyDelete
  4. Hi, Casey, Great posts on headless Android. I would like to know if you have the step by step guide on building headless Android. Thanks. I have subscribed. John zhu

    ReplyDelete
  5. John,

    There are no changes to the standard build as documented by the folks at Android. Just apply this patch after all the source is downloaded, but before you do the lunch step.


    http://dl.dropbox.com/u/24888185/headless_android.patch

    ReplyDelete
  6. Hi, Casey, Your investigation about removing Androids UI is very interesting. Can you tell me what i am supposed to see on my screen when i am booting your headless Android? Does it show the bootlogo first, followed by a black screen after successful boot?

    ReplyDelete
  7. Well, now that's an interesting question. I haven't actually tried the headless android patch on something that's not headless. To me a successful boot gives me a boot prompt on the console. :-)

    I would certainly expect the behavior you are seeing thought. The first boot image comes from the kernel boot. Once the kernel is booted to the point where it hands control over to the graphics subsystem, then Android kicks in. Since the Headless Android patch removes all the surface flinger capabilities, I would expect nothing to display once the kernel passes control to Android.

    So, in conclusion, yes, that's probably what you'll see.

    ReplyDelete