1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE slides SYSTEM "/usr/share/xml/docbook/custom/slides/3.3.1/schema/dtd/slides-full.dtd">
7 <title>Linux Device Drivers</title>
8 <author><firstname>Thadeu</firstname><surname>Cascardo</surname></author>
12 <title>Introduction</title>
15 Linux - A POSIX modern operating system released under the GPLv2
18 Device - A piece of hardware plugged into a system
21 Drivers - Software modules that are plugged into a system
29 Linux is a POSIX-compatible modern operating system developed since 1991,
30 released under the GPLv2, with contributions by thousands of people. It is
31 mostly written in C, with some assembly code.
34 It has grown from a non-portable Intel 386 code with thousands lines to a
35 portable code with support for dozens of architectures and hundreds machines and
41 <title>Linux evolution</title>
43 Since version 1.2, it has supported more than only Intel x86 architectures,
44 including now SPARC, PowerPC, ARM, Alpha, M68K, MIPS, S/390, and many others.
47 Since version 2.0, it has supported SMP systems, now running in systems with
48 hundreds of processors, multi-core processors, etc. Since then, its SMP support
49 has put to scale, with most bottlenecks removed.
55 <intro>Linux evolution</title>
57 TODO: introduce a graphic with the number of lines of code.
63 <title>Linux evolution</title>
65 Linux source code and interfaces have changed a lot in all these years. Some
66 programs require the sysfs interface, for example. Some drivers may require new
67 interfaces and not build on old linux versions. They may also use obsolete or
68 replaced unexisting interfaces and not build on new linux versions.
71 Better practice is to release the driver under GPLv2 or other compatible
72 license and send it to mainline. And maintain it even after it's there.
77 <title>Linux versioning</title>
84 <title>Outdated book</title>
86 Since Linux is in constant change, the book is already outdated. It's almost
90 One example of outdated interface is the workqueue, whose updated functions we
96 <title>Modules</title>
98 Linux is modular. Its modules may be inserted and removed at will, making it
99 very flexible. Modules may be device drivers and may work as many other
100 funciotns as well, like filesystems, network protocols, power management
106 <title>Linux Code Structure</title>
108 Show Linux Code Layout.
113 <title>Mechanism and Policy</title>
115 Drivers should provide mechanism. As in many other cases, splitting mechanism
116 and policy is desirable. In the case of kernel code, this is no exception.
117 Kernel space code and user space code are good split points to provide that
123 <title>Recommendations</title>
126 Check every possible error.
129 Do not trust received data nor do send unzeroed data.
132 Use a machine you can spare.
138 <title>Operating Systems</title>
141 <emphasis>Process</emphasis>Management
144 <emphasis>Memory</emphasis>Management
147 Input/Output/Hardware Management