18,11 → 18,47 |
</section> |
|
<section> |
<title>Kernel primitives</title> |
<para> |
<termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef> |
</para> |
|
<para> |
<termdef><glossterm>Thread context</glossterm> represents state of the <emphasis>thread</emphasis>. |
Thread context is built of the context registers contents, FPU state and the stack.</termdef> |
</para> |
|
<para> |
<termdef> |
<glossterm>Task</glossterm> is a multi-purpose entity, serving to |
<itemizedlist> |
<listitem>incorporate set if its threads</listitem> |
<listitem>provide common address space to its threads</listitem> |
<listitem>be an end-point in IPC</listitem> |
</itemizedlist> |
|
</termdef> |
</para> |
|
<para> |
<termdef> |
<glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data. |
</termdef> |
</para> |
|
<para> |
<termdef> |
<glossterm>Address space</glossterm> is a aggregating entity for address space areas, connecting them to the task. |
</termdef> |
</para> |
</section> |
|
<section> |
<title>Monolithic microkernel</title> |
<para> |
Though HelenOS was initially planned as a microkernel, we where trying to avoid several issues, connected |
Though HelenOS was initially planned as a microkernel, we were trying to avoid several issues, connected |
with microkernels, such as much higher overhead during memory management and hardware operations. For this reason |
some of the subsytems, that are to be implmented as servers in classic microkernel design, where implemented |
some of the subsystems, that are to be implemented as servers in classic microkernel design, were implemented |
as a part of kernel, thus minimizing this overhead. |
</para> |
|
54,74 → 90,61 |
</section> |
|
<section> |
<title>Kernel primitives</title> |
<para> |
<termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef> |
<title>IPC</title> |
|
<para>HelenOS IPC is designed in analogy with telephone communication. |
Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes. |
</para> |
|
<para> |
<termdef><glossterm>Thread context</glossterm> represents state of the <emphasis>thread</emphasis>. Contains registers state, FPU state, stack(s).</termdef> |
<para>Communication |
is possible after the connection is established, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>. |
</para> |
|
</section> |
|
<section> |
<title>Functionality model</title> |
|
<para> |
<termdef><glossterm>Task</glossterm> </termdef> |
As you know, microkernel design is very simple, just enough to provide communication facility for tasks. Most of the OS functionality |
is performed by server tasks, that are running in userspace. |
Thus most of the system calls in monolithic kernels, are the IPC calls on server tasks in microkernels. |
</para> |
|
|
<para> |
<termdef> |
<glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data. |
</termdef> |
Moreover, problems experience the device drivers. Running in the user space, device driver still needs to recieve interrupts |
and access hardware directly. |
</para> |
|
<para> |
<termdef> |
<glossterm>Address space</glossterm> is a aggregating entity for address space areas, connecting them to the task. |
</termdef> |
</para> 1 |
</section> |
This raises two major problems in microkernels: |
|
<orderedlist numeration="loweralpha"> |
<listitem>What is the recipient address of the server (e.g. "memory manager" or a specific device driver) ?</listitem> |
<listitem>How this server task is going to access hardware or kernel while running in the user mode?</listitem> |
</orderedlist> |
|
</para> |
|
<section> |
<title>IPC</title> |
|
<para> |
Due to the high intertask communication traffic, IPC becomes critical subsystem for microkernels, putting high demands on the |
speed, latency and reliability of IPC model and implementation. HelenOS IPC is designed in analogy with telephone communication. |
Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes. Communication |
is possible after the link establishment, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>. |
<formalpara id="intro_ns"> |
<title>Name server</title> |
<para>As every microkernel, HelenOS has a "Name server" task with "well known" IPC address, that connects user task to any server |
just by the string service indentification.</para> |
</formalpara> |
|
|
<formalpara id="intro_ddi"> |
<title>Device driver interface</title> |
<para>Device drivers use special syscalls to map physical memory areas into their address space, to map port regions (mostly ia32). |
Interrupts are delivered to the device driver task by the standard IPC means. |
</para> |
</formalpara> |
|
</section> |
|
|
<section> |
<para>Task ID - unique 64 bit number. Used for syscalls.</para> |
<para>Contains threads</para> |
<para>Address space is created per task</para> |
<para>Memory mapping is per task</para> |
<para>Context per thread. (Note 2 stacks on IA64).</para> |
<para>IPC answer box associated per task</para> |
|
|
<title>Memory management</title> |
<para> |
Zones - linked list (not many zones, so we can afford it. Can be replaced with B-tree in the future) |
Number of zones depends on HW tables. Describe zone allocation/deallocation algoritm |
</para> |
<para>Page tables. 4 level hierarchical and hash directly supported. B+ Tree can be implemented.</para> |
<para>For paging there is an abstract layer</para> |
<para>TLB shootdown implementation (update TLB upon mapping update/remove). |
TLB shootdown ASID/ASID:PAGE/ALL. |
TLB shootdown requests can come in asynchroniously |
so there is a cache of TLB shootdown requests. Upon cache overflow TLB shootdown ALL is executed</para> |
|
<para> |
Address spaces. Address space area (B+ tree). Only for uspace. Set of syscalls (shrink/extend etc). |
Special address space area type - device - prohibits shrink/extend syscalls to call on it. |
Address space has link to mapping tables (hierarchical - per Address space, hash - global tables). |
</para> |
</section> |
</chapter> |
|