《Linux内核修炼之道》精华分享与讨论(13)——驱动开发三件宝:spec、datasheet与内核源码

推荐博文: Linux内核“问题门”——学习问题、经验集锦

推荐下载:《Linux内核修炼之道》精华版之方法论

 

设备模型之外,对于驱动程序的开发者来说,有三样东西是不可缺少的:第一是协议或标准的spec,也就是规范,比如usb协议规范;第二是硬件的datasheet,即你的驱动要支持的硬件的手册;第三就是内核里类似驱动的源代码,比如你要写触摸屏驱动的话,就可以参考内核里已经有的一些触摸屏驱动。

spec、datasheet、内核源代码这三样东西对于每个开发设备驱动的人来说都是再寻常不过了,但正是因为它们的普通,所以在很多人眼里都被归为被忽视的群体。于是大家开发驱动的过程中,遇到问题的时候首先想到的可能还是“问问牛人怎么解决吧”、“旁边要是有个牛人该多好”,因为牛人的稀有,所以知道牛人的价值,而又因为spec、datasheet和内核源代码的唾手可得,所以常常体会不到它们在解决问题时的重要性。

当然我并不是贬低牛人的价值,宣扬依赖牛人不好,如果你很幸运身边真就有牛人这种稀缺资源的话,自然是要好好利用,也可以少走很多弯路,节省很多摸索的时间。只是人生不如意十之八九,多数人还是没有这份幸运的,所以与其遍寻牛人讨教,不如多依赖依赖自己,多利用利用自己身边有的资源去寻找解决问题的途径。

对这三样看似普通的东西,关键在于很好的去利用,而不是拥有。就说USB吧,USB驱动和USB设备如何进行交流,交流的方式,交流过程中出现了什么问题是什么引起的等等都在USB spec里有描述,而你的USB设备支持多少种配置包含多少端点只有设备的datasheet才知道。协议的spec和设备的datasheet是最好的参考资料,驱动开发调试中出现的问题绝大部分都能在它们的某个角落里找到答案。而内核中类似设备的驱动源代码是最好的模版,对很多硬件设备,你都可以在内核找到同种设备的驱动代码进行参考实现,甚至于可以拷贝或共享大部分的代码,只进行局部的修改,比如说位于drivers/input/touchscreen目录下的各个触摸屏驱动,它们之间的代码很多都是类似的甚至是相同的。

 

 

如果你不仅仅只是打算写驱动,而是还想阅读内核中实现某种总线、设备的源代码,钻研它们的实现机制,那协议的spec就犹为重要,它们在代码里的体现无处不在,你需要在阅读代码前就对协议规范有个整体的理解。形象点说,spec是理论基础,内核代码是具体实现,理论懂了,看代码就和看故事会差不多了。

 

The indispensable guide to data-powered marketing from the team behind the data management platform that helps fuel Salesforce―the #1 customer relationship management (CRM) company in the world A tectonic shift in the practice of marketing is underway. Digital technology, social media, and e-commerce have radically changed the way consumers access information, order products, and shop for services. Using the latest technologies―cloud, mobile, social, internet of things (IoT), and artificial intelligence (AI)―we have more data about consumers and their needs, wants, and affinities than ever before. Data Driven will show you how to: Target and delight your customers with unprecedented accuracy and success Bring customers closer to your brand and inspire them to engage, purchase, and remain loyal Capture, organize, and analyze data from every source and activate it across every channel Create a data-powered marketing strategy that can be customized for any audience Serve individual consumers with highly personalized interactions Deliver better customer service for the best customer experience Improve your products and optimize your operating systems Use AI and IoT to predict the future direction of markets You’ll discover the three principles for building a successful data strategy and the five sources of data-driven power. You’ll see how top companies put these data-driven strategies into action: how Pandora used second- and third-hand data to learn more about its listeners; how Georgia-Pacific moved from scarcity to abundance in the data sphere; and how Dunkin’ Brands leveraged CRM data as a force multiplier for customer engagement. And if you’re wondering what the future holds, you’ll receive seven forecasts to better prepare you for what may come next. Sure to be a classic, Data Driven is a practical road map to the modern marketing landscape and a toolkit for success in the face of changes already underway and still to come. Table of Contents CHAPTER 1 THE EMERGENCE OF PEOPLE DATA CHAPTER 2 THREE CORE PRINCIPLES FOR BUILDING A WINNING DATA STRATEGY CHAPTER 3 DATA IN, DATA OUT CHAPTER 4 THE FIVE SOURCES OF DATA-DRIVEN POWER CHAPTER 5 MAKING IT REAL FOR YOUR ORGANIZATION CHAPTER 6 THE NEW BASIS OF COMPETITION: KNOW, PERSONALIZE, AND ENGAGE CHAPTER 7 SEVEN FORECASTS TO LIGHT UP YOUR FUTURE SENSORS
评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值