gpt4 book ai didi

linux - 创 build 备文件 : Linux device driver

转载 作者:太空宇宙 更新时间:2023-11-04 09:51:28 26 4
gpt4 key购买 nike

如何在不使用 mknodMAKEDEV 的情况下(即通过使用动态注册)创 build 备文件。

最佳答案

假设你想在插入时动态分配一个主设备号给一个字符设备,使用:

int alloc_chrdev_region(dev_t *dev, unsigned int firstminor, unsigned int count, char *name);

来自 Linux 设备驱动程序第 3 版。谷歌一下,你可以免费获得整本书以及大量用于与驱动程序打交道的优秀源代码。

关于linux - 创 build 备文件 : Linux device driver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10652850/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com