摘要: I/O Ports and I/O Memory 所有的外设都通过读写其寄存器来控制,一个外设在内存地址空间或者I/O地址空间有多个寄存器。 访问I/O寄存器的操作可能会有副作用——有些寄存器在访问后会清零,因此这些寄存器的值不能缓存在高速缓存中。内核提供了相关接口: 1 #include <lin 阅读全文
posted @ 2018-11-16 15:19 glob 阅读(214) 评论(0) 推荐(0) 编辑
摘要: kmalloc kmalloc速度很快,分配的内存物理连续,但是分配的内存并未清零。kmalloc定义如下: 1 #include <linux/slab.h> 2 void *kmalloc(size_t size, int flags); flags参数会在多个方面影响kmalloc的行为,定义 阅读全文
posted @ 2018-11-15 11:29 glob 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Measuring Time Lapses 系统用来计时的变量是jiffies_64,在系统启动时会初始化为0,相关的函数都定义在linux/jiffies.h中;相关的宏定义还有HZ。下列代码是jiffies和HZ的使用方法: 1 #include <linux/jiffies.h> 2 unsi 阅读全文
posted @ 2018-11-14 09:37 glob 阅读(164) 评论(0) 推荐(0) 编辑
摘要: ioctl ioctl是驱动程序向用户提供的控制设备的接口。用户空间的ioctl系统调用的形式如下: int ioctl(int fd, unsigned long cmd, ...); 驱动程序的ioctl形式有所不同: int ioctl(int fd, unsigned long cmd, . 阅读全文
posted @ 2018-11-09 17:54 glob 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Device registeration The kernel uses structures of type struct cdev to represent char devices internally. Include <linux/cdev.h> so that you can use t 阅读全文
posted @ 2018-11-07 10:55 glob 阅读(159) 评论(0) 推荐(0) 编辑
摘要: /proc /proc filesystem is a special, software-created filesystem that is used by the kernel to export information to the world. If you want to work wi 阅读全文
posted @ 2018-11-07 10:46 glob 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Spinlock Spinlock usually used in code that cannot sleep, thus has higher performance than semaphores. Spinlock is implemented as a bit in an integer 阅读全文
posted @ 2018-11-07 10:18 glob 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 简介 tty源自teletypewriter——最初用于连接Unix的物理或虚拟终端;由于终端可以建立在串口上,后来tty也指任何串口设备。 物理tty设备包括串口,USB-串口转换器,还有一些调制解调器;虚拟tty设备通过网络连接或者xterm会话登陆计算机的虚拟控制台。 下图是tty的系统结构图 阅读全文
posted @ 2018-11-06 17:09 glob 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 绪言 最近搜狗输入法总是弹出一些莫名其妙的东西,让人防不胜防,换一个输入法的想法涌上心头。先到知乎看了一下输入法的相关问题,发现大家对搜狗的输入法怨念很深,很多人都推荐rime。我又到腾讯软件中心查看了输入法的相关软件,得到以下备选项:google拼音、rime、QQ拼音、bing、讯飞。 goog 阅读全文
posted @ 2018-11-06 09:12 glob 阅读(1271) 评论(0) 推荐(0) 编辑
摘要: 简介 PCI(Peripheral Component Interconnect)用来指明计算机的各个部分如何进行交互,用来取代ISA(Industry Standard Architecture),实现更高效的、平台独立的、使外围设备更加易于移动的总线标准。 每个PCI设备通过bus number 阅读全文
posted @ 2018-11-02 10:47 glob 阅读(280) 评论(0) 推荐(0) 编辑