Rev 155 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
156 | palkovsky | 1 | \chapter{Goals and Achievements} |
155 | decky | 2 | |
3 | \section{Overall Conception} |
||
4 | |||
5 | General-purpose and portable operating system with elements of |
||
6 | microkernel design and fully preemptive kernel. |
||
7 | |||
8 | SPARTAN kernel created by Jakub Jermar will be used as a basis for |
||
9 | further kernel development. |
||
10 | |||
11 | Detailed description of the features: |
||
12 | |||
13 | \begin{itemize} |
||
14 | \item General-purpose: Ready to run standard (non real-time) server and |
||
15 | workstation applications. Support for common programming |
||
16 | abstractions (threads, synchronization, physical and virtual |
||
17 | memory management). |
||
18 | \item Portable: Except small platform-specific kernel parts the system |
||
19 | will be implemented in higher programming languages to be portable |
||
20 | to different hardware platforms (PCs and similar). |
||
21 | \item Fully preemptive kernel: The basic scheduling element will be a |
||
22 | thread (more threads eventually grouped into a task) and the task |
||
23 | switching will be preemptive in both user-space and kernel-space. |
||
24 | However no real-time scheduling will be attempted. |
||
25 | \item Fine grained locking in kernel: The kernel will not contain |
||
26 | anything such as "big kernel lock", all critical sections will be |
||
27 | handled with small granularity locking. |
||
28 | \item Elements of microkernel design: The code running in kernel-space |
||
29 | will be limited to a much smaller size compared for example to the |
||
30 | traditional Unix design. The kernel will contain mostly just the |
||
31 | code which is necessary to run in kernel-space (scheduling, memory |
||
32 | management and protection, hardware resource management, IPC). |
||
33 | Device drivers, filesystems, network stacks, etc. will be |
||
34 | implemented in user-space. |
||
35 | \end{itemize} |
||
36 | |||
156 | palkovsky | 37 | {\em The overall conecption of the kernel design was completely met. The kernel |
38 | is fully preemptible, SMP ready with fine-grained locking. If possible, |
||
39 | device drivers are implemented as standalone userspace tasks. HelenOS |
||
40 | fully supports statically linked tasks. Both userspace tasks and kernel |
||
41 | tasks are supported (N:M multithreading model). |
||
42 | |||
43 | The kernel was successfully ported to 5 architectures with one other |
||
44 | architecture to come. The interfaces in the kernel are designed in such |
||
45 | a way to fully utilize specifics of every platform, e.g. ASID and RID |
||
46 | allocation in MIPS and IA64, two stacks for IA64 and SMP routines. |
||
47 | } |
||
48 | |||
155 | decky | 49 | \section[1a]{Research Domains} |
50 | |||
51 | Following features can be eventually implemented as research subjects, |
||
52 | but are optional to the overall design of the system: |
||
53 | |||
54 | \begin{itemize} |
||
55 | \item Kernel-level virtualization: Apart from some standard security |
||
56 | model (i.e. unix-like or any other) the OS might support |
||
57 | kernel-level context separation allowing to run more virtual |
||
58 | operating environments on a single physical machine. |
||
156 | palkovsky | 59 | |
60 | {\em Kernel-level virtualization was not attempted, although the microkernel |
||
61 | design by itself allows completely different namespace simply by connecting |
||
62 | the task to different name service daemon. Because new IPC connections can |
||
63 | be created only through existing paths in the graph of the connections, |
||
64 | messages can never flow between unconnected components of the graph. |
||
65 | } |
||
155 | decky | 66 | \item Framework for running GNU/Linux applications: There should be no |
67 | syscall or native API compatibility, but rather some kind of |
||
68 | compile-time layer (libc and other shared libraries) allowing to |
||
69 | compile common GNU/Linux applications from sources. |
||
156 | palkovsky | 70 | |
71 | {\em Two applications were ported with little effort - libpci and tetris. The |
||
72 | porting of the tetris consisted mainly in rewriting termios dependent |
||
73 | code. The libc library contains emulation layer for the most common functions.} |
||
74 | |||
155 | decky | 75 | \item Object/message paradigm: In the contrary to Unix file paradigm |
76 | (where every object in the system is represented by a file - even |
||
77 | if there is no consistent mapping from the given object's methods |
||
78 | to generic file methods), HelenOS might have a tree of objects |
||
79 | instead of a tree of files. Each object in the tree can support an |
||
80 | arbitrary set of messages and files are those objects which |
||
81 | support the set of messages representing file methods (i.e. open, |
||
82 | close, read, write, seek, etc.). All objects might support several |
||
83 | compulsory messages (GetName, GetSupportedMessages, etc.). The |
||
84 | message passing mechanism will be synchronous. |
||
156 | palkovsky | 85 | |
86 | {\em Every IPC message contains a field that specifies method number. However, |
||
87 | tree of objects or any more complex functionality were not implemented. } |
||
155 | decky | 88 | \end{itemize} |
156 | palkovsky | 89 | {\em However, because we have decided to use asynchronous message passing, |
90 | a framework was needed to facilitate reasonably synchronous application view. |
||
91 | This framework, heavily using userspace thread switching, allows writing |
||
92 | transparent applications without the hassle usually connected with |
||
93 | asynchronous applications, at the same time being easily portable to |
||
94 | kernel-threaded environment. } |
||
155 | decky | 95 | |
96 | \section{Particular features} |
||
97 | |||
98 | \begin{itemize} |
||
99 | \item Kernel features |
||
100 | \begin{itemize} |
||
101 | \item Preemptive multiprocessing, SMP support, threads (tasks) |
||
102 | \begin{itemize} |
||
103 | \item Simple scheduler (but more complex than round-robin), |
||
156 | palkovsky | 104 | with threads as basic scheduling element. {\em Achieved.} |
155 | decky | 105 | \item Support for thread priorities (possibly classes of |
156 | palkovsky | 106 | priorities for user-space tasks). {\em Achieved} |
107 | |||
108 | \item Support for SMP CPU bounding. {\em Achieved.} |
||
109 | \item Utilization of non-boot CPU(s). {\em Achieved.} |
||
155 | decky | 110 | \item Support for user-space threads (tasks as sets of |
156 | palkovsky | 111 | threads). {\em Achieved.} |
112 | |||
155 | decky | 113 | \item Support for kernel threads (independent code executed |
156 | palkovsky | 114 | within the kernel) {\em Achieved.} |
155 | decky | 115 | \end{itemize} |
116 | \item Kernel synchronization primitives, small granularity |
||
117 | synchronization (preemptive kernel) |
||
118 | \begin{itemize} |
||
119 | \item Semaphores, mutexes, condition variables, RW-locks, |
||
156 | palkovsky | 120 | spin-locks, etc. {\em Achieved.} |
121 | \item No "big kernel lock". {\em Achieved.} |
||
155 | decky | 122 | \end{itemize} |
156 | palkovsky | 123 | |
155 | decky | 124 | \item Physical and virtual memory management |
125 | \begin{itemize} |
||
156 | palkovsky | 126 | \item Proper handling of physical memory regions. {\em Achieved.} |
127 | |||
155 | decky | 128 | \item Physical memory heap (allocating of continuous blocks of |
156 | palkovsky | 129 | physical memory). {\em Achieved.} |
155 | decky | 130 | \item Arbitrary number of independent virtual memory mappings |
156 | palkovsky | 131 | (both for threads and internal kernel usage). {\em Achieved.} |
132 | \item Kernel allocator in virtual memory (buddy/slab). {\em Achieved.} |
||
155 | decky | 133 | \item Named (text, stack, heap) and unnamed virtual memory |
156 | palkovsky | 134 | areas. {\em Achieved.} |
155 | decky | 135 | \item Copying and sharing pages between different memory |
156 | palkovsky | 136 | mappings. {\em Achieved.} |
155 | decky | 137 | \end{itemize} |
138 | \item Basic hardware handling |
||
139 | \begin{itemize} |
||
140 | \item Handling of basic boot-time hardware (CPU, PCI buses, |
||
156 | palkovsky | 141 | memory, display, keyboard, RTC, etc.) in kernel. {\em Achieved.} |
155 | decky | 142 | \item Handling of specific hardware resources which are |
143 | fundamentaly unreachable from user-space on given |
||
156 | palkovsky | 144 | platform. {\em Achieved.} |
155 | decky | 145 | \end{itemize} |
146 | \item IPC, user-space hardware access framework |
||
147 | \begin{itemize} |
||
148 | \item Abstraction for implementing inter-process communication |
||
156 | palkovsky | 149 | (message passing, etc.). {\em Achieved.} |
155 | decky | 150 | \item Interface for enabling the user-space threads to gain |
151 | access and manage hardware resources (with kernel |
||
156 | palkovsky | 152 | modules where needed). {\em Achieved.} |
155 | decky | 153 | \end{itemize} |
154 | \item User-space features |
||
155 | \begin{itemize} |
||
156 | \item Basic API |
||
157 | \begin{itemize} |
||
158 | \item Memory management API (memory regions creation, |
||
156 | palkovsky | 159 | descruction, resizing). {\em Achieved.} |
160 | \item Task/thread management API. {\em Achieved.} |
||
161 | \item Synchronization API. {\em Futexes implemented.} |
||
155 | decky | 162 | \end{itemize} |
163 | \end{itemize} |
||
164 | \end{itemize} |
||
165 | \end{itemize} |
||
166 | |||
167 | \section{Implementation details} |
||
168 | |||
169 | \begin{itemize} |
||
170 | \item Supported platforms |
||
171 | \begin{itemize} |
||
172 | \item Real hardware support |
||
173 | \begin{itemize} |
||
174 | \item IA-32 (will be tested on multiple consumer Intel Pentium~4, |
||
156 | palkovsky | 175 | Intel Pentium~M, AMD Athlon~XP and AMD Athlon~MP machines) |
176 | |||
177 | {\em Runs on comodity hardware. Tested on several multiprocessor computers.} |
||
155 | decky | 178 | \item PowerPC (will be tested on a consumer IBM PowerPC G5 machine) |
156 | palkovsky | 179 | {\em To some extent runs on the G4 machine. G5 machine is a 64-bit architecture completely different from 32-bit port that was attampted. } |
155 | decky | 180 | \end{itemize} |
181 | \item Emulated support |
||
182 | \begin{itemize} |
||
183 | \item MIPS (will be tested in MSIM R4000 simulator) |
||
156 | palkovsky | 184 | {\em Tested in msim, gxemul and partially in simics simulators. Booted kernel on SGI Indy, however no real hardware input/output support was attempted.} |
155 | decky | 185 | \item IA-64 (will be tested in Ski simulator) |
156 | palkovsky | 186 | {\em Tested in Ski simulator.} |
155 | decky | 187 | \item AMD64 (will be tested in Simics simulator) |
156 | palkovsky | 188 | {\em Tested on single-processor computer. Runs in simics, bochs and qemu simulators.} |
155 | decky | 189 | \end{itemize} |
190 | \end{itemize} |
||
191 | \end{itemize} |