linux来源usb驱动在哪下载,Linux USB驱动程序基础

非常好的linux驱动入门,介绍详尽

Linux USB驱动程序基础

来源: ChinaUnix博客日期:2008.04.10 23:55(共有条评论) 我要评论

(

Linux USB Driver Basics

Introduction

Drivers are software components that operating systems use to provide

hardware specific services to applications. This webpage attempts to document

the basics of USB drivers on Linux. The goal here is to provide you with a basic understanding of how USB device drivers on Linux work.

The File Abstraction

Linux, like other Unix derived operating systems, tries to make applications simpler by providing a common hardware abstraction, the File. Essentially, interactions with almost all hardware can be abstracted into the same interface

that the operating system provides for manipulating files. Hence, you can "Open"

a driver, "Read" a driver, "Write" to a driver and "Close" a driver. This

abstraction extends all the way into the application, who can use the same

system calls that it uses to open and manipulate files to talk to hardware.

The way this works is that the kernel creates nodes in the file system,

typically located in /dev that represent a particular interface to a driver. To

talk to a particular driver an application will open the /dev entry associated

with that driver. The file descriptor returned by that open is passed to all

future system calls (read, write, select), and is eventually passed to

close.

Besides drivers, Unix also uses this file paradigm for various different

kinds of IPC, and even for socket communications over a network.

It is quite surprising how many completely different kinds of hardware can be modeled with just 4 operations (open, close, read and write). That said, their

is another very important system call that unix applications developers commonly use, select(). The select() system call allows applications to poll and

determine whether data could be read from, or written to a file descriptor

without blocking.

Sometimes a piece of hardware provides some functionality that doesn't fit

well into this file centric paradigm. To allow for this, unix applications

typically make use of the ioctl() system call. This call takes a numeric value

that is essentially an identifier for a specific piece of functionality in the

driver.

The Job of the Device Driver

Simply stated, it is the job of the driver to provide functions that the

kernel can use to implement this file programming paradigm. Applications do not directly call functions in the driver, instead they call functions in libc that

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/443523.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux中ss实现原理,ss 详解

ss用来显示处于活动状态的套接字信息。ss命令可以用来获取socket统计信息,它可以显示和netstat(参考https://www.jianshu.com/p/7630474c39b1)类似的内容。但ss的优势在于它能够显示更多更详细的有关TCP和连接状态的信息,而且比netstat更快速更高效。当服…

Hibernate3.X实现基于CLOB字段类型的注解方式:

一:Hibernate3.X实现基于CLOB字段类型的注解方式的例子:下面直接上代码: 二:UserInfo.java package cn.gov.csrc.cms.model;import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity;…

linux mint安装步骤,Linux mint 安装步骤

##Linux mint 安装步骤##家里的笔记本以前一直用Deepin系统,但是Deepin系统的wifi实在是太慢了。还有就是启动软件是有时候总没响应,卡死机。 最近重装系统,选择了mint ,在这里记录下安装步骤。###1.制作U盘启动盘###下载iso文件,…

linux 商业游戏,Ubuntu下安装试玩原生Linux版商业游戏Braid

这款原生Linux版商业游戏Braid国外出售价大约在80美元左右。每年在Linux平台上发布的原生商业游戏是屈指可数,而且这些游戏的质量也是参差不齐。不过这款原生Linux版商业游戏Braid还是值得一玩的,这款Braid游戏创意十足,您可以通过拼图和时间…

linux centos 7 crontab 启动,CentOS 7 Linux执行crontab 计划任务实操 - 好应网

[inlosc_lg_title]一、环境准备[/inlosc_lg_title]yum install vixie-cron #安装定时任务插件yum install crontabs #安装定时任务crontabs/bin/systemctl restart crond.service #启动服务/bin/systemctl reload crond.service #重新载入配置/bin/systemctl status crond.serv…

变量的初始化与使用C语言程序注释,c - (为什么)使用未初始化的变量未定义行为?...

C标准为编译器提供了很大的优势来执行优化。 如果您假设一个简单的程序模型,其中未初始化的内存被设置为某个随机位模式,并且所有操作都按照它们的写入顺序执行,那么这些优化的后果可能会令人惊讶。注意:以下示例仅有效&#xff0…

三羊献瑞c语言编程入门,蓝桥杯-三羊献瑞,

蓝桥杯-三羊献瑞,更多精彩文章请关注公众号『大海的BLOG』问题观察下面的加法算式:祥 瑞 生 辉 三 羊 献 瑞----------------三 羊 生 瑞 气其中,相同的汉字代表相同的数字,不同的汉字代表不同的数字,‘三’和‘祥’不…

Struts2.3接收post方式提交的表单参数的方式

一:方式一:通过request来获取,首先让action实现ServletRequestAware接口,然后通过request来获取提交的参数,代码如下: package cn.gov.csrc.flight.action;import java.util.HashMap; import java.util.List; import j…

倒果汁c语言,水果榨汁补维生素C?这些补维生素的错误别再犯了

原标题:水果榨汁补维生素C?这些补维生素的错误别再犯了蔬菜和水果作为维生素C、矿物质和植物纤维的重要来源,是每天餐桌上都要出现的食物,一旦水果蔬菜吃不够,身体就会开始找你麻烦。在处理蔬菜水果的时候,…

dos和linux有关系吗,DOS和Linux近年来的发展比较

大家都听说过Linux操作系统吧!Linux诞生于20世纪的90年代初,于90年代末开始出名并在许多人中开始了实际使用。著名的“开放源代码”运动更是使新的Linux程序不断出现,使Linux得到了进一步的发展,尤其是在服务器领域得到了较大的应…

c语言中二维数组的结构体,怎么才能把结构体里面的二维数组打印出来?

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼萌新一位,学到结构体在做作业,遇到了这个问题。求提示出现这样的报错:[Error] cannot convert char (*)[20] to char* for argument 5 to void HeroShow(int, int, char*, char*, char*, char*)#…

android中资源文件的两种访问方式,Android_Android学习笔记-保存文件(Saving Files),Android设备有两种文件存储区域 - phpStudy...

Android学习笔记-保存文件(Saving Files)Android设备有两种文件存储区域:内部存储和外部存储 ("internal" and "external" storage)。这名字来自早期Android,那时大多数Android设备提供两种存储方式:内置的非易失的内存(内部存储)和可移动的存储…

Struts2.3,s:iterator,c:forEach遍历map中的list集合

一&#xff1a;首先是<s:iterator></s:iterator>遍历map中的list集合&#xff0c;代码如下&#xff1a; 1.首先是后台代码&#xff0c;包括定义map和给map中赋值&#xff0c;代码如下&#xff1a; package cn.gov.csrc.cms.action;import java.util.HashMap; impo…

android 判断对象,Android网络判断知识小结

Android中判断当前网络是否可用应用场景&#xff1a;实现判断当前网络是否可用当前有可用网络&#xff0c;如下图&#xff1a;当前没有可用网络&#xff0c;如下图&#xff1a;实现步骤&#xff1a;1、获取ConnectivityManager对象Context context activity.getApplicationCon…

android fragment动画,Fragment 的过场动画

Fragment 的过场动画Android,Fragment,动画2018.08.03在 Android 开发中&#xff0c;有些应用对页面的过场动画要求比较高&#xff0c;他们中期望给用户提供一个良好的用户体验。适当的过场动画可以减少用户在页面加载时期等待的焦虑&#xff0c;因为让他们看一个动画&#xff…

android 联系人批量插入,GitHub - Atinerlengs/InsertDemo: android 简单的批量插入通话记录、联系人、短信demo...

[toc]批量插入批量插入通话记录下面是添加通话数据的代码&#xff0c;我们自己去构造Tb_calllogs数据&#xff0c;里面可以添加通话记录数据字段&#xff0c;由于是个简单的demo&#xff0c;所以只加了number、callType、date、callDuration。/*** 添加通话数据** throws Remot…

html页面按钮删除一条数据库,需要添加一个删除按钮到一个HTML表格从数据库中删除记录与消息...

IDNameCodeActiveEdit<?php foreach($nurseries->result() as $nursery) { ?><?php echo $nursery->id; ?><?php echo $nursery->name; ?><?php echo $nursery->code; ?><?php echo set_bool($nursery->active); ?><…

EL表达式, JSTL, 获取map集合中key的value

序言&#xff1a;今天在项目中使用了map存储list和普通对象&#xff0c;但是在jsp中显示的时候出来问题&#xff0c;后经查阅&#xff0c;终于解决&#xff0c;现在记录一下&#xff0c;以便以后查阅&#xff1a; 一&#xff1a;后台代码如下&#xff1a; package cn.gov.csrc…

html选择器是什么,CSS3选择器是什么?

首先我们来看一下displaynone的意思是什么&#xff1f;display:none的意思&#xff1a;隐藏元素并脱离文档&#xff0c;流就是隐藏该区域&#xff0c;不占实际空间&#xff0c;但对后台来说真实存在&#xff0c;可以获取被隐藏的元素简单的来说就是将元素设置为none的时候既不会…

零基础学计算机408,又一所重点大学改考408!21计算机考研会全面408吗?

【北京工业大学】于7月17日发布《关于北京工业大学2021年全国硕士研究生招生考试部分考试科目及考试大纲调整的通知》&#xff0c;要点如下&#xff1a;文法学部0401教育学专业课改考 311统教育学信息学部计算机学院0812计算机科学与技术0839网络空间安全0854电子信息 (专业学位…