On 2015.07.30 04:29, Rich N wrote:
> There is a lot of guidance out there for building a Linux driver, but
> I have a very specific problem. I have a device given to me that is
> loaded and running a specific version and build of Android-x86
> (3.10.58-android-x86+), and I must compile a simple kernel driver that
> will load and run on the device. Can someone give me some guidance here?
>
> Specifically:
>
> 1. Do I need the exact kernel source tree that was used to build the
> kernel running on the device, or just a generic one of the same version?
For stability, it's best to build drivers against the same kernel source
tree.
While drivers built against the same version tree may work, but
stability is not guaranteed.
Your kernel version number matches the 3.10.y kernel:
http://git.android-x86.org/?p=kernel/common.git;a=shortlog;h=refs/heads/android-3.10.y
> 3. Assuming I have the correct source tree, do I need to do anything
> especially different from the usual Linux driver build process?
For in-tree drivers, just enable the driver you need in the config file
as a module (assuming that driver doesn't depend on a kernel feature
which cannot be built as a module - in that case, you'll have to rebuild
the kernel).
For out-of-tree drivers, you may have to change some settings in
Makefile to point to your kernel source.