4171a93cd7768cbf5436ef8b25efb3d5e8546c0b
[cascardo/kernel/old_slides/.git] / 00.intro / 00.intro.xml
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">
3
4 <slides>
5
6 <slidesinfo>
7 <title>Linux Device Drivers</title>
8 <author><firstname>Thadeu</firstname><surname>Cascardo</surname></author>
9 </slidesinfo>
10
11 <foil>
12 <title>Introduction</title>
13 <itemizedlist>
14 <listitem>
15 Linux - A POSIX modern operating system released under the GPLv2
16 </listitem>
17 <listitem>
18 Device - A piece of hardware plugged into a system
19 </listitem>
20 <listitem>
21 Drivers - Software modules that are plugged into a system
22 </listitem>
23 </itemizedlist>
24 </foil>
25
26 <foil>
27 <title>Linux</title>
28 <para>
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.
32 </para>
33 <para>
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
36 millions of code.
37 </para>
38 </foil>
39
40 <foil>
41 <title>Linux evolution</title>
42 <para>
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.
45 </para>
46 <para>
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.
50 </para>
51 </foil>
52
53 <!--
54 <foil>
55 <intro>Linux evolution</title>
56 <para>
57 TODO: introduce a graphic with the number of lines of code.
58 </para>
59 </foil>
60 -->
61
62 <foil>
63 <title>Linux evolution</title>
64 <para>
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.
69 </para>
70 <para>
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.
73 </para>
74 </foil>
75
76 <!--
77 <foil>
78 TODO: talk about linux versions, we have a very good odt for that
79 </foil>
80 -->
81
82 <foil>
83 <title>Outdated book</title>
84 <para>
85 Since Linux is in constant change, the book is already outdated. It's almost
86 five years old.
87 </para>
88 <para>
89 One example of outdated interface is the workqueue, whose updated functions we
90 will see later.
91 </para>
92 </foil>
93
94 <foil>
95 <title>Modules</title>
96 <para>
97 Linux is modular. Its modules may be inserted and removed at will, making it
98 very flexible. Modules may be device drivers and may work as many other
99 funciotns as well, like filesystems, network protocols, power management
100 policies, etc.
101 </para>
102 </foil>
103
104 <foil>
105 <title>Mechanism and Policy</title>
106 <para>
107 Drivers should provide mechanism. As in many other cases, splitting mechanism
108 and policy is desirable. In the case of kernel code, this is no exception.
109 Kernel space code and user space code are good split points to provide that
110 separation.
111 </para>
112 </foil>
113
114 <foil>
115 <title>Recommendations</title>
116 <itemizedlist>
117 <listitem>
118 Check every possible error.
119 </listitem>
120 <listitem>
121 Do not trust received data nor do send unzeroed data.
122 </listitem>
123 <listitem>
124 Use a machine you can spare.
125 </listitem>
126 </itemizedlist>
127 </foil>
128
129 </slides>