首页 文章

编写内置Linux驱动程序

提问于
浏览
1

开发内置Linux驱动程序有哪些步骤?

我的意思是我必须修改哪些文件才能在内核启动时安装驱动程序?

谢谢Gest

2 回答

  • 0
    • cd /path/to/Kernel

    • make menuconfig

    • 使用箭头键突出显示 Device Drivers ,然后按Enter键

    • 现在突出显示您想要内置的驱动程序并按 y

    注意:只有前缀为 < > 的驱动程序才能构建为模块 . 按 Y 包括, N 排除, M modularizes功能 .

    Also note that there are some drivers which have two states, i.e built-in or not-included, and these drivers cannot be modularized.

    图例:[*]内置[]排除模块<>模块功能

    例如,如果用户想要构建I2C驱动程序

    • cd /path/to/Kernel

    • make menuconfig

    • 设备驱动程序---->(突出显示并按Enter键)

    • I2C支持(突出显示并按'Y')

    现在M将被_799612替换,即I2C驱动程序现在是内置的 . 立即构建内核并享受乐趣 .

  • 1

    如果您知道目标的正确defconfig文件以及驱动程序或子系统的配置名称,则可以直接将其添加到 /arch/xxxx(arm/sparc/..)/config/***_defconfig 中作为 CONFIG_I2C=y .

相关问题