Subversion Repositories HelenOS-doc

Rev

Rev 37 | Rev 39 | Go to most recent revision | Show entire file | Regard 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>
93
        <title>IPC</title>
58
        <para>
94
 
59
        <termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef>
95
        <para>HelenOS IPC is designed in analogy with telephone communication.
-
 
96
            Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes.
60
        </para>
97
        </para>
61
 
98
       
62
        <para>
99
        <para>Communication
63
        <termdef><glossterm>Thread context</glossterm> represents state of the <emphasis>thread</emphasis>. Contains registers state, FPU state, stack(s).</termdef>
100
            is possible after the connection is established, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>.
64
        </para>
101
         </para>
65
 
102
         
-
 
103
    </section>
-
 
104
 
-
 
105
    <section>
-
 
106
        <title>Functionality model</title>
-
 
107
 
66
        <para>
108
        <para>
-
 
109
        As you know, microkernel design is very simple, just enough to provide communication facility for tasks. Most of the OS functionality
67
        <termdef><glossterm>Task</glossterm> </termdef>
110
        is performed by server tasks, that are running in userspace.
-
 
111
        Thus most of the system calls in monolithic kernels, are the IPC calls on server tasks in microkernels.
68
        </para>
112
        </para>
69
 
113
       
70
           
-
 
71
        <para>
114
        <para>
72
        <termdef>
-
 
73
            <glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data.
115
        Moreover, problems experience the device drivers. Running in the user space, device driver still needs to recieve interrupts
74
        </termdef>
116
        and access hardware directly.
75
        </para>
117
        </para>
76
 
118
       
77
        <para>
119
        <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
120
        This raises two major problems in microkernels:
82
    </section>
-
 
83
 
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>
84
 
126
           
-
 
127
        </para>
85
 
128
           
86
    <section>
-
 
87
        <title>IPC</title>
-
 
88
 
129
       
89
        <para>
130
        <formalpara id="intro_ns">
-
 
131
        <title>Name server</title>
90
            Due to the high intertask communication traffic, IPC becomes critical subsystem for microkernels, putting high demands on the
132
        <para>As every microkernel, HelenOS has a "Name server" task with "well known" IPC address, that connects user task to any server
91
            speed, latency and reliability of IPC model and implementation. HelenOS IPC is designed in analogy with telephone communication.
133
        just by the string service indentification.</para>
-
 
134
        </formalpara>
-
 
135
       
-
 
136
       
-
 
137
        <formalpara id="intro_ddi">
-
 
138
        <title>Device driver interface</title>
92
            Each task has an <emphasis>answerbox</emphasis> and a set of <emphasis>phones</emphasis> to call another tasks' answerboxes. Communication
139
        <para>Device drivers use special syscalls to map physical memory areas into their address space, to map port regions (mostly ia32).
93
            is possible after the link establishment, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>.
140
        Interrupts are delivered to the device driver task by the standard IPC means.
94
         </para>
141
        </para>
-
 
142
        </formalpara>
95
 
143
       
96
    </section>
144
    </section>
97
 
145
 
98
 
146
   
99
    <section>
-
 
100
        <para>Task ID - unique 64 bit number. Used for syscalls.</para>
-
 
101
        <para>Contains threads</para>
-
 
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
 
147
   
108
        <title>Memory management</title>
-
 
109
        <para>
-
 
110
        Zones - linked list (not many zones, so we can afford it. Can be replaced with B-tree in the future)
-
 
111
        Number of zones depends on HW tables. Describe zone allocation/deallocation algoritm
-
 
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
       
148
 
120
        <para>
-
 
121
            Address spaces. Address space area (B+ tree). Only for uspace. Set of syscalls (shrink/extend etc).
-
 
122
            Special address space area type - device - prohibits shrink/extend syscalls to call on it.
-
 
123
            Address space has link to mapping tables (hierarchical - per Address space, hash - global tables).
-
 
124
        </para>
-
 
125
    </section>
-
 
126
</chapter>
149
</chapter>
127
 
150