<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - 『Linux Device Drivers』</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=52</link>
    <description>Latest 20 threads of 『Linux Device Drivers』</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Thu, 09 Apr 2026 22:01:33 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>linux get_random_bytes error: implicit declaration of function</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8891</link>
      <description><![CDATA[在使用 get_random_bytes() 函数获取随机数时，提示错误：

解决办法时，要包含相应的头文件：]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Thu, 09 Apr 2015 07:30:19 +0000</pubDate>
    </item>
    <item>
      <title>udev 设备文件系统简介</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=3169</link>
      <description><![CDATA[在 2.4 内核中，使用的是 devfs 设备文件系统，但在 2.6 内核中，devfs 被抛弃，取而代之的是 udev 。

udev 完全在用户态工作(u 表示 user space)，它利用设备加入或移除时内核所发出的热插拔事件 (hotplug event)工作。在热插拔时，内核会将设备的详细信息输出到位于  ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Tue, 01 Mar 2011 11:34:32 +0000</pubDate>
    </item>
    <item>
      <title>llseek 文件定位</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=2804</link>
      <description><![CDATA[在 lld3 中的 scull 中的 llseek 方法举例为：

函数的返回类型是 loff_t ，此类型被定义为 long long 型，在 32 位平台上，为 64 位：

第 2 个参数 off 表示文件偏移。这个值就是 lseek() 函数中的第 2 个参数，即用户想要的偏移值。lseek() 函数的定义为：

设备文件 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Wed, 13 Oct 2010 15:38:31 +0000</pubDate>
    </item>
    <item>
      <title>插入模块时提示：Device or resource busy</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=2765</link>
      <description><![CDATA[遇到这种情况，需要考虑模块中使用的主设备号是不是手动分配的，如果是，则有可能造成和已加载的模块冲突，从而提示此错误。解决办法是更换主设备号，或者使用 alloc_chrdev_region() 动态分配设备号。]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sat, 18 Sep 2010 08:50:19 +0000</pubDate>
    </item>
    <item>
      <title>输入输出复用的实现</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1351</link>
      <description><![CDATA[select() 和 poll() 函数可以实现应用程序的输入输出复用函数。设备函数中的 poll() 内容结构较为简单，但多数设备驱动程序种的显示方式基本相同。关于应用程序里的 select() 和 poll() 相关内容见：
http://www.groad.net/bbs/read.php?tid-1251.html
http://www.groad ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Mon, 09 Nov 2009 09:44:25 +0000</pubDate>
    </item>
    <item>
      <title>并发控制</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1296</link>
      <description><![CDATA[并发 ( concurrency )指的是多个执行单元同时、并行执行，而并发的执行单元对共享资源( 硬件资源和软件上的全局变量、静态变量等 )的访问则很容易导致竞态( race conditions )。

1、对称多处理器 (SMP)
SMP 是一种紧耦合、共享存储的系统模型，其体系结构如下图所示， ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sun, 25 Oct 2009 08:36:07 +0000</pubDate>
    </item>
    <item>
      <title>阻塞型输入输出</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1295</link>
      <description><![CDATA[阻塞型输入输出是指硬件没有结束处理时，暂停进程并进入等待的过程。为了处理这种情况，设备驱动程序引入了“等待队列”(waiting queue)的概念。

使应用程序进入睡眠的简单方法是使用 sleep() 函数，另外使用 select() 或 poll()　函数在一定时间内，或直到感兴趣的事 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Fri, 23 Oct 2009 15:45:03 +0000</pubDate>
    </item>
    <item>
      <title>内核定时器</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1230</link>
      <description><![CDATA[设备驱动程序免不了周期性地检测硬件的状态，或者控制了硬件后，再检测硬件是否正常运行，此时设备驱动程序就要具备超过指定时间便执行特定函数的功能。这些工作可以利用内核定时器来完成。

Linux 内核在发生了定时器中断后，会监测称为内核定时器目录的数据结构。在这 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Tue, 29 Sep 2009 07:27:15 +0000</pubDate>
    </item>
    <item>
      <title>时间处理</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1218</link>
      <description><![CDATA[概述
创建设备驱动程序的过程中会涉及到多种时间相关内容。内核中为了处理这些时间相关内容，把全局变量 jiffies_64 ( 2.6 内核 )作为时间的基准值 ( 2.4 内核中用 jiffies )。

设备驱动程序利用该基准值测定时间的流逝，并根据该时间控制硬件。为了进行时间的相关处理 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sun, 27 Sep 2009 16:19:09 +0000</pubDate>
    </item>
    <item>
      <title>模块参数|内核变量</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1101</link>
      <description><![CDATA[设备驱动程序通常使用固定的内部变量值，而由源代码指定该变量。根据具体情况，还可在运行设备驱动程序之前修改变量。如在 linux系统启动时，在选择系统菜单的下方可以看到视频参数的设置 ---这类参数属于初始化变量，可在加载或卸载模块时进行修改。通常利用 bootloade ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sun, 30 Aug 2009 08:09:24 +0000</pubDate>
    </item>
    <item>
      <title>2.4内核与2.6内核用于模块编译的 Makefile</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1100</link>
      <description><![CDATA[1、2.4内核中编译外部模块的 Makefile

代码：
 
第 1 行
指定编译的模块将要引用的内核源代码目录。模块与内核有着紧密联系，为了防止因版本出错，要统一运行模块的内核源代码。此时可以直接指定源代码，也可以间接指定其代码。该结构对于编译内核后利用 make modules_ ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sat, 29 Aug 2009 19:13:08 +0000</pubDate>
    </item>
    <item>
      <title>字符设备驱动的组成</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1094</link>
      <description><![CDATA[在 Linux 系统中，字符设备驱动由如下几个部分组成。

1、字符设备驱动模块加载与卸载函数

在字符设备驱动模块加载函数中应该实现设备号的申请(也可以事先指定)和 cdev 的注册，而在卸载函数中实现设备号的释放和 cdev 的注销。

通常的，习惯将设备定义为一个设备相关 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Fri, 28 Aug 2009 18:06:05 +0000</pubDate>
    </item>
    <item>
      <title>cdev 结构体与字符设备的注册</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1083</link>
      <description><![CDATA[在 linux 2.6内核中，使用 cdev结构体描述字符设备，cdev 的定义在  中可找到，其定义如下：
 

cdev 结构体中的 dev_t 成员定义了设备号，为 32 位，其中高 12 位为主设备号，低 20 位为次设备号。
其中，struct kobject 是内嵌的 kobject 对象；
&#160;&#160;&#160;&amp;# ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Wed, 26 Aug 2009 11:35:35 +0000</pubDate>
    </item>
    <item>
      <title>inode 结构体</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1080</link>
      <description><![CDATA[内核在内部用 inode 结构体用来表示文件。因此，它和 file structure 用来表示一个打开了的文件描述符并不相同。对于一个文件，可能会有多个 file structure 对应着多个已打开的多个文件描述符，但是这都只能指向同一个 inode 结构。

inode 结构里包含大量关于文件的信 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Wed, 26 Aug 2009 09:31:23 +0000</pubDate>
    </item>
    <item>
      <title>struct file 结构体</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1076</link>
      <description><![CDATA[在 file_operations 结构体中，会看到许多函数指针所指向的函数都必须传进 struct file 结构体指针 struct file * 作为参数。struct file 结构体定义在  中，完整如下：

在设备驱动中，struct file 结构体也是一个非常重要的数据结构。注意的是，这里的 file 和应用程 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Tue, 25 Aug 2009 18:22:14 +0000</pubDate>
    </item>
    <item>
      <title>不同内核版本对 struct file_operations 变量的定义</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1073</link>
      <description><![CDATA[2.4 内核和 2.6 内核中对字符设备驱动程序的 file_operaions结构体定义了不同的实际域值。2.6内核中可以使用 2.4 内核的形式，但是最好使用相应版本的定义方式。没有定义不使用的域值时，初始化为 NULL 。

2.4 内核中的定义实例：
 

2.6 内核中的定义实例：


这种声 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Tue, 25 Aug 2009 17:18:40 +0000</pubDate>
    </item>
    <item>
      <title>字符设备的运作方式</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1061</link>
      <description><![CDATA[字符设备驱动程序利用应用程序中的低级文件函数在设备文件上读取或写入数据，此时，可以调用相应的设备驱动程序定义的函数，如下图所示：

如图中，为了从设备文件读取数据，应用程序调用了 read() 函数，这时系统就调出字符设备驱动程序为 read() 所定义的 dev_read()  ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sat, 22 Aug 2009 08:04:39 +0000</pubDate>
    </item>
    <item>
      <title>设备驱动程序控制方式</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1060</link>
      <description><![CDATA[设备驱动程序控制方式如下图所示：


由上图可见，应用程序控制控制硬件的必要要素包括：应用程序、设备文件、设备驱动程序以及硬件。
应用程序应用程序是指利用系统函数或程序自定义函数运行特殊功能的程序。 在 Linux 中，应用程序运行在用户空间，并且只控制系统分配 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sat, 22 Aug 2009 03:14:14 +0000</pubDate>
    </item>
    <item>
      <title>内核符号表(The kernel Symbol Table)</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1030</link>
      <description><![CDATA[所谓内核符号表就是在内核内部函数或变量中可供外部引用的函数和变量的符号表。在 2.6 内核下，使用以下命令可以看到内核符号表：

在内核符号表中，左边一列是符号地址，右边一列是函数和变量。在一个模块加载后，任何一个被模块导出的符号都会成为内核符号表的一部分 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Wed, 12 Aug 2009 16:16:19 +0000</pubDate>
    </item>
    <item>
      <title>设备驱动程序目录</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=1021</link>
      <description><![CDATA[drivers/acorn/
ACORN 系统使用 ARM 核心的 32 位处理器，与普通 PC 相似，包含了控制 ACORN 系统所用硬件的设备驱动程序源代码。

drivers/acpi/
ACPI 是 Advanced Configuration and Power Interface 的缩写，意思是“高级配置与电源接口”，这是英特尔、微软和东芝共 ...]]></description>
      <category>『Linux Device Drivers』</category>
      <author>beyes</author>
      <pubDate>Sun, 09 Aug 2009 13:32:51 +0000</pubDate>
    </item>
  </channel>
</rss>