Rev 39 | Rev 45 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 39 | Rev 40 | ||
---|---|---|---|
1 | <?xml version="1.0" encoding="UTF-8"?> |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <chapter id="architecture"> |
2 | <chapter id="architecture"> |
3 | <?dbhtml filename="arch.html"?> |
3 | <?dbhtml filename="arch.html"?> |
4 | 4 | ||
5 | <title>Architecture overview</title> |
5 | <title>Architecture overview</title> |
6 | 6 | ||
7 | <section> |
7 | <section> |
8 | <title>Scheme</title> |
8 | <title>Scheme</title> |
9 | 9 | ||
10 | <para><mediaobject id="arch1"> |
10 | <para><mediaobject id="arch1"> |
11 | <imageobject role="html"> |
11 | <imageobject role="html"> |
12 | <imagedata fileref="images/arch1.png" format="PNG" /> |
12 | <imagedata fileref="images/arch1.png" format="PNG" /> |
13 | </imageobject> |
13 | </imageobject> |
14 | 14 | ||
15 | <imageobject role="fop"> |
15 | <imageobject role="fop"> |
16 | <imagedata fileref="images.vector/arch1.svg" format="SVG" /> |
16 | <imagedata fileref="images.vector/arch1.svg" format="SVG" /> |
17 | </imageobject> |
17 | </imageobject> |
18 | </mediaobject></para> |
18 | </mediaobject></para> |
19 | </section> |
19 | </section> |
20 | 20 | ||
21 | <section> |
21 | <section> |
22 | <title>Kernel primitives</title> |
22 | <title>Kernel primitives</title> |
23 | 23 | ||
24 | <para><termdef><glossterm>Thread</glossterm> is the basic execution |
24 | <para><termdef><glossterm>Thread</glossterm> is the basic execution |
25 | primitive.</termdef></para> |
25 | primitive.</termdef></para> |
26 | 26 | ||
27 | <para><termdef><glossterm>Thread context</glossterm> represents state of |
27 | <para><termdef><glossterm>Thread context</glossterm> represents state of |
28 | the <emphasis>thread</emphasis>. Thread context is built of the context |
28 | the <emphasis>thread</emphasis>. Thread context is built of the context |
29 | registers contents, FPU state and the stack.</termdef></para> |
29 | registers contents, FPU state and the stack.</termdef></para> |
30 | 30 | ||
31 | <para><termdef> <glossterm>Task</glossterm> is a multi-purpose entity, |
31 | <para><termdef><glossterm>Task</glossterm> is a multi-purpose entity, |
32 | serving to <itemizedlist> |
32 | serving to incorporate set if its threads, provide common address space to its threads, |
33 | <listitem>incorporate set if its threads</listitem> |
33 | be an end-point in IPC.</termdef></para> |
34 | 34 | ||
35 | <listitem>provide common address space to its threads</listitem> |
- | |
36 | - | ||
37 | <listitem>be an end-point in IPC</listitem> |
- | |
38 | </itemizedlist> </termdef></para> |
- | |
39 | - | ||
40 | <para><termdef> <glossterm>Address space area</glossterm> is a mutually |
35 | <para><termdef><glossterm>Address space area</glossterm> is a mutually |
41 | disjunctive range of memory with the code, stack and data. |
36 | disjunctive range of memory with the code, stack and data. |
42 | </termdef></para> |
37 | </termdef></para> |
43 | 38 | ||
44 | <para><termdef> <glossterm>Address space</glossterm> is a aggregating |
39 | <para><termdef><glossterm>Address space</glossterm> is a aggregating |
45 | entity for address space areas, connecting them to the task. |
40 | entity for address space areas, connecting them to the task. |
46 | </termdef></para> |
41 | </termdef></para> |
47 | </section> |
42 | </section> |
48 | 43 | ||
49 | <section> |
44 | <section> |
50 | <title>Monolithic microkernel</title> |
45 | <title>Monolithic microkernel</title> |
51 | 46 | ||
52 | <para>Though HelenOS was initially planned as a microkernel, we were |
47 | <para>Though HelenOS was initially planned as a microkernel, we were |
53 | trying to avoid several issues, connected with microkernels, such as much |
48 | trying to avoid several issues, connected with microkernels, such as much |
54 | higher overhead during memory management and hardware operations. For this |
49 | higher overhead during memory management and hardware operations. For this |
55 | reason some of the subsystems, that are to be implemented as servers in |
50 | reason some of the subsystems, that are to be implemented as servers in |
56 | classic microkernel design, were implemented as a part of kernel, thus |
51 | classic microkernel design, were implemented as a part of kernel, thus |
57 | minimizing this overhead.</para> |
52 | minimizing this overhead.</para> |
58 | 53 | ||
59 | <formalpara> |
54 | <formalpara> |
60 | <title>Memory management</title> |
55 | <title>Memory management</title> |
61 | 56 | ||
62 | <para>Unlike the classic microkernel, HelenOS has all its memory |
57 | <para>HelenOS has all its memory |
63 | management functionality in the kernel, available to the memory |
58 | management functionality in the kernel, available to the memory |
64 | management server via the set of syscalls.</para> |
59 | management server via the set of syscalls.</para> |
65 | </formalpara> |
60 | </formalpara> |
66 | 61 | ||
67 | <formalpara> |
62 | <formalpara> |
68 | <title>Kernel device drivers</title> |
63 | <title>Kernel device drivers</title> |
69 | 64 | ||
70 | <para>HelenOS kernel has some of the very basic device drivers |
65 | <para>HelenOS kernel has some of the very basic device drivers |
71 | <itemizedlist> |
66 | <itemizedlist> |
72 | <listitem> |
67 | <listitem> |
73 | ACPI |
68 | ACPI |
74 | </listitem> |
69 | </listitem> |
75 | 70 | ||
76 | <listitem> |
71 | <listitem> |
77 | APIC |
72 | APIC |
78 | </listitem> |
73 | </listitem> |
79 | 74 | ||
80 | <listitem> |
75 | <listitem> |
81 | SMP configuration |
76 | SMP configuration |
82 | </listitem> |
77 | </listitem> |
83 | 78 | ||
84 | <listitem> |
79 | <listitem> |
85 | System clock |
80 | System clock |
86 | </listitem> |
81 | </listitem> |
87 | 82 | ||
88 | <listitem> |
83 | <listitem> |
89 | Interrupt controllers |
84 | Interrupt controllers |
90 | </listitem> |
85 | </listitem> |
91 | 86 | ||
92 | <listitem> |
87 | <listitem> |
93 | Console |
88 | Console and frame buffer |
94 | </listitem> |
89 | </listitem> |
95 | 90 | ||
96 | <listitem> |
- | |
97 | VESA & frame buffer |
- | |
98 | </listitem> |
- | |
99 | </itemizedlist></para> |
91 | </itemizedlist></para> |
100 | </formalpara> |
92 | </formalpara> |
101 | </section> |
93 | </section> |
102 | 94 | ||
103 | <section> |
95 | <section> |
104 | <title>IPC</title> |
96 | <title>IPC</title> |
105 | 97 | ||
106 | <para>HelenOS IPC is designed in analogy with telephone communication. |
98 | <para>HelenOS IPC is designed in analogy with telephone communication. |
107 | Each task has an <emphasis>answerbox</emphasis> and a set of |
99 | Each task has an <emphasis>answerbox</emphasis> and a set of |
108 | <emphasis>phones</emphasis> to call another tasks' answerboxes.</para> |
100 | <emphasis>phones</emphasis> to call another tasks' answerboxes.</para> |
109 | 101 | ||
110 | <para>Communication is possible after the connection is established, and |
102 | <para>Communication is possible after the connection is established, and |
111 | can be either <emphasis>asynchronious</emphasis> or |
103 | can be either <emphasis>asynchronious</emphasis> or |
112 | <emphasis>synchronious</emphasis>.</para> |
104 | <emphasis>synchronious</emphasis>.</para> |
113 | </section> |
105 | </section> |
114 | 106 | ||
115 | <section> |
107 | <section> |
116 | <title>Functionality model</title> |
108 | <title>Functionality model</title> |
117 | 109 | ||
118 | <para>As you know, microkernel design is very simple, just enough to |
110 | <para>As you know, microkernel design is very simple, just enough to |
119 | provide communication facility for tasks. Most of the OS functionality is |
111 | provide communication facility for tasks. Most of the OS functionality is |
120 | performed by server tasks, that are running in userspace. Thus most of the |
112 | performed by server tasks, that are running in userspace. Thus most of the |
121 | system calls in monolithic kernels, are the IPC calls on server tasks in |
113 | system calls in monolithic kernels, are the IPC calls on server tasks in |
122 | microkernels.</para> |
114 | microkernels.</para> |
123 | 115 | ||
124 | <para>Moreover, problems experience the device drivers. Running in the |
116 | <para>Moreover, problems experience the device drivers. Running in the |
125 | user space, device driver still needs to recieve interrupts and access |
117 | user space, device driver still needs to recieve interrupts and access |
126 | hardware directly.</para> |
118 | hardware directly.</para> |
127 | 119 | ||
128 | <para>This raises two major problems in microkernels: <orderedlist |
120 | <para>This raises two major problems in microkernels: <orderedlist |
129 | numeration="loweralpha"> |
121 | numeration="loweralpha"> |
130 | <listitem> |
122 | <listitem> |
131 | What is the recipient address of the server (e.g. "memory manager" or a specific device driver) ? |
123 | What is the recipient address of the server (e.g. "memory manager" or a specific device driver) ? |
132 | </listitem> |
124 | </listitem> |
133 | 125 | ||
134 | <listitem> |
126 | <listitem> |
135 | How this server task is going to access hardware or kernel while running in the user mode? |
127 | How this server task is going to access hardware or kernel while running in the user mode? |
136 | </listitem> |
128 | </listitem> |
137 | </orderedlist></para> |
129 | </orderedlist></para> |
138 | 130 | ||
139 | <formalpara id="intro_ns"> |
131 | <formalpara id="intro_ns"> |
140 | <title>Name server</title> |
132 | <title>Name server</title> |
141 | 133 | ||
142 | <para>As every microkernel, HelenOS has a "Name server" task with "well |
134 | <para>As every microkernel, HelenOS has a "Name server" task with "well |
143 | known" IPC address, that connects user task to any server just by the |
135 | known" IPC address, that connects user task to any server just by the |
144 | string service indentification.</para> |
136 | string service indentification.</para> |
145 | </formalpara> |
137 | </formalpara> |
146 | 138 | ||
147 | <formalpara id="intro_ddi"> |
139 | <formalpara id="intro_ddi"> |
148 | <title>Device driver interface</title> |
140 | <title>Device driver interface</title> |
149 | 141 | ||
150 | <para>Device drivers use special syscalls to map physical memory areas |
142 | <para>Device drivers use special syscalls to map physical memory areas |
151 | into their address space, to map port regions (mostly ia32). Interrupts |
143 | into their address space, to map port regions (mostly ia32). Interrupts |
152 | are delivered to the device driver task by the standard IPC |
144 | are delivered to the device driver task by the standard IPC |
153 | means.</para> |
145 | means.</para> |
154 | </formalpara> |
146 | </formalpara> |
155 | </section> |
147 | </section> |
156 | </chapter> |
148 | </chapter> |