驱动那些事儿之二:驱动模块初始化浅析

本文详细介绍了在Android 4.3环境下,针对goldfish内核进行驱动模块初始化的过程。内容包括:获取goldfish内核源码、配置交叉编译工具、编写Hello World驱动、配置Makefile和Kconfig文件、编译内核及驱动模块、通过emulator加载内核镜像,并使用adb工具将驱动模块推送到模拟器中,最后通过insmod加载模块并使用dmesg进行调试。
摘要由CSDN通过智能技术生成

上一篇讲到了一些分析驱动之前的一些准备工作,驱动模块的部分也讲了一部分,今天我们重点讲一下,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.

·        

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值