3

I'm building my first Android image, i noticed that compiling a new kernel is pretty similar to what you can do with a vanilla linux kernel, so no problem with that.

Since a complete Android solution is composed by 2 pieces, kernel + the so called "platform", i'm about to build the platform and to compile the code, the problem is that i noticed that i have to set some values for some attributes like the ones for the bluetooth, this values are required for the bluetooth in order to be recognized and simply work, my question is: what i'm setting? What is the drivers-related architecture under Android?

I could not understand this also because most commercial phones have a kernel that does not support modules, so if can't load drivers dinamically from places out of the kernel, how this thing works?

user827992
  • 1,743
  • 13
  • 25
  • There are both kernel and userspace "drivers". One generic example would be things like fuse filesystems. But for many hardware components, the interface channel is relatively understood and might use a kernel driver (i2c for example), but the knowledge of what to say on that interface to accomplish a result is contained in a userspace component, possibly a proprietary binary. – Chris Stratton Jul 06 '12 at 16:17

2 Answers2

3

Complete Android OS is composed of three pieces. 1) The official AOSP source code. 2) A device specific kernel. 3) Proprietary binaries for Specific device(Drivers for hardware like camera,sensors etc..).

1) Official AoSP source code you can download using repo sync visit the link Start Here

2) Device specific kernel You get it from manufacturer of the device.They will provide the binary image of the kernel.

3) Device specific binaries You have to extract it from the device by connecting it to your pc.You can google for your device configuration.You can find various device configuration on github.com for example Device configuration for lenovo ideapad a1 You will find extract-files.sh file.Run this file to get your drivers.This is the linux shell script which extract the proprietary binaries from the device.

I hope this helps. Thank You.

Ashwin N Bhanushali
  • 3,872
  • 5
  • 39
  • 59
1

This post has a lot of good information on Android. The Linux kernel in Android uses drivers that are loaded and maintained by the kernel. You can also use kernel modules: Building kernel module for Android

To load a driver under Android:

You will need a dev environment setup to cross-compile for the Android device, then compile the source as a module and load it into the kernel from a command line:

insmod <module>

If you don't get an error, it's loaded.

Community
  • 1
  • 1
Alex W
  • 37,233
  • 13
  • 109
  • 109
  • this is what i already know, but this just reinforces my doubt, what is the point about setting all this flags for the platform? This is the architecture, but how it works? I also do not care for kernel modules i do not write about them, i just want to know how the drivers works. – user827992 Jul 06 '12 at 15:05
  • @user827992 The point is that Android is just like any other Linux distribution. The kernel controls/loads the drivers. – Alex W Jul 06 '12 at 15:09
  • @AlexW as on other modern linux distributions, the "drivers" are not all necessarily in kernel space. – Chris Stratton Jul 06 '12 at 16:19