zoukankan      html  css  js  c++  java
  • scull device description

    The scull source implements the following devices. Each kind of device implemented by the module is referred to as a type .

    scull0 to scull3

    Four devices, each consisting of a memory area that is both global and persistent. Global means that if the device is opened multiple times, the data contained within the device is shared by all the file descriptors that opened it. Persistent means that if the device is closed and reopened, data isn't lost. This device can be fun to work with, because it can be accessed and tested using conventional commands, such as cp, cat, and shell I/O redirection

     scullpipe0 to scullpipe3

    Four FIFO (first-in-first-out) devices, which act like pipes. One process reads what another process writes. If multiple processes read the same device, they contend for(争夺:好生僻) data. The internals of scullpipe will show how blocking and nonblocking read and write can be implemented without having to resort to interrupts. Although real drivers synchronize with their devices using hardware interrupts, the topic of blocking and nonblocking operations is an important one and is separate from interrupt handling (covered in Chapter 10). 

    scullsingle
    scullpriv

     sculluid

    scullwuid

    These devices are similar to scull0 but with some limitations on when an open is permitted. The first (scullsingle) allows only one process at a time to use the driver, whereas scullpriv is private to each virtual console (or X terminal session), because processes on each console/terminal get different memory areas. sculluid and scullwuid can be opened multiple times, but only by one user at a time; the former returns an error of "Device Busy" if another user is locking the device, whereas the latter implements blocking open. These variations of scull would appear to be confusing policy and mechanism, but they are worth looking at, because some real-life devices require this sort of management.

  • 相关阅读:
    Android 导入工程文件引用包出错
    Android调用系统的打电话和发短信界面(1.将消息内容带过去2.实现群发)
    Android检查手机上是否安装了第三方软件的方法------本文以百度地图为例
    Java中的枚举使用详解
    Android 调用手机上第三方百度地图并传值给地图
    将myeclipse中不适用的插件禁用掉
    WPF DataGridTemplateColumn
    WPF Binding控件某个属性
    WPF VisualStateManager
    WPF Action
  • 原文地址:https://www.cnblogs.com/michile/p/2908826.html
Copyright © 2011-2022 走看看