初学驱动之 scull 为何物?

首先看scull 设备的结构体的一个定义:

struct scull_dev {
    struct scull_qset *data;  /* Pointer to first quantum set. */
    int quantum;              /* The current quantum size. */
    int qset;                 /* The current array size. */
    unsigned long size;       /* Amount of data stored here. */
    unsigned int access_key;  /* Used by sculluid and scullpriv. */
    struct mutex mutex;       /* Mutual exclusion semaphore. */
    struct cdev cdev;     /* Char device structure. */
};

这里面的scull是什么意思? (还是要看原文啊 不然还以为是个新的单词)
scull(simple character utility for loading localities,区域装载的简单字符工具)是一个操作内存区域的字符设备驱动程序,这片内存区域就相当于一个字符设备。
还是看图说话,比较方便
初学驱动之 scull 为何物?
因为先是要有基本的单元,其次是用链表连接起来这些基本的单元,然后组成一个集合。
至于名字叫做量子,那就无所谓了,反正主要主要是为了方便简单的内存分配。

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-10-03
  • 2022-01-24
  • 2022-12-23
  • 2022-02-07
  • 2021-04-05
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案