~codeforger/michaelos/trunk

« back to all changes in this revision

Viewing changes to FReport/report.tex

  • Committer: Michael Rochester
  • Date: 2015-05-08 16:04:59 UTC
  • Revision ID: m.rochester93@googlemail.com-20150508160459-hljjr7b530c8nopi
project work

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
\usepackage{pdfpages}
8
8
\usepackage{wrapfig}
9
9
\usepackage{pgfplots}
 
10
\usepackage{afterpage}
 
11
 
 
12
 
 
13
\newcommand\blankpage{%
 
14
    \null
 
15
    \thispagestyle{empty}%
 
16
    \addtocounter{page}{-1}%
 
17
    \newpage}
 
18
 
10
19
 
11
20
\usepackage{geometry}
12
21
 
21
30
\title{MOS : A Multitasking Operating System}
22
31
\date{\today}
23
32
\author{Michael Rochester\\ Candidate: 23344\\ University of Sussex
24
 
        \and Supervisor:\\ Martin Berger}
 
33
        \and Supervisor:\\ Dr. Martin Berger}
25
34
 
26
35
 
27
36
\setcounter{tocdepth}{4}
34
43
 
35
44
\maketitle
36
45
 
 
46
 
 
47
 
 
48
 
 
49
 
 
50
\blankpage
 
51
 
 
52
\clearpage
 
53
\section*{Statement of Originality}
 
54
This report is submitted as part requirement for the degree of ... at the University of Sussex. It is the product of my own labour except where indicated in the text. The report may be freely copied and distributed provided the source is acknowledged
 
55
 
 
56
\clearpage
 
57
 
 
58
 
 
59
\blankpage
 
60
 
 
61
\clearpage
 
62
\section*{Acknowledgments}
 
63
 
 
64
I would like to thank Dr. Martin Berger for his encouragement in choosing as dissertation topic that has been both challenging and exciting and for his support and advice throughout the project. I would furthermore like to express my gratitude to `maxdev' and the entire operating system development community for their help during the initial phases of the project.
 
65
 
 
66
I would also like to thank Dr. John Rochester for providing me with the physical resources required to test and demonstrate the project's Operating System.
 
67
 
 
68
\clearpage
 
69
 
 
70
 
 
71
\blankpage
 
72
 
 
73
\clearpage
 
74
\section*{Summary}
 
75
 
 
76
 
 
77
We live in a world surrounded and controlled by machines, and software is our way of telling those machines how to act. As our machines and needs become more complex, so must the software that runs them. An Operating System is a software package that allows for others to easily create complex behaviors by providing simple high level abstractions over the intricate low level hardware. This project involves creating an Operating System with the aim of exploring low level hardware and software relation ships and creating a platform upon which others can develop arbitrarily complex software.
 
78
 
 
79
This dissertation describes the processes of creating such this Operating System (herein called MOS) in the C programming language along with a set of supporting programs, including an analysis of similar systems and a look into the implementation of MOS.
 
80
 
 
81
The main sections of this dissertation include:
 
82
\begin{itemize}
 
83
\item An introduction to Operating Systems.
 
84
\item Professional and ethical considerations for the project.
 
85
\item Requirements analysis for the Operating System including a look at other modern operating systems
 
86
\item The implementation of the system.
 
87
\item The testing techniques used to ensure the system produces is of high quality
 
88
\item A conclusion to the project.
 
89
\end{itemize}
 
90
 
 
91
 
 
92
 
 
93
 
37
94
\tableofcontents
38
95
\listoffigures
39
96
 
 
97
\clearpage
 
98
 
 
99
\section{Glossary}
 
100
 
 
101
Operating Systems come with a large variety of terms and phrases that are unique to their nature, This section serves as a description of the terms that may be required to understand the remainder of this document:
 
102
 
 
103
\begin{minipage}{.5\textwidth}
 
104
  \centering
 
105
  Technical terms:
 
106
  \begin{itemize}
 
107
  \item CPU : Central Processing Unit, This is the part of the physical computer that performs all the operations that processes contain.
 
108
  \item BIOS : The BIOS is the part of the physical computer that is started when the computer is turned on, it has limit functionality and its job is to get the CPU started.
 
109
  \item IO : Input/Output, IO refers to a processes ability to interact with external services such as receiving keyboard keys(input) or displaying information to a screen(output)
 
110
  \item RAM : Random Access Memory, This is the part of the physical computer that stores temporary information such as the state of running processes.
 
111
  \item HDD/Hard Drive : This is the part of the physical computer that can store information that remains persistent even if the computer is turned off.
 
112
  \item MOS : Michael's Operating System, the name of the Operating System produced as part of this project.
 
113
  \end{itemize}
 
114
\end{minipage}%
 
115
\begin{minipage}{.5\textwidth}
 
116
  \centering
 
117
  Descriptive terms:
 
118
  \begin{itemize}
 
119
  \item Kernel : The kernel is the main part of the Operating System that allows access to hardware and provides services to the user space.
 
120
  \item Kernel space : This is the part of the running system that is only accessible by the kernel, here the kernel keeps track of system state and other useful informations.
 
121
  \item User space : This is the part of the running system in which programs and processes are executed. Here these programs can keep track of their state. In this area, there is less direct access to the hardware of the computer.
 
122
  \item System Call : System calls are the way that user space applications gain access to the kernel, they each provide access to a different kernel service or to a piece of hardware.
 
123
  \item Process : A processes is one set of instructions and a current state. A processes is `run' by the CPU.
 
124
  \item Program / Application : A program is a tool that users can use to perform tasks in the system. Typically a program will consist of one process that is to be run by the system. Programs are ofter interactive or take `parameters' to customize the task they perform. Programs can also consist of many processes if they with to do more than one thing at once.
 
125
  \item Interrupts : These are events in the kernel space that take place when either a piece of hardware want attention (a key is pressed on the keyboard or a hard drive finishes writing some data). Or when a piece of software misbehaves (dividing by zero or attempting to access kernel space.)
 
126
  \end{itemize}
 
127
\end{minipage}
 
128
 
 
129
 
 
130
\clearpage
 
131
 
 
132
 
40
133
\chapter{Introduction}
41
134
 
42
 
The overall aim for this project is to produce a simple Multitasking Operating System (herein called MOS) to study structure, allocation, and management of different classes of hardware resource. This section provides a brief introduction to Operating Systems, Discusses the project aims, and looks at the approach taken.
43
 
 
44
 
We live in a world surrounded and controlled by machines, and software is our way of telling those machines how to act. As our machines and needs become more complex, so must the software that runs them. An Operating System is a software package that allows for others to easily create complex behaviors by providing simple high level abstractions over the intricate low level hardware.
45
 
 
46
 
 
47
 
 
 
135
The overall aim for this project is to produce a simple Multitasking Operating System to study structure, allocation, and management of different classes of hardware resource. This section provides a brief introduction to Operating Systems, Discusses the project aims, and looks at the approach taken.
48
136
 
49
137
 
50
138
 
67
155
 
68
156
Operating Systems come in all different shapes and sizes, each with its own look, feel, and utility.
69
157
 
70
 
For an every day user, the Operating System turns complex tasks into seemingly trivial ones. Even running a program is a complex task for a computer to achieve, however to most users `launch your favourite browser' might seem like the simplest task to accomplish. Operating Systems make these tasks easy by providing graphical menus and windows to `disguise' the complexity beneath. It may also provide a number of built in programs like file browsers and settings managers to make common tasks even more straight forward.
71
 
 
72
 
An Operating system may also offer tailoring of a system to a specific user, like having certain programs start when the computer is turned on, or drawing the screen with a custom image as a background. To this extend, the Operating System can be seen as `anything that isn't a program' to the user.
73
 
 
74
 
Below is a screen shot of the popular Windows operating system, It shows a number of programs; a web browser `firefox', a test editor `notepad++', a file browser `explorer'. The programs each own and control their `window' however all other parts of the screen are controlled by the Operating System. On the right, the portions of the screen controlled by the programs is blacked out, showing only the parts of the screen controlled by the operating system.
 
158
For an every day user, the Operating System turns complex tasks into seemingly trivial ones. Even running a program is a complex task for a computer to achieve, however to most users `launch your favorite browser' might seem like the simplest task to accomplish. Operating Systems make these tasks easy by providing graphical menus and windows to `disguise' the complexity beneath. It may also provide a number of built in programs like file browsers and settings managers to make common tasks even more straight forward.
 
159
 
 
160
An Operating system may also offer tailoring of a system to a specific user, like having certain programs start when the computer is turned on, or drawing the screen with a custom image as a background. To this extent, the Operating System can be seen as `anything that isn't a program' to the user.
 
161
 
 
162
As in the title, this project is concerned with multitasking operating systems. A multitasking system is one that can perform more than one task at once. Most major consumer Operating systems are multitasking (from PC operating systems like Microsoft's Window to mobile operating systems such as Google's Android). However not all are, many systems require only one task to be performed at one time, for example ATM's or self checkouts at supermarkets.
 
163
 
 
164
Below is a screen shot of the popular Windows operating system, It shows a number of programs; a web browser `firefox', a test editor `notepad++', a file browser `explorer'. The programs each own and control their `window' however all other parts of the screen are controlled by the Operating System. On the right, the portions of the screen controlled by the programs are blacked out, showing only the parts of the screen controlled by the operating system.
75
165
 
76
166
 
77
167
\begin{figure}[ht]
89
179
  \caption{A screen shot of the Windows operating system.}
90
180
\end{figure}
91
181
 
92
 
The operating system is doing more than just running 3 programs though. Each program can have any number of `processes'. A process is a piece of a program that can perform one action at a time. If a program wants to do two things at a time, it must have two processes. Furthermore there may be more processes running that don't belong to a graphical program and are needed to keep the system running often referred to a system processes. The Operating System must make sure each of these processes gets a fair share of the computer, to make sure each program can run correctly.
93
 
 
94
 
Processes, whether they are program processes or system processes, need to access a number of resources to work. The most apparent are the screen, the keyboard, and the mouse. Operating systems gives the processes simple access to these resources to allow programs to show things to the user, and allows the user to interact with them. However, in the back ground, there are many other types or resources that the Operating System controls. Hard Drives are permanent storage services, they allow programs and users to create information that lasts even after a reboot. RAM is a temporary storage that allows programs to keep track of there current state (for example, storing the text and images for your current word document). Network devices such as ethernet cards and wifi cards allow programs to communicate with other programs on other computers and connect to the internet.
95
 
 
96
 
These resources are not infinite. Hard Drives, RAM, and screen space, are restricted by size. Whereas network cards, and printers, are restricted by throughput (actions per minute). An Operating System tries to allow access to all these resources by all processes simultaneously. By denying a process access to a specific resource, the program may not be able to perform its task correctly. However, to a program, fair may not mean equal. A web browser my heavily use network card, but never write to the Hard Disk, Alternatively, A Photo Editor may never require network access, but may write very large amounts to the Hard Disk.
97
 
 
 
182
The operating system is doing more than just running 3 programs though. Each program can have any number of `processes'. A process is a piece of a program that can perform one action at a time. If a program wants to do two things at once, it must have two processes. Furthermore there may be more processes running that don't belong to a graphical program and are needed to keep the system running often referred to a system processes. Here the importance of a multitasking system is even more apparent, Windows may be running up to 60 system processes simultaneously just to keep the system ready to respond to the users requests. The Operating System must make sure each of these processes gets a fair share of the computer, to make sure each program can run correctly.
 
183
 
 
184
Processes, whether they are program processes or system processes, need to access a number of resources to work. The most apparent are the screen, the keyboard, and the mouse. Operating systems gives the processes simple access to these resources to allow programs to show things to the user, and allows the user to interact with them. However, in the background, there are many other types or resources that the Operating System controls. Hard Drives are permanent storage services, they allow programs and users to create information that lasts even after a reboot. RAM is a temporary storage that allows programs to keep track of there current state (for example, storing the text and images for your current word document). Network devices such as Ethernet cards and wifi cards allow programs to communicate with other programs on other computers and connect to the Internet.
 
185
 
 
186
These resources are not infinite. Hard Drives, RAM, and screen space, are restricted by size. Whereas network cards, and printers, are restricted by throughput (actions per minute). An Operating System tries to allow access to all these resources by all processes simultaneously. By denying a process access to a specific resource, the program may not be able to perform its task correctly. However, to a program, fair may not mean equal. A web browser may heavily use network card, but never write to the Hard Drives, Alternatively, A Photo Editor may never require network access, but may write very large amounts to the Hard Drives.
 
187
 
 
188
 
 
189
 
 
190
\vspace{1.5mm}
 
191
\noindent
98
192
This high level `user perspective' of an Operating System is important to keep in mind through out this project as ultimately the users are the target demographic of the system. However to produce an Operating System a much more in-depth understanding is required.
99
193
 
100
194
 
101
195
 
102
196
 
103
 
An Operating System is higly a complex piece of software however all require 3 distinct sections:
 
197
An Operating System is highly a complex piece of software however all require 3 distinct sections:
104
198
 
105
199
The kernel is the software that drives the hardware. It provides nice abstractions and interfaces to control the very fiddly underlying machine.
106
200
 
107
 
The Bootloader is the code that is run first. It gets things that the kernel might need set up, for example, getting the CPU into the correct operation mode.
 
201
The Boot-loader is the code that is run first. It gets things that the kernel might need set up, for example, getting the CPU into the correct operation mode.
108
202
 
109
203
The Final part is a collection of programs and other software that come with the Operating System. Although some people would argue this is not so much part of the Operating System, on some systems (namely Microsoft's Windows) a huge number of these programs are built right in, and seem from the outside to be part of the kernel.
110
204
 
119
213
\label{fig:thekernel}
120
214
\end{wrapfigure}
121
215
 
122
 
The kernels job is to both control the hardware and mediate the execution of processes. To begin with it will initialise its modules, each there to control one piece of hardware or provide one service to the kernel or user-space. Some of the more important task these modules perform are keeping track of which processes are currently executing, deciding which processes should go next, as well as ensuring that all processes think they have enough memory to operate correctly.
 
216
The kernel's job is to both control the hardware and mediate the execution of processes. To begin with it will initialize its modules, each there to control one piece of hardware or provide one service to the kernel or user-space. Some of the more important task these modules perform are keeping track of which processes are currently executing, deciding which processes should go next, as well as ensuring that all processes think they have enough resources to operate correctly.
123
217
 
124
218
Once the kernel is happy that everything is in order, it will begin execution of the first process. For the rest of the time the computer is on, `processes' will be run. These processes each having a unique environment. In fact as far as a process is concerned, it owns the whole computer. However, as programmers are aware that each process does not own the whole computer, they can program complex interprocess interactions, with the kernels help of course.
125
219
 
126
220
 
127
221
 
128
222
\clearpage
129
 
\subsection{The Bootloader}
 
223
\subsection{The Boot-loader}
130
224
 
131
225
\begin{figure}[ht]
132
226
\centering
135
229
\label{fig:theloader}
136
230
\end{figure}
137
231
 
138
 
The bootloader's job is to load the kernel. The CPU has to begin executing code somewhere, this is the boot loader.
139
 
 
140
 
The majority of the bootloader's job is to get the hardware ready for the kernel to take over. Tasks like detecting the available physical memory of a machine is up to the bootloader, once it has gathered such information, the loader will store it somewhere the kernel can find it.
141
 
 
142
 
The final steps of the bootloader are to get the CPU into the right mode. It does this by first setting up some important `tables' in memory. One of these tells the CPU what to do if an interrupt is produced. Another tells the CPU where it can find physical addresses in RAM when virtual addresses are looked up.
143
 
 
144
 
Finally the bootloader can start the kernel and it's job is finished.
 
232
The boot-loader's job is to load the kernel. The CPU has to begin executing code somewhere, this is the boot loader.
 
233
 
 
234
The majority of the boot-loader's job is to get the hardware ready for the kernel to take over. Tasks like detecting the available physical memory of a machine is up to the boot-loader, once it has gathered such information, the loader will store it somewhere the kernel can find it.
 
235
 
 
236
The final steps of the boot-loader are to get the CPU into the right mode. It does this by first setting up some important `tables' in memory. One of these tells the CPU what to do if an interrupt is produced. Another tells the CPU where it can find physical addresses in RAM when virtual addresses are looked up.
 
237
 
 
238
Finally the boot-loader can start the kernel and it's job is finished.
145
239
 
146
240
\subsection{The Built in Programs}
147
241
 
181
275
\textbf {Primary Objectives:}
182
276
 
183
277
\begin{itemize}
184
 
\item Create a bootloader to boot a kernel.
 
278
\item Create a boot-loader to boot a kernel.
185
279
\item Create a kernel that should be able to:
186
280
\begin{itemize}
187
281
\item Load multiple `programs' into memory.
190
284
\item Allow for the management of the execution state of each `program'.
191
285
\item Allow each `program' access to a unique memory space.
192
286
\item Allow `programs' to asynchronously send data to each other.
193
 
\item Handle all common cpu interrupts and resolve them correctly.
 
287
\item Handle all common CPU interrupts and resolve them correctly.
194
288
\item Handle keyboard input and allow programs to `collect' keyboard inputs.
195
289
\end{itemize}
196
290
\item Create a small set of `programs' with which to test the kernel.
213
307
\begin{itemize}
214
308
\item \lbrack Complete\rbrack Create a user manual.
215
309
\item \lbrack Complete\rbrack Create a developers manual.
216
 
\item \lbrack Complete\rbrack Create set of scripts for getting the source code, Building the project, and deploying it to a computer.
 
310
\item \lbrack Complete\rbrack Create set of scripts for building the project, and deploying it to a computer.
217
311
\end{itemize}
218
312
 
219
313
 
232
326
 
233
327
\chapter{Professional Considerations}
234
328
 
235
 
As this project falls within the bound of Computer Science, It will comply with the British Society of Computing (BSC) Code of Conduct \cite{CoC}. Although there is no contractual obligation to follow this code, it is important to recognize and comply with them to ensure the integrity of the project.
 
329
As this project falls within the bound of Computer Science, it will comply with the British Society of Computing (BSC) Code of Conduct \cite{CoC}. Although there is no contractual obligation to follow this code, it is important to recognize and comply with them to ensure the integrity of the project.
236
330
 
237
331
\section{Public Interest}
238
332
 
279
373
 
280
374
\chapter{Requirements Analysis}
281
375
 
282
 
In preparation of producing an Operating System, current generation systems were studied in detail. The features and interfaces of the systems were analysed to assist in the designing of MOS. Although It was known in advanced that MOS was not going to be complex enough to incorporate all features of the reference systems, it was important to study what current systems do, such that their most important features could be mimicked.
 
376
In preparation of producing an Operating System, current generation systems were studied in detail. The features and interfaces of the systems were analyzed to assist in the designing of MOS. Although It was known in advanced that MOS was not going to be complex enough to incorporate all features of the reference systems, it was important to study what current systems do, such that their most important features could be mimicked.
283
377
 
284
378
Modern Operating Systems are such that there are two user groups.
285
379
 
287
381
The End Users are the people using the Operating System and its programs to assist in achieving an assortment of tasks. To them, the Operating System provides a few simple mechanisms to interact with the system, E.G. Launching programs, closing programs, and switching between the `focused' program. Most of the inner workings of the Operating System are hidden from the end user, and they mainly interact with the `User space programs', which are not defined by the Operating System Developer.
288
382
 
289
383
 
290
 
The Program Developers use an Operating System as a platform to create the programs the End User will use. To them, the Operating System is a Resource Manager and Scheduler and provides some crucial functionality for complex behaviours like creating new processes, Allocating dynamic memory, allocating screen space to the programs, and accesing the hard drive. Many of the complexities of the Operating System (especially hardware control) are abstracted away from the Program Developers, however it is expected that they have some awareness of how the system is structured to successfully integrate with the kernel.
 
384
The Program Developers use an Operating System as a platform to create the programs the End User will use. To them, the Operating System is a Resource Manager and Scheduler and provides some crucial functionality for complex behaviors like creating new processes, Allocating dynamic memory, allocating screen space to the programs, and accessing the hard drive. Many of the complexities of the Operating System (especially hardware control) are abstracted away from the Program Developers, however it is expected that they have some awareness of how the system is structured to successfully integrate with the kernel.
291
385
 
292
386
 
293
387
 
298
392
\section{The End User}
299
393
The reference systems that were studied with the End Users in mind are: The Linux distribution remix `Gnomebuntu' and the Microsoft Operating System `Windows 8'. These systems were chosen to get a spread in our sample. The systems are both popular desktop systems, however: One, (Linux) is stemmed from an open source mentality, where the source code is freely available and the system is free, and the other (Windows) is produced by a company with the aim to provide paying business, and home customers with a usable system.
300
394
 
301
 
The parts of the reference systems that were analysed from the end users perspective are; program launching, process management, and program interaction as these are the main sections that will be implemented in the MOS.
 
395
The parts of the reference systems that were analyzed from the end users perspective are; program launching, process management, and program interaction as these are the main sections that will be implemented in the MOS.
302
396
 
303
397
\subsection{Launching programs in Linux and Windows}
304
398
 
315
409
\begin{minipage}{.5\textwidth}
316
410
  \centering
317
411
  \includegraphics[width=200px]{images/Windows_Program_Launcher_Screenshot}
318
 
  \caption{Windows Program Launcher Interface}
 
412
  \caption{Windows program launcher interface}
319
413
  \label{fig:WinLaunchScreen}
320
414
\end{minipage}%
321
415
\begin{minipage}{.5\textwidth}
322
416
  \centering
323
417
  \includegraphics[width=200px]{images/Linux_Program_Launcher_Screenshot}
324
 
  \caption{Linux Program Launcher Interface}
 
418
  \caption{Linux program launcher interface}
325
419
  \label{fig:LinLaunchScreen}
326
420
\end{minipage}
327
421
\end{figure}
331
425
 
332
426
Both reference systems provide a way of interacting directly with the process manager to give the user power over which programs are running on their system.
333
427
 
334
 
In each system, the process manager is very similar, as the tasks they perform are identical. Both systems provide a window that lists processes and some relevant information about each process like PID, cpu usage, memory usage, disk usage, and network usage. It was found that the majority of these fields are concerned with what resources a process is using. This is the case because an Operating System's purpose is to manage the physical resources available to the software.
 
428
In each system, the process manager is very similar, as the tasks they perform are identical. Both systems provide a window that lists processes and some relevant information about each process like PID, CPU usage, memory usage, disk usage, and network usage. It was found that the majority of these fields are concerned with what resources a process is using. This is the case because an Operating System's purpose is to manage the physical resources available to the software.
335
429
 
336
 
Each system also provides the ability to change what information is provided for each process, these extra informations include many other physical resource usages (I.E. Nice value, or cpu time) as well as a more in depth view of the default informations (I.E. separating `memory usage' into: Virtual, Resident, Writeable, Shared, and Xserver memory.)
 
430
Each system also provides the ability to change what information is provided for each process, these extra informations include many other physical resource usages (I.E. Nice value, or CPU time) as well as a more in depth view of the default informations (I.E. separating `memory usage' into: Virtual, Resident, Write-able, Shared, and X server memory.)
337
431
 
338
432
In each system this list was scrollable, allowing for many more processes that can fit in the window, furthermore the window becomes horizontally scrollable if the information exceeds the width of the screen.
339
433
 
346
440
\begin{minipage}{.5\textwidth}
347
441
  \centering
348
442
  \includegraphics[width=200px]{images/Windows_Program_Manager_Screenshot}
349
 
  \caption{Windows Program Manager Interface}
 
443
  \caption{Windows program manager interface}
350
444
  \label{fig:WinProcManScreen}
351
445
\end{minipage}%
352
446
\begin{minipage}{.5\textwidth}
353
447
  \centering
354
448
  \includegraphics[width=200px]{images/Linux_Program_Manager_Screenshot}
355
 
  \caption{Linux Program Manager Interface}
 
449
  \caption{Linux program manager interface}
356
450
  \label{fig:LinProcManScreen}
357
451
\end{minipage}
358
452
\end{figure}
364
458
 
365
459
In both the reference systems, the programs were presented in `floating', overlapping windows. These windows share the screen space by having the `active' window draw on top of all other windows. The system provides a way or moving, hiding, and resizing the windows to customize your workspace. Both systems provide similar mechanics for achieving this. They each provide a `title bar' that can be grabbed and dragged around to move the window. Each also provide the ability to grab the very edge of any side of any window, or the corners, to resize the window to the desired size. Finally, each system provides buttons to manipulate the windows more directly. This is where the systems begin to differ.
366
460
 
367
 
The Windows Operating System provides three buttons; The first Button allows the user to minimize the window to hide it from the work space. The second button is to maximize/un-maximize the window, this makes the window occupy the entirety of the screen. The final button exits the application.
 
461
The Windows Operating System provides three buttons; The first Button allows the user to minimize the window to hide it from the work space. The second button is to maximize/unmaximize the window, this makes the window occupy the entirety of the screen. The final button exits the application.
368
462
 
369
463
The Linux Operating System only provides an exit button.
370
464
 
373
467
\begin{figure}[ht]
374
468
\centering
375
469
\includegraphics[width=200px]{images/Windows_title_bar_screenshot}
376
 
\caption{Windows Title Bar Example}
 
470
\caption{Windows title bar example}
377
471
\label{fig:WinTitleBarScreen}
378
472
\end{figure}
379
473
 
380
474
\begin{figure}[ht]
381
475
\centering
382
476
\includegraphics[width=200px]{images/Linux_title_bar_screenshot}
383
 
\caption{Linux Title Bar Example}
 
477
\caption{Linux title bar example}
384
478
\label{fig:LinTitleBarScreen}
385
479
\end{figure}
386
480
 
387
481
Because of the nature of overlapping windows on both systems, it is possible for one window to be drawn entirely `under' another window. In Windows it is in fact possible to choose to hide a window from the workspace completely. In this situation the systems both provide different ways to navigate back to the `hidden' window.
388
482
 
389
 
On windows, There is a `task bar'. This is a portion of the screen, (often located at the bottom of the screen), that stores small icons for each running program. Clicking on one of these icons will bring that program to the front, un-minimize it, and make it the `active' program.
 
483
On windows, There is a `task bar'. This is a portion of the screen, (often located at the bottom of the screen), that stores small icons for each running program. Clicking on one of these icons will bring that program to the front, unminimize it, and make it the `active' program.
390
484
 
391
 
On Linux, Pressing the windows key, or pointing your mouse cursor to the corner of the screen shows you all of the open programs by `zooming out' and separating all the programs from each other. Selecting a program from this `exploded' view will un-minimize this window, bring it to the front, and make it the active window.
 
485
On Linux, Pressing the windows key, or pointing your mouse cursor to the corner of the screen shows you all of the open programs by `zooming out' and separating all the programs from each other. Selecting a program from this `exploded' view will unminimize this window, bring it to the front, and make it the active window.
392
486
 
393
487
Figure \ref{fig:WinWinNavScreen} and \ref{fig:LinWinNavScreen} give example of these Navigation features.
394
488
 
397
491
\begin{minipage}{.5\textwidth}
398
492
  \centering
399
493
  \includegraphics[width=200px]{images/Windows_Window_Navigation_Screenshot}
400
 
  \caption{Windows Program Navigation Interface}
 
494
  \caption{Windows program navigation interface}
401
495
  \label{fig:WinWinNavScreen}
402
496
\end{minipage}%
403
497
\begin{minipage}{.5\textwidth}
404
498
  \centering
405
499
  \includegraphics[width=200px]{images/Linux_Window_Navigation_Screenshot}
406
 
  \caption{Linux Program Navigation Interface}
 
500
  \caption{Linux program navigation interface}
407
501
  \label{fig:LinWinNavScreen}
408
502
\end{minipage}
409
503
\end{figure}
414
508
 
415
509
To understand how program developers interact with Operating Systems The Linux distribution remix `Gnomebuntu' was studied. Only one system here was studied as Linux is an open source system. This meant that the system could be looked at in more depth.
416
510
 
417
 
The parts of the Linux system that were analysed are the; Process management system, the memory management system, the windowing system, and Inter Process Communication.
 
511
The parts of the Linux system that were analyzed are the; Process management system, the memory management system, the windowing system, and Inter Process Communication.
418
512
 
419
513
\subsection{Managing processes in Linux}
420
514
 
 
515
Managing processes for the program developers is a very import tool in multitasking systems. Being able to create new processes and define their behavior allows for true programs to perform more than one task at once, even if one process is waiting on a resource or some user input, another processes from the same program can be performing calculations or updating the screen. Being able to destroy processes allows for resources to be freed explicitly and allows for the killing of malicious programs. Pausing processes for sections of time allow program developers to temporarily free up resources to make way for other processes, this can be to allow faster execution of other services or to save power on mobile devices.
 
516
 
421
517
Linux exposes a number of system calls to the program developers to allow them to create, destroy, and pause processes, and also change the current `executable' to allow for new programs to be run.
422
518
 
423
519
\noindent
425
521
 
426
522
To create a new process, Linux provide the fork system call. \cite{manFork}
427
523
 
428
 
Fork will spawn a new processes with a perfect copy of the calling processes memory and cpu state. This effectively means that fork will return twice, once into the caller and once into the child. It will return 0 to the child and the child pid to the parent.
 
524
Fork will spawn a new processes with a perfect copy of the calling processes memory and CPU state. This effectively means that fork will return twice, once into the caller and once into the child. It will return 0 to the child and the child PID to the parent.
429
525
 
430
526
\noindent
431
527
\textbf{Changing executable}
448
544
 
449
545
\subsection{Managing memory in Linux}
450
546
 
 
547
Memory management is a useful tool for allowing processes to gain access to more memory on demand. It is often used as a way to initially provide processes with a very tiny memory space to conserver memory for other uses, and allow them to expand to whatever size they please. A good memory management system also ensures that very little memory is wasted or rendered unusable.
 
548
 
451
549
Linux provides two functions for memory management, one to allocate memory and one to free it.
452
550
 
453
551
\noindent
472
570
 
473
571
\subsection{Inter Process Communication in Linux}
474
572
 
475
 
Communication between processes is an important part of creating complex behaviours in user space programs. Linux provides some simple calls to create channels of communication between processes.
 
573
Communication between processes is an important part of creating complex behaviors in user space programs however it is one of the more complex sub-systems of an operating system. This is due to the idea that each processes should believe it has total access to the computer and not be able to directly interact with another processes memory. Because of this many different versions of IPC have been formulated. Some create a special portion of the kernel to hold all the information in the communication channels and then give it to the processes on demand. Others create a piece of user-space memory that is accessible by two or more processes. Finally some systems copy the memory from one process' space to the others.
 
574
 
 
575
Furthermore some system also implement different policies for reading and writing to pipes; Some systems use `blocking' system calls, meaning that if the pipe is empty, the read system call will wait until the pipe is no longer empty, effectively pausing the calling processes until this time.
 
576
 
 
577
Linux can be said to use the first method for storing the pipe. When a pipe is created Linux creates a file in a virtual file system (a file system that lives only in kernel memory). Any process that has the handle to this virtual file (aka has the pipe handle) can write or write to the pipe. Linux also does not include blocking system calls for pipes, this is because it believes the user space should have control over when it is blocked or not.
 
578
 
 
579
Linux provides some simple calls to create channels of communication between processes.
476
580
 
477
581
\noindent
478
582
\textbf{Creating a pipe.}
492
596
 
493
597
It was found that in end user design, many systems share similar design features. These features are very rich and operate do to a wide collection of tool, utilities, and applications. The most important of these feature should be mimicked in new systems to assist new users in understanding how the the system works, However due to time constraints MOS will target much simpler versions of these features.
494
598
 
495
 
From the programmers perspective. The system API's or modern Operating Systems have been well thought out and have stood the test of time, however sometimes represent behaviours far more complex than that which MOS targets. The studied API's will be mimicked both to follow tried and tested ideas, and also so that program developers feel at home developing for MOS.
 
599
From the programmers perspective. The system API's on modern Operating Systems have been well thought out and have stood the test of time, however sometimes represent behaviors far more complex than that which MOS targets. The studied API's will be mimicked both to follow tried and tested ideas, and also so that program developers feel at home developing for MOS.
496
600
 
497
601
 
498
602
 
529
633
 
530
634
\chapter{Design}
531
635
 
532
 
As with the Analysis, the Design phase was separated into End User and Program Developer sections. However here the structure of the kernel itself was also considered and planned. The designs presented here are the final designs for the system, some earlier versions can be found in TODO Link to apendix here.
 
636
As with the Analysis, the Design phase was separated into End User and Program Developer sections. However here the structure of the kernel itself was also considered and planned. The designs presented here are the final designs for the system, some earlier versions can be found in TODO Link to appendix here.
533
637
 
534
 
Design for the end user focused on similar tools, looks, and controls to existing systems; The Linux CLI was referenced for a lot of the simple command line tools as MOS' text mode graphics share a common interface to Linux terminals. MOS programs also targeted a clean workspace, avoiding unnecessary ascii drawing and focussing on delivering the service provided in a quick and clean manner.
 
638
Design for the end user focused on similar tools, looks, and controls to existing systems; The Linux CLI was referenced for a lot of the simple command line tools as MOS' text mode graphics share a common interface to Linux terminals. MOS programs also targeted a clean workspace, avoiding unnecessary ASCII drawing and focusing on delivering the service provided in a quick and clean manner.
535
639
 
536
640
Program Developer design was constructed with a `many simple tools' structure. Each system call the standard library contained was made to perform one task, rather than bunching many tasks into one more complex call. This allows developers to maintain simple, intuitive control over their resources.
537
641
 
550
654
\item File editing.
551
655
\end{itemize}
552
656
 
553
 
\subsection {Process Creations : MASH}
 
657
\subsection {Process creation : `MASH'}
554
658
 
555
659
MASH will be MOS' built in shell. Using MASH, users can launch any other process.
556
660
 
558
662
 
559
663
Since MASH will cover Process Creation. All other actions that user can perform with build in tools are achieved through different built in programs. The user can use MASH to launch these programs passing any desired parameters.
560
664
 
561
 
\subsection{Process Management : processes}
 
665
\subsection{Process management : `processes'}
562
666
 
563
667
The program called processes will serve as the users tool for killing processes.
564
668
 
585
689
 
586
690
As shown, this tool will show the user information about each running processes and afford them the ability to kill these processes.
587
691
 
588
 
\subsection{File/Directory creation: mkdir and touch}
 
692
\subsection{File/Directory creation: `mkdir' and `touch'}
589
693
 
590
694
MOS will provide two programs for creating files and directories. touch will create empty files and mkdir will create directories. Both programs will operate in a similar way, taking an absolute path as their only parameter. Neither will create anything unless the parent directory of the wanted object exists, and the parameter is well formed (with a trailing / for directories).
591
695
 
592
 
\subsection{File/Directory Management: rm and mv}
 
696
\subsection{File/Directory management: `rm' and `mv'}
593
697
 
594
698
For file and directory management MOS will provide two functions.
595
699
 
597
701
 
598
702
The second is mv. mv will take two parameters, the first will be the path to an existing file system object (file or directory) and the second will be the path to an existing directory. mv will move the specified object (and all of its children in the case of a directory) into the target directory.
599
703
 
600
 
\subsection{File Editing: notes}
 
704
\subsection{File Editing: `notes'}
601
705
 
602
706
MOS' will provide a simple multi-line text editor for editing text files. The program will take one parameter which is a path to the file you wish to edit. If the file does not exist notes will create it.
603
707
 
635
739
 
636
740
\section{The Program Developers}
637
741
 
638
 
As program developers are very familiar with how to create programs for other systems, the API for the project system was designed to be very similar to that of the Linux kernel that was analysed.
 
742
As program developers are very familiar with how to create programs for other systems, the API for the project system was designed to be very similar to that of the Linux kernel that was analyzed.
639
743
 
640
744
\subsection{Managing processes}
641
745
 
642
 
MOS will provide a very similar set of system calls to Linux, however their behaviour may be simpler.
 
746
MOS will provide a very similar set of system calls to Linux, however their behavior may be simpler.
643
747
 
644
748
These features were considered independently of each other except for creating a new process and changing the current executable, as these calls are so commonly used together.
645
749
 
649
753
 
650
754
\vspace{1.5mm}
651
755
\noindent
652
 
`fork()' will return the child pid to both the parent and the child, allowing for the processes to distinguish themselves by comparing this value to the value of the `get\textunderscore pid()' system call. On failure it will return -1.
 
756
`fork()' will return the child PID to both the parent and the child, allowing for the processes to distinguish themselves by comparing this value to the value of the `get\textunderscore PID()' system call. On failure it will return -1.
653
757
 
654
758
\vspace{1.5mm}
655
759
\noindent
661
765
 
662
766
\vspace{1.5mm}
663
767
\noindent
664
 
`kill(pid)' will kill the target process, freeing all its memory and removing it from the scheduler.
 
768
`kill(PID)' will kill the target process, freeing all its memory and removing it from the scheduler.
665
769
 
666
770
\subsubsection{Pausing and Restarting programs}
667
771
 
669
773
 
670
774
\vspace{1.5mm}
671
775
\noindent
672
 
`pause()' and `pause(pid)' will pause the target process until `wake()' is called. With `pause()' the current process will be paused and immediately revoke controls to the scheduler.
 
776
`pause()' and `pause(PID)' will pause the target process until `wake()' is called. With `pause()' the current process will be paused and immediately revoke controls to the scheduler.
673
777
 
674
778
\vspace{1.5mm}
675
779
\noindent
676
 
`wake(pid)' will wake the target process and allow it to be scheduled again. It will NOT cause the target process to be executed next.
 
780
`wake(PID)' will wake the target process and allow it to be scheduled again. It will not necessarily cause the target process to be executed next.
677
781
 
678
782
\vspace{1.5mm}
679
783
\noindent
681
785
 
682
786
\subsection{Managing memory}
683
787
 
684
 
The memory managemnt API will be identical to that of Linux. Therefore MOS will provide two system calls:
 
788
The memory management API will be identical to that of Linux. Therefore MOS will provide two system calls:
685
789
 
686
790
\vspace{1.5mm}
687
791
\noindent
727
831
 
728
832
\subsection{File Access}
729
833
 
730
 
The File access functions will use a similarly idea to linux's however will be far simpler.
 
834
The File access functions will use a similarly idea to Linux's however will be far simpler.
731
835
 
732
836
\vspace{1.5mm}
733
837
\noindent
734
 
`fopen(name, \&file\_handle, create)' will open the file specified by the absolute path `name' and store the relelvent information into the file handle provided. If the file does not exist and the `create' parameter is true, the file will be created. If the directory does not exists, no action will be taken. If the file does not exist or any other error occurs, the type field of the file handle will be set to 2. The rest of the structure will be considered invalid.
 
838
`fopen(name, \&file\_handle, create)' will open the file specified by the absolute path `name' and store the relevant information into the file handle provided. If the file does not exist and the `create' parameter is true, the file will be created. If the directory does not exists, no action will be taken. If the file does not exist or any other error occurs, the type field of the file handle will be set to 2. The rest of the structure will be considered invalid.
735
839
 
736
840
\vspace{1.5mm}
737
841
\noindent
755
859
 
756
860
\vspace{1.5mm}
757
861
\noindent
758
 
`frename(oldname, newname)' will move and rename the file at oldname to newname. If either the source file doesn not exist or the target directory does not exist the function will take no action.
 
862
`frename(oldname, newname)' will move and rename the file at oldname to newname. If either the source file doesn't not exist or the target directory does not exist the function will take no action.
759
863
 
760
864
 
761
865
\subsection{Directory Access}
797
901
 
798
902
\section{The Kernel}
799
903
 
800
 
The kernel was split into a number of discrete modules, each performing one simple task, or over seeing the access to one peice of hardware. These modules were originally designed to be self contained, not relying on any other modules, however it was quickly realised that some modules could be brought `closer together' to help streamline the kernel. The most notable case of this is the scheduler and the terminal manger, the scheduler contains the process entries for each running application, including the io descriptors, these io descriptors are required by the terminal to operate, therefore the scheduler allows write access to these data structures `cross module'.
 
904
The kernel was split into a number of discrete modules, each performing one simple task, or over seeing the access to one piece of hardware. These modules were originally designed to be self contained, not relying on any other modules, however it was quickly realized that some modules could be brought `closer together' to help streamline the kernel. The most notable case of this is the scheduler and the terminal manger, the scheduler contains the process entries for each running application, including the IO descriptors, these IO descriptors are required by the terminal to operate, therefore the scheduler allows write access to these data structures `cross module'.
801
905
 
802
906
The Kernel Loader can also be seen as a kernel module however it is special in that it does its job once at boot, and then does nothing for the remainder of the computers uptime.
803
907
 
806
910
 
807
911
\begin{figure}[ht]
808
912
\centering
809
 
\includegraphics[width=400px]{images/Kernel_Modules}
810
 
\caption{Kernel Module Dependencies}
 
913
\includegraphics[width=400px]{images/Kernel_Moduels}
 
914
\caption{Kernel module dependencies}
811
915
\label{fig:WinTitleBarScreen}
812
916
\end{figure}
813
917
 
832
936
 
833
937
The Kernel Loader can actual be seen as more of a kernel in its own right. It is the code that is loaded by our Boot loader (GRUB). The loaders job is to to correctly configure the hardware in the CPU's Real Mode and then switch over to Protected Mode for the rest of the uptime of the CPU.
834
938
 
835
 
It has its own smaller Physical Memory Manager, IO Manager and XXX, To assist in its task. It then maps the kernel to the correct location in memory and jumps to the kernels entry point.
 
939
It has its own smaller Physical Memory Manager and IO Manager, To assist in its task. It then maps the kernel to the correct location in memory and jumps to the kernels entry point.
836
940
 
837
941
Since the kernel only executes in Protected mode, it has less direct access to physical memory, therefore the kernel loader must initialize the memory map for the Physical Memory Manager module and map this memory map into a suitable Virtual memory location.
838
942
 
842
946
 
843
947
\subsection{The Program Loader}
844
948
 
845
 
The program loaders job is to prepare a Program for execution; Loading the binary into memory in an appropriate manner, setting all process table fields to correct values, and ensuring all other system modules correctly reflect the execution of a new program.
 
949
The program loader's job is to prepare a Program for execution; Loading the binary into memory in an appropriate manner, setting all process table fields to correct values, and ensuring all other system modules correctly reflect the execution of a new program.
846
950
 
847
951
\subsection{The Event Manager}
848
952
 
849
 
The event managers job is to track timed events. It will allow for the registration of certain types of events with an event deadline. Once the deadline is passed the Event manager will perform the requested action. This module requires that its main function 'events()' be called with some frequency.
 
953
The event manager's job is to track timed events. It will allow for the registration of certain types of events with an event deadline. Once the deadline is passed the Event manager will perform the requested action. This module requires that its main function `events()' be called with some frequency.
850
954
 
851
955
\subsection{The Pager}
852
956
 
878
982
 
879
983
\subsection{The IO Manager}
880
984
 
881
 
The IO manager will control all IO for user interaction with processes, as well as any outputting the kernel may do. It must maintain a current rendering of all running processes screen space, and deliver keyboard input to user space processes at the users command. It should also maintain different kernel space and user space windows, allowing for the user to switch between the kernel and user process view.
882
 
 
883
 
\subsection{Keyboard Driver}
 
985
The IO manager will control all IO for user interaction with processes, as well as any outputting the kernel may do. It must maintain a current rendering of all running process' screen space, and deliver keyboard input to user space processes at the users command. It should also maintain different kernel space and user space windows, allowing for the user to switch between the kernel and user process view.
 
986
7
884
987
 
885
988
The keyboard Driver handles keyboard input to the system, Its main job is to correctly pass signals along to the IO manager such that they can be sent to user space processes, however it may also detect system commands (like ctrl+tab and F1) and call the respective module to perform the expected action.
886
989
 
976
1079
 
977
1080
This structure is very slow when searching for processes with specific attributes, and also contains no information about the order in which processes were created. For these reasons the Scheduler also contains a number of linked lists, each storing a list of PID's of processes that are `interesting' in some way.
978
1081
 
979
 
The active process list contains all processes that either want CPU time, or are known to want CPU time in the future. The list is ordered in such that the process at the front is always the lest recent to have had CPU time.
 
1082
The active process list contains all processes that either want CPU time, or are known to want CPU time in the future. The list is ordered in such that the process at the front is always the least recent to have had CPU time.
980
1083
 
981
1084
Using a linked list to store the active processes makes it very fast to select a new process to run, and as the scheduler maintains a handle to both ends of the list, both getting the first item in the list and putting something at the back of the list is O(1) time.
982
1085
 
1019
1122
 
1020
1123
\subsubsection{The IO part}
1021
1124
 
1022
 
The io part stores information about the processes IO, this information isused and managed by the IO manager which is discuessed next.
 
1125
The IO part stores information about the processes IO, this information issued and managed by the IO manager which is discussed next.
1023
1126
 
1024
1127
 
1025
1128
 
1074
1177
 
1075
1178
The IO manager first appends this process to its `outputable' list and populates the IO part of the respective processes table entry with the remainder of the metrics, filling the column and row potion with 0 and 0.
1076
1179
 
1077
 
It then checks for any overlapping processes, these are processes that are in the `outputable' list who's screen area collides with the new request. For any overlapping processes, the IO manager first pauses that processes, giving it the is\_hidden flag. Then it uses malloc() to request a portion of the kernels heap space of the same size as the old processes screen space. It copies the current state of this screen space into the new memory and assigns the pointer into the `snapshot' section of the IO part of the process entry. It then moves the processes from the `outputable' list to the `hidden' list. Finally it wipes the process' portion of the screen blank.
 
1180
It then checks for any overlapping processes, these are processes that are in the `outputable' list who's screen area collides with the new request. For any overlapping processes, the IO manager first pauses that processes, giving it the is\_hidden flag. Then it uses malloc() to request a portion of the kernels heap space of the same size as the old process' screen space. It copies the current state of this screen space into the new memory and assigns the pointer into the `snapshot' section of the IO part of the process entry. It then moves the processes from the `outputable' list to the `hidden' list. Finally it wipes the process' portion of the screen blank.
1078
1181
 
1079
1182
The above procedure ensures that, from a processes perspective, it always has full control over a portion of the screen. This is because when a process doesn't have control of that part of the screen, the process is paused and cannot be executed.
1080
1183
 
1081
1184
When the user requests to see one of the hidden processes, the IO manager repeats the process above, but instead checks for overlapping with the process that the user wants to bring to the front. Once any overlapping processes have been correctly hidden, it copies the snapshot of the requested process back to the correct area of the screen and unpauses it, moving it back to the `outputable' list.
1082
1185
 
1083
 
The IO manager supports two output modes for processes; progressive and targeted. In progressive mode, the  IO Manager keeps track of the current position of each processes `caret'. Then, if a processes wants to print in this mode, the processes simply passes a character to the IO manager. The IO manager will use the column and row fields of the IO part of the process entry to place the character within the processes screen space. The IO manager will make sure to wrap when the end of the line is reached, and will also roll the entire process' terminal space up when the bottom is reached. This behavior is very similar to that seen in the Linux and Windows CLI's.
 
1186
The IO manager supports two output modes for processes; progressive and targeted. In progressive mode, the  IO Manager keeps track of the current position of each processes `caret'. Then, if a processes wants to print in this mode, the processes simply passes a character to the IO manager. The IO manager will use the column and row fields of the IO part of the process entry to place the character within the process' screen space. The IO manager will make sure to wrap when the end of the line is reached, and will also roll the entire process' terminal space up when the bottom is reached. This behavior is very similar to that seen in the Linux and Windows CLI's.
1084
1187
 
1085
 
In targeted mode the process sends the IO manager both a character and a coordinate for that character. The IO manager will then check if the coordinate is within the bounds of the processes screen space and if so, draw it to the screen. This draw mode allows more sophisticated user-space applications to `draw' better gui's and update only portions of the screen space at a time.
 
1188
In targeted mode the process sends the IO manager both a character and a coordinate for that character. The IO manager will then check if the coordinate is within the bounds of the process' screen space and if so, draw it to the screen. This draw mode allows more sophisticated user-space applications to `draw' better GUI's and update only portions of the screen space at a time.
1086
1189
 
1087
1190
\clearpage
1088
1191
\section{The Flat vs List interlude}
1116
1219
i \textless= p\\
1117
1220
p \textless= n\\
1118
1221
 
 
1222
For typical usage of my home computer, n == ~18000, p == ~113, i == ~10, o == ~10
 
1223
 
1119
1224
 
1120
1225
\begin{figure}[ht]
1121
1226
\centering
1127
1232
 
1128
1233
 
1129
1234
\clearpage
1130
 
\section{Event Manager}
 
1235
\section{The Event Manager}
1131
1236
 
1132
1237
\subsection{Data Structure}
1133
1238
 
1247
1352
 
1248
1353
 
1249
1354
 
1250
 
\subsection{File System}
 
1355
\subsection{The File System}
1251
1356
 
1252
1357
The file system used (called MRFS from here on out) was a modification of a piece of second year coursework. This coursework required the creation of a file system along with a set of file read write interfaces. These parts will therefore only be discussed briefly. A new set of abstractions were created from scratch for the user space system and these abstractions will be discussed in more detail.
1253
1358
 
1260
1365
\begin{figure}[ht]
1261
1366
\centering
1262
1367
\includegraphics[width=200px]{images/MRFS_Structure}
1263
 
\caption{Example inode structure #TODO : give source to image.}
 
1368
\caption{Example inode structure}
1264
1369
\label{fig:WinTitleBarScreen}
1265
1370
\end{figure}
1266
1371
 
1300
1405
 
1301
1406
 
1302
1407
 
1303
 
\section{Pager}
 
1408
\section{The Pager}
1304
1409
 
1305
1410
The pager has no central data structure, however it does maintain a list of constants, each being the virtual memory address assigned to a specific kernel subsystem.
1306
1411
 
1320
1425
 
1321
1426
 
1322
1427
 
1323
 
\section{Heap manager}
 
1428
\section{The Heap manager}
1324
1429
 
1325
1430
\subsection{Data Structure}
1326
1431
 
1358
1463
 
1359
1464
 
1360
1465
 
1361
 
\section{Pipe Manager}
 
1466
\section{The Pipe Manager}
1362
1467
 
1363
1468
\subsection{Data Structure}
1364
1469
 
1400
1505
 
1401
1506
\clearpage
1402
1507
 
1403
 
\section{Interrupts handler}
 
1508
\section{The Interrupts handler}
1404
1509
 
1405
1510
The Interrupts handler has no core data structures.
1406
1511
 
1442
1547
 
1443
1548
 
1444
1549
 
1445
 
\section{Program Loader}
 
1550
\section{The Program Loader}
1446
1551
 
1447
1552
The program loader has no core data structures and can be seen as a sub module of the scheduler. When called it initializes the process entry for the selected processes, loads an ELF-Binary of the disk into memory, maps that memory to virtual addresses, storing these addresses in the process entry, and finally returns the entry point for that binary for the scheduler to jump to.
1448
1553
 
1563
1668
 
1564
1669
The project produced an Operating System that can be deployed on real hardware and can be used in the day to day life of users. Although the number of user-space programs are limited, this was always out of the scope of the project.
1565
1670
 
1566
 
With further time and resources, a focus would be put on creating a larger set of builtin programs and creating a network interface for connecting to the internet.
1567
 
 
1568
 
Throughout the project I have gained a lot of knowledge about how computers function and how common structures and procedures are employed in modern operating systems. Furthermore I have gathered experience in using the C language to create powerful, reliable code.
 
1671
The system successfully achieves fair sharing of all incorporated hardware resources and acts as a platform under which program developers could produce arbitrary complex programs.
 
1672
 
 
1673
With further time and resources, a focus would be put on creating a larger set of built-in programs, for example some more playable games, a more sophisticated file editor, and some presentation software.
 
1674
 
 
1675
Along side this creating a network interface for connecting to the Internet would vastly improve the utility of the system.
 
1676
 
 
1677
Throughout the project I have gained a lot of knowledge about how computers function and how common structures and procedures are employed in Modern Operating Systems. Furthermore I have gathered experience in using the C language to create powerful, reliable code.
1569
1678
 
1570
1679
 
1571
1680
 
1586
1695
\item Bound all interrupts to stubs.
1587
1696
\item Created simple kernel threading.
1588
1697
\item Created a `printf' like utility.
1589
 
\item Supervisor Meeting 1: This week we discussed the state of the project, some goals to hit in the upcoming weeks and the proposal report due in next week.
1590
1698
\end{itemize}
1591
1699
 
1592
1700
\section*{Week 3}
1594
1702
\item Implemented Paging.
1595
1703
\item Moved to a higher half kernel.
1596
1704
\item Loaded my first `user space' program.
1597
 
\item Supervisor Meeting 2: This week we discussed how process creation was handled in linux and other Operating Systems, and how to move forward with concurrency.
1598
1705
\end{itemize}
1599
1706
 
1600
1707
\section*{Week 4}
1601
1708
\begin{itemize}
1602
1709
\item implemented fork system call.
1603
1710
\item implemented exec system call.
1604
 
\item Supervisor Meeting 3: This week we discussed how IPC was handled on many different system and how I could think about going ahead with IPC.
1605
1711
\end{itemize}
1606
1712
 
1607
1713
\section*{Week 5}
1614
1720
\item created proposal for IPC.
1615
1721
\item implemented IPC.
1616
1722
\item began work on interim report.
1617
 
\item Supervisor Meeting 4: This week we discussed how to continue work on IPC and the next steps of using the IPC to abstract general process I/O.
1618
1723
\end{itemize}
1619
1724
 
1620
1725
\section*{Week 7}
1680
1785
\begin{itemize}
1681
1786
\item Scheduler now reuses old PID's
1682
1787
\item Created much better notes program with multi line editing capabilities.
1683
 
\item Added cpu time metric for all processes.
 
1788
\item Added CPU time metric for all processes.
1684
1789
\item Created `ls' and `less' programs
1685
1790
\item Improved processes program.
1686
 
\item Added better testing for memory manager and file sytem.
 
1791
\item Added better testing for memory manager and file system.
1687
1792
\item Fixed many misc bugs.
1688
1793
\end{itemize}
1689
1794
 
1725
1830
\item Created Developer docs.
1726
1831
\item Bound remainder of CPU interrupts.
1727
1832
\item Improved Processes program/
1728
 
\item Fixed many bugs with fork cycle and mrfs edge cases.
 
1833
\item Fixed many bugs with fork cycle and MRFS edge cases.
1729
1834
\end{itemize}
1730
1835
 
1731
1836
\section*{Week 21}
1739
1844
 
1740
1845
\section*{Week 22}
1741
1846
\begin{itemize}
1742
 
\item Code Refactor.
 
1847
\item Code Re-factor.
1743
1848
\end{itemize}
1744
1849
 
1745
1850
\section*{Week 23}