Thursday 31 January 2019

Binder driver protocol does not match user space protocol

After updating my Kernel 4.4 branch and also Android repo syncing of Nougat I started getting Binder driver protocol does not match user space protocol.

Log of my work follows:

  1. Updating kernel headers in bionic is the first step which was highlighted in my previous post
  2. Next I started snooping around and found that frameworks/libs/binder/ProcessState.cpp checks the version and then fails
  3. I wrote a simple C program to check what version the binder driver and the ioctl responds with Version 8
  4. Next I check the kernel headers and find that there is a version switch when BINDER_IPC_32BIT is defined or something else possibly BINDER_IPC_64BIT Ref: https://elixir.bootlin.com/linux/v4.4/source/include/uapi/linux/android/binder.h#L43 and https://elixir.bootlin.com/linux/v4.4/source/include/uapi/linux/android/binder.h#L94
  5. Changed it in the source external/kernel-headers/original/....../binder.h and commented out the BINDER_IPC_32BIT and kept only the 64 bit. This is because the kernel has moved on to 64 bit and there is no support for 32 bit. Due to this the KConfig variable is removed. I have still experiment by manually modifying the .config variable
  6. Ran tools/update_all.py and finally rebuilt the whole AOSP. 
These steps finally  fixed all the issues related to binder.

Next step is to fix the hwcomposer not found issue. Let us see how that goes.

Wednesday 30 January 2019

Updating kernel headers in the AOSP

I updated Linux Kernel 4.4 to the latest revision. I am now trying with AOSP kernel rather than the linux stable kernel.

To update the kernel headers I follow this excellent guide:

https://android.googlesource.com/platform/bionic/+/master/libc/kernel/README.TXT

I am now fixing the errors after the update. I will be updating my progress soon.

Tuesday 29 January 2019

Timed out waiting for device dev-ttyO0.device

While booting my Beaglebone black on debian Rootfs I stumbled upon the following problem:

"Timed out waiting for device dev-ttyO0.device"

To fix this enable CONFIG_FHANDLE in the kernel.

Credits: https://medium.com/@madhav2code/timed-out-waiting-for-device-dev-ttys0-device-827391917c5d