摘要:
系统调用是操作系统内核和应用程序之间的接口,设备驱动程序是操作系统内核和机器硬件之间的接口.设备驱动程序为应用程序屏蔽了硬件的细节,这样在 应用程序看来,硬件设备只是一个设备文件, 应用程序可以象操作普通文件一样对硬件设备进行操作.比如read(),就像读文件一样操作设备。设备驱动程序是内核的一部分,它完成以下的功能: 1.对设备初始化和释放. 2.把数据从内核传送到硬件和从硬件读取数据. 3.读取应用程序传送给设备文件的数据和回送应用程序请求的数据. 数据在用户空间 系统空间 硬件之间流动。 4.检测和处理设备出现的错误.linux操作系统设备分3种:字符设备 块设备 网络设备。其中... 阅读全文
阅读排行榜
linux设备驱动初学(二)
2012-05-04 10:43 by 至上, 363 阅读, 收藏,
摘要:
#include <linux/init.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/types.h>#include <linux/fs.h>#include <linux/mm.h>#include <linux/errno.h>#include <asm/segment.h>#include <linux/module.h>#include <linux/sched.h>#inc 阅读全文
malloc() free()函数分析
2012-04-22 22:11 by 至上, 333 阅读, 收藏,
摘要:
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 #include <stdio.h>#include "xlmalloc.h"main() { char *p, *q,*t; p = (char *)SysLmalloc(2); memset(p,1,2); q = (char *)SysLmalloc(16); memset(q,2,16); t = (char *)SysLmalloc(2... 阅读全文
浙公网安备 33010602011771号