Rev 37 | Rev 39 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 37 | Rev 38 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | </mediaobject> |
16 | </mediaobject> |
| 17 | </para> |
17 | </para> |
| 18 | </section> |
18 | </section> |
| 19 | 19 | ||
| 20 | <section> |
20 | <section> |
| - | 21 | <title>Kernel primitives</title> |
|
| - | 22 | <para> |
|
| - | 23 | <termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef> |
|
| - | 24 | </para> |
|
| - | 25 | ||
| - | 26 | <para> |
|
| - | 27 | <termdef><glossterm>Thread context</glossterm> represents state of the <emphasis>thread</emphasis>. |
|
| - | 28 | Thread context is built of the context registers contents, FPU state and the stack.</termdef> |
|
| - | 29 | </para> |
|
| - | 30 | ||
| - | 31 | <para> |
|
| - | 32 | <termdef> |
|
| - | 33 | <glossterm>Task</glossterm> is a multi-purpose entity, serving to |
|
| - | 34 | <itemizedlist> |
|
| - | 35 | <listitem>incorporate set if its threads</listitem> |
|
| - | 36 | <listitem>provide common address space to its threads</listitem> |
|
| - | 37 | <listitem>be an end-point in IPC</listitem> |
|
| - | 38 | </itemizedlist> |
|
| - | 39 | ||
| - | 40 | </termdef> |
|
| - | 41 | </para> |
|
| - | 42 | ||
| - | 43 | <para> |
|
| - | 44 | <termdef> |
|
| - | 45 | <glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data. |
|
| - | 46 | </termdef> |
|
| - | 47 | </para> |
|
| - | 48 | ||
| - | 49 | <para> |
|
| - | 50 | <termdef> |
|
| - | 51 | <glossterm>Address space</glossterm> is a aggregating entity for address space areas, connecting them to the task. |
|
| - | 52 | </termdef> |
|
| - | 53 | </para> |
|
| - | 54 | </section> |
|
| - | 55 | ||
| - | 56 | <section> |
|
| 21 | <title>Monolithic microkernel</title> |
57 | <title>Monolithic microkernel</title> |
| 22 | <para> |
58 | <para> |
| 23 | Though HelenOS was initially planned as a microkernel, we where trying to avoid several issues, connected |
59 | Though HelenOS was initially planned as a microkernel, we were trying to avoid several issues, connected |
| 24 | with microkernels, such as much higher overhead during memory management and hardware operations. For this reason |
60 | with microkernels, such as much higher overhead during memory management and hardware operations. For this reason |
| 25 | some of the subsytems, that are to be implmented as servers in classic microkernel design, where implemented |
61 | some of the subsystems, that are to be implemented as servers in classic microkernel design, were implemented |
| 26 | as a part of kernel, thus minimizing this overhead. |
62 | as a part of kernel, thus minimizing this overhead. |
| 27 | </para> |
63 | </para> |
| 28 | 64 | ||
| 29 | <formalpara> |
65 | <formalpara> |
| 30 | <title>Memory management</title> |
66 | <title>Memory management</title> |
| Line 52... | Line 88... | ||
| 52 | </formalpara> |
88 | </formalpara> |
| 53 | 89 | ||
| 54 | </section> |
90 | </section> |
| 55 | 91 | ||
| 56 | <section> |
92 | <section> |
| 57 | <title>Kernel primitives</title> |
- | |
| 58 | <para> |
- | |
| 59 | <termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef> |
- | |
| 60 | </para> |
- | |
| 61 | - | ||
| 62 | <para> |
- | |
| 63 | <termdef><glossterm>Thread context</glossterm> represents state of the <emphasis>thread</emphasis>. Contains registers state, FPU state, stack(s).</termdef> |
- | |
| 64 | </para> |
- | |
| 65 | - | ||
| 66 | <para> |
- | |
| 67 | <termdef><glossterm>Task</glossterm> </termdef> |
- | |
| 68 | </para> |
- | |
| 69 | - | ||
| 70 | - | ||
| 71 | <para> |
- | |
| 72 | <termdef> |
- | |
| 73 | <glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data. |
- | |
| 74 | </termdef> |
- | |
| 75 | </para> |
- | |
| 76 | - | ||
| 77 | <para> |
- | |
| 78 | <termdef> |
- | |
| 79 | <glossterm>Address space</glossterm> is a aggregating entity for address space areas, connecting them to the task. |
- | |
| 80 | </termdef> |
- | |
| 81 | </para> 1 |
- | |
| 82 | </section> |
- | |
| 83 | - | ||
| 84 | - | ||
| 85 | - | ||
| 86 | <section> |
- | |
| 87 | <title>IPC</title> |
93 | <title>IPC</title> |
| 88 | 94 | ||
| 89 | <para> |
- | |
| 90 | Due to the high intertask communication traffic, IPC becomes critical subsystem for microkernels, putting high demands on the |
- | |
| 91 | speed, latency and reliability of IPC model and implementation. HelenOS IPC is designed in analogy with telephone communication. |
95 | <para>HelenOS IPC is designed in analogy with telephone communication. |
| 92 | Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes. Communication |
96 | Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes. |
| - | 97 | </para> |
|
| - | 98 | |
|
| - | 99 | <para>Communication |
|
| 93 | is possible after the link establishment, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>. |
100 | is possible after the connection is established, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>. |
| 94 | </para> |
101 | </para> |
| 95 | 102 | |
|
| 96 | </section> |
103 | </section> |
| 97 | 104 | ||
| 98 | - | ||
| 99 | <section> |
105 | <section> |
| 100 | <para>Task ID - unique 64 bit number. Used for syscalls.</para> |
- | |
| 101 | <para>Contains threads</para> |
106 | <title>Functionality model</title> |
| 102 | <para>Address space is created per task</para> |
- | |
| 103 | <para>Memory mapping is per task</para> |
- | |
| 104 | <para>Context per thread. (Note 2 stacks on IA64).</para> |
- | |
| 105 | <para>IPC answer box associated per task</para> |
- | |
| 106 | 107 | ||
| 107 | - | ||
| 108 | <title>Memory management</title> |
- | |
| 109 | <para> |
108 | <para> |
| 110 | Zones - linked list (not many zones, so we can afford it. Can be replaced with B-tree in the future) |
109 | As you know, microkernel design is very simple, just enough to provide communication facility for tasks. Most of the OS functionality |
| - | 110 | is performed by server tasks, that are running in userspace. |
|
| 111 | Number of zones depends on HW tables. Describe zone allocation/deallocation algoritm |
111 | Thus most of the system calls in monolithic kernels, are the IPC calls on server tasks in microkernels. |
| 112 | </para> |
112 | </para> |
| 113 | <para>Page tables. 4 level hierarchical and hash directly supported. B+ Tree can be implemented.</para> |
- | |
| 114 | <para>For paging there is an abstract layer</para> |
- | |
| 115 | <para>TLB shootdown implementation (update TLB upon mapping update/remove). |
- | |
| 116 | TLB shootdown ASID/ASID:PAGE/ALL. |
- | |
| 117 | TLB shootdown requests can come in asynchroniously |
- | |
| 118 | so there is a cache of TLB shootdown requests. Upon cache overflow TLB shootdown ALL is executed</para> |
- | |
| 119 | |
113 | |
| 120 | <para> |
114 | <para> |
| 121 | Address spaces. Address space area (B+ tree). Only for uspace. Set of syscalls (shrink/extend etc). |
115 | Moreover, problems experience the device drivers. Running in the user space, device driver still needs to recieve interrupts |
| 122 | Special address space area type - device - prohibits shrink/extend syscalls to call on it. |
116 | and access hardware directly. |
| 123 | Address space has link to mapping tables (hierarchical - per Address space, hash - global tables). |
- | |
| 124 | </para> |
117 | </para> |
| - | 118 | |
|
| - | 119 | <para> |
|
| - | 120 | This raises two major problems in microkernels: |
|
| - | 121 | |
|
| - | 122 | <orderedlist numeration="loweralpha"> |
|
| - | 123 | <listitem>What is the recipient address of the server (e.g. "memory manager" or a specific device driver) ?</listitem> |
|
| - | 124 | <listitem>How this server task is going to access hardware or kernel while running in the user mode?</listitem> |
|
| - | 125 | </orderedlist> |
|
| - | 126 | |
|
| - | 127 | </para> |
|
| - | 128 | |
|
| - | 129 | |
|
| - | 130 | <formalpara id="intro_ns"> |
|
| - | 131 | <title>Name server</title> |
|
| - | 132 | <para>As every microkernel, HelenOS has a "Name server" task with "well known" IPC address, that connects user task to any server |
|
| - | 133 | just by the string service indentification.</para> |
|
| - | 134 | </formalpara> |
|
| - | 135 | |
|
| - | 136 | |
|
| - | 137 | <formalpara id="intro_ddi"> |
|
| - | 138 | <title>Device driver interface</title> |
|
| - | 139 | <para>Device drivers use special syscalls to map physical memory areas into their address space, to map port regions (mostly ia32). |
|
| - | 140 | Interrupts are delivered to the device driver task by the standard IPC means. |
|
| - | 141 | </para> |
|
| - | 142 | </formalpara> |
|
| - | 143 | |
|
| 125 | </section> |
144 | </section> |
| - | 145 | ||
| - | 146 | |
|
| - | 147 | |
|
| - | 148 | ||
| 126 | </chapter> |
149 | </chapter> |
| 127 | 150 | ||