上一篇讲到了一些分析驱动之前的一些准备工作,驱动模块的部分也讲了一部分,今天我们重点讲一下,android驱动模块初始化的流程,即如何配置加载模块,如何调试模块。
声明一下,我用的源码是android4.3源码,内核是goldfish内核,在模拟器emulator上跑的,驱动模块是最简单的helloworld
源码的编译过程我就不在这介绍了,包括编译之前的各种配置,可以看官方配置http://source.android.com/source/building.html,也可以看老罗的博客,http://blog.csdn.net/luoshengyang/article/details/6559955,这里就不详细介绍了,下面重点看一下我们今天的重点,在内核中编译驱动模块,并初始化:
1:首先是下面andorid源码,
Depending on which kernel you want,
$ git clonehttps://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/exynos.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git
· The goldfish project contains the kernel sources for the emulated platforms.
· The msm project has the sources for ADP1, ADP2, Nexus One, Nexus 4, and can beused as a starting point for work on Qualcomm MSM chipsets.
· The omap project is used for PandaBoard and Galaxy Nexus, and can be used as astarting point for work on TI OMAP chipsets.
·