- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
LinuxDeviceDriver幻灯片
Linux Device Driver Writing a real world device driver for embedded Linux. Outline Concept Kernel Module Char Device Driver Interrupt Handling I/O Management Allocating Memory Block Device Driver Network Device Driver Concept The role of device driver To allow interaction with hardware devices. Providing mechanism, not policy. What capabilities are to be provided? ? Mechanism How those capabilities can be used? ? Policy Writing a Linux device driver Pre-requisites C programming Microprocessor programming Important concepts User space vs. kernel space Concept (Cont.) Execution paths: From user to kernel Concept (Cont.) Classes of devices Characters devices Can be accessed as a stream of bytes. Such a driver usually implements at least the open, close, read, and write system calls. Example: RTC driver. Block devices A device (e.g., a disk) that can host a filesystem. Example: Ramdisk driver. Network interfaces In charge of sending and receiving data packets, driven by the network subsystem of the kernel. Example: Network card driver. Concept (Cont.) A device driver is a kernel module. A kernel module is a device driver? Not necessarily so. Example: ext3 file system module Outline Concept Kernel Module Character Device Driver Interrupt Handling I/O Management Allocating Memory Block Device Driver Network Device Driver Kernel Module The first kernel module “Hello, world” Kernel Module (Cont.) How to compile # gcc -c hello.c -D__KERNEL__ -DMODULE -o hello.o How to insert into kernel # insmod ./hello.o How to remove from kernel # rmmod hello Kernel Module (Cont.) Kernel module vs Application Application Run in user space. Perform a task from beginning to end. Linked to the appropriate library such as libc. Kernel Module Run in kernel space. Register itself in order to serve future requests. Linked only to the kernel, and the only functions it can call are the ones exported by the kernel. Kernel Module (Cont.) Kernel Module (Cont.) Just about all module code h
您可能关注的文档
最近下载
- 2025青岛版小学科学三年级上册1-5《制作动物分类图册》(教学课件)(新教材).pptx
- 标准图集-17J008 挡土墙(重力式、衡重式、悬臂式) 无水印.pdf VIP
- JJF(陕) 048-2021 一体化振动变送器校准规范.docx VIP
- 退药申请单.doc VIP
- 2025年中国镁铝尖晶石行业投资前景及策略咨询研究报告.docx
- 农牧民培训国家通用语言.pptx
- 2022年度国铁集团质量安全红线检查迎检实施方案(最终版) (2).pdf VIP
- 六年级数学上册第一单元圆基础测试题北师大.doc VIP
- (高清版)B/T 42584-2023 信息化项目综合绩效评估规范.pdf VIP
- 《建筑给水复合管道工程技术规程》CJJ@T155-2011.pdf VIP
文档评论(0)