-
Notifications
You must be signed in to change notification settings - Fork 114
/
introduction.html
113 lines (113 loc) · 7.19 KB
/
introduction.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lesson 0 Introduction</title>
<link href="stylesheet.css" rel="Stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="contentAll">
<div id="courseHead">
<h1>
Lesson 0 Introduction</h1>
</div>
<div id="pageAll">
<div id="pageBody">
<p>
This introductory lesson does not contain a practical element, but exists to explain
the basic concepts of what is an operating system, what is assembly code and other
important basics. If you just want to get straight into practicals, it should be
safe to skip this lesson.
</p>
<div class="ucampas-toc">
</div>
<h2 id="os">
1 Operating Systems</h2>
<div class="informationBox"><p>
Throughout these tutorials I will put interesting information in boxes like this
one.</div>
<div class="commandBox"><p>
Throughout these tutorials I will put information about each command we learn in
boxes like this one.</div>
<p>
An operating system is just a very complicated program. It has the job of organising
other programs on a computer, including sharing the computer's time, memory, hardware
and other resources. Some big families of desktop operating systems that you may
have heard of include GNU/Linux, Mac OS X and Microsoft Windows. Other devices also
need operating systems such as phones, which may use operating systems such as Android,
iOS and Windows Phone.<a class="noteLink" name="note1a" href="#note1" title="Note 1"><sup>[1]</sup></a></p>
<p>
Since the operating system has to interact with the hardware on a computer system,
it also has to have specific knowledge of the hardware on a system. To allow operating
systems to be used on a variety of computers, the concept of <strong>drivers</strong>
was invented. Drivers are small bits of code that can be added and removed from
the operating system in order to allow the operating system to talk to a particular
piece of hardware. In this course, we do not cover how to create such removable
drivers, and instead focus on making specific ones for the Raspberry Pi.</p>
<p>
There are all kinds of different designs of operating systems, and this course can
only just scratch the surface. In this course we will mainly focus on getting the
operating system to interact with a variety of bits of hardware, as this is often
the trickiest bit, and the part for which the least documentation and help exists
online.</p>
<h2 id="ac">
2 Assembly Code</h2>
<div class="informationBox"><p>
A processor can often perform millions of instructions per second, but they must
be simple.</div>
<p>
This course will be written almost exclusively in assembly code. Assembly code is
code that is <em>very</em> close to what the computer understands. How a computer
really works is that there is a small device called a processor which is capable
of performing simple jobs like adding numbers, and there is a set of one or more
microchips called the <strong title="Random Access Memory">RAM</strong> which are
capable of storing numbers. When a computer has power, the processor works through
a sequence of instructions given to it by the programmer, which cause it to change
numbers in the RAM, and interact with connected hardware. Assembly code is a translation
into human readable text of those commands.</p>
<p>
When programming normally, the programmer writes code in a programming language
such as C++, Java, C#, Basic, etc, and then a program called the compiler translates
what the programmer wrote into assembly code, which is the further reduced into
binary code<a class="noteLink" name="note2a" href="#note2" title="Note 2"><sup>[2]</sup></a>.
Binary code is what the computer actually understands, but it is almost impossible
for humans to read. Assembly code is much better, but it can be frustrating how
few commands are possible. Remember that every command you write in assembly code
is something that the processor understands directly, and so the commands are simple
by design, as a physical circuit must process each one.</p>
<img alt="Compiler process" src="images/compiling.png" />
<p>
Just like with ordinary programming, there are many different assembly code languages,
however unlike ordinary programming, the reason these exist is due to the fact that
there exists many different processors, each designed to understand a different
language. Thus a program written in assembly code for one machine, will not work
on a different one. For most things, this would be a disaster as each program would
have to be rewritten for every system it was used on, but for operating systems
this isn't so much of a problem, as it would have to be rewritten anyway due to
differing hardware. Nevertheless, most operating systems are written in C++ or C,
so that they can be converted more easily, and only the sections that absolutely
have to be written in assembly are.
</p>
<p>
You're now ready to move on to the first lesson, <a href="ok01.html">Lesson 1: OK01</a></p>
</div>
<div id="pageFooter">
<hr />
<ol>
<li><a name="note1" /><sup>[1]<a class="noteBackLink" href="#note1a">^</a></sup> For
a more complete list of Operating Systems see <a href="http://en.wikipedia.org/wiki/List_of_operating_systems"
title="http://en.wikipedia.org/wiki/List_of_operating_systems">List of operating
systems - Wikipedia, the free encyclopaedia</a></li>
<li><a name="note2" /><sup>[2]<a class="noteBackLink" href="#note2a">^</a></sup> I am,
of course, simplifying this explanation of ordinary programming, in truth it depends
heavily on the language and the machine. For the interested, see <a href="http://en.wikipedia.org/wiki/Compiler"
title="http://en.wikipedia.org/wiki/Compiler">Compiler - Wikipedia, the free encyclopedia</a></li>
</ol>
<p>Spot a mistake? You can help improve this tutorial on <a href="https://github.com/chadderz121/bakingpi-www">GitHub</a>.</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_GB"><img alt="Creative Commons Licence" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Baking Pi: Operating Systems Development</span> by <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Alex Chadwick</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_GB">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
<p>Based on contributions at <a href="https://github.com/chadderz121/bakingpi-www">https://github.com/chadderz121/bakingpi-www</a>.</p>
</div>
</div>
</div>
</body>
</html>