2020年4月20日

Debugging Techniques [LDD3 04]

摘要: kernel相较于user,debug起来更加困难,原因有很多,比如kernel中代码的执行是并发的,靠event来驱动;而且kernel一旦出现了bug,很容易把整个系统搞挂,导致后面的现场无法trace,本章... 阅读全文

posted @ 2020-04-20 22:42 gapofsky 阅读(129) 评论(0) 推荐(0)

2020年4月15日

Memory Mapping and DMA [LDD3 15]

摘要: Table of Contents15.1. Memory Management in Linux15.1.1. Address Types15.1.2. Physical Addresses and Pages... 阅读全文

posted @ 2020-04-15 13:08 gapofsky 阅读(676) 评论(0) 推荐(0)

2020年4月13日

Linux kernel slub debug

摘要: 在device driver开发的过程中,有时候会碰到memory相关的问题,比如memory leak,use after free,out of boundary,double free等等。因为device... 阅读全文

posted @ 2020-04-13 14:27 gapofsky 阅读(678) 评论(0) 推荐(0)

2020年4月12日

The Linux Device Model [LDD3 14]

摘要: kernel中为了更好的支持更多更复杂的device拓扑结构,引入了设备模型的概念。kernel中的设备模型分为如下几种:Power management and system shutdown要求对系统结构有较... 阅读全文

posted @ 2020-04-12 18:57 gapofsky 阅读(235) 评论(0) 推荐(0)

2020年4月11日

PCI Drivers [LDD3 12]

摘要: 因为很多device都是PCI device,所以本章重点看一下PCI(Peripheral Component Interconnect),首先明确一点,PCI是总线类型,总线有两种接口类型组成,electri... 阅读全文

posted @ 2020-04-11 11:49 gapofsky 阅读(590) 评论(0) 推荐(0)

Data Types in the Kernel [LDD3 11]

摘要: 为什么要单独讲kernel的数据结构?kernel是一个支持很多平台很多架构的OS,不同的架构上,很多的数据结构都是不同的,如何保证kernel能兼容多个架构,这就得益于kernel良好的数据结构设计。kerne... 阅读全文

posted @ 2020-04-11 11:03 gapofsky 阅读(102) 评论(0) 推荐(0)

2020年4月8日

Interrupt Handling [LDD3 10]

摘要: 尽管device的IO region可以用来控制device,但是还不够。一个device,往往会有外界有交互,当外界发生了某个事件,需要device做出某种响应,driver也需要做处理。CPU不可能一直等de... 阅读全文

posted @ 2020-04-08 22:59 gapofsky 阅读(236) 评论(0) 推荐(0)

Communicating with Hardware [LDD3 09]

摘要: Table of Contents9.1. I/O Ports and I/O Memory9.1.1. I/O Registers and Conventional Memory9.2. Using I/O P... 阅读全文

posted @ 2020-04-08 13:20 gapofsky 阅读(146) 评论(0) 推荐(0)

2020年4月6日

Allocating Memory [LDD3 08]

摘要: Table of Contents8.1. The Real Story of kmalloc8.1.1. The Flags Argument8.1.1.1 Memory zones8.1.2. The Siz... 阅读全文

posted @ 2020-04-06 22:51 gapofsky 阅读(233) 评论(0) 推荐(0)

2020年4月5日

Time Delays and Deferred Work [LDD3 07]

摘要: Table of Contents7.1. Measuring Time Lapses7.1.1. Using the jiffies Counter7.1.2. Processor-Specific Regi... 阅读全文

posted @ 2020-04-05 17:02 gapofsky 阅读(134) 评论(0) 推荐(0)

导航