Subversion Repositories HelenOS-doc

Compare Revisions

Ignore whitespace Rev 38 → Rev 39

/design/trunk/src/images.vector/slab_alloc.svg
798,7 → 798,7
y="63.285717">...</tspan></text>
<g
id="g3709"
transform="translate(0,4)">
transform="translate(0,22)">
<g
transform="translate(9.948973,59.86735)"
id="g3110">
1250,347 → 1250,6
x="160.91342"
y="254.93602">?</tspan></text>
<g
id="g3797"
transform="translate(0,-2)">
<g
transform="translate(15,42.48479)"
id="g3185">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3126"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3128"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3130"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3132"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3134"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3136"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<text
sodipodi:linespacing="100%"
id="text3203"
y="154.75195"
x="79.301758"
style="font-size:6px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="154.75195"
x="79.301758"
id="tspan3205"
sodipodi:role="line">Empty</tspan><tspan
id="tspan3207"
y="160.75195"
x="79.301758"
sodipodi:role="line">Magazines</tspan></text>
<g
transform="translate(40,42.48479)"
id="g3209">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3211"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3213"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3215"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3217"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3219"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3221"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<g
transform="translate(65,42.48479)"
id="g3223">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3225"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3227"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3229"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3231"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3233"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3235"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<g
transform="translate(90,42.48479)"
id="g3237">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3239"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3241"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3243"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3245"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3247"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3249"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<g
transform="translate(115,42.48479)"
id="g3251">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3253"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3255"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3257"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3259"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3261"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3263"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<g
transform="translate(140,42.48479)"
id="g3265">
<rect
style="fill:#bc4343;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3267"
width="15.904104"
height="5.1382489"
x="95.173271"
y="101.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3269"
width="15.904104"
height="5.1382489"
x="95.173271"
y="106.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3271"
width="15.904104"
height="5.1382489"
x="95.173271"
y="111.68848" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.34653935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3273"
width="15.904104"
height="5.1382489"
x="95.173271"
y="116.17327" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3275"
width="15.904104"
height="5.0968471"
x="95.172569"
y="121.17257" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.3451404;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect3277"
width="15.904104"
height="5.0968471"
x="95.172569"
y="125.73058" />
</g>
<g
transform="translate(0,4)"
id="g3784">
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.26610187;stroke-linecap:square;stroke-linejoin:miter;marker-start:none;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 151.60329,140.18072 C 157.89034,140.18072 157.89034,140.18072 157.89034,140.18072"
id="path3461" />
<path
id="path3463"
d="M 176.60329,140.18072 C 182.89034,140.18072 182.89034,140.18072 182.89034,140.18072"
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.26610187;stroke-linecap:square;stroke-linejoin:miter;marker-start:none;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.26610187;stroke-linecap:square;stroke-linejoin:miter;marker-start:none;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 226.60329,140.18072 C 232.89034,140.18072 232.89034,140.18072 232.89034,140.18072"
id="path3465" />
<path
id="path3467"
d="M 201.60329,140.18072 C 207.89034,140.18072 207.89034,140.18072 207.89034,140.18072"
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.26610187;stroke-linecap:square;stroke-linejoin:miter;marker-start:none;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="g3594">
<path
id="path3469"
d="M 251.19541,140 C 271.61709,140 271.61709,140 271.61709,140 L 271.61709,145 L 271.61709,145 L 271.61709,145 L 271.61709,145 L 271.61709,145"
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.28625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<g
id="g3589">
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 265,145 C 279,145 279,145 279,145"
id="path3471" />
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 268,148 C 276,148 276,148 276,148"
id="path3473" />
<path
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 270.5,150.91161 C 273.5,150.91161 273.5,150.91161 273.5,150.91161"
id="path3475" />
</g>
</g>
<path
id="path3683"
d="M 126.60329,140.18072 C 132.89034,140.18072 132.89034,140.18072 132.89034,140.18072"
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.26610187;stroke-linecap:square;stroke-linejoin:miter;marker-start:none;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
id="g3687">
<path
id="path3279"
/design/trunk/src/ch_arch_overview.xml
1,150 → 1,156
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="architecture">
<?dbhtml filename="arch.html"?>
 
<chapter id="architecture"><?dbhtml filename="arch.html"?>
<title>Architecture overview</title>
<section>
<title>Scheme</title>
<para>
<mediaobject id="arch1">
<imageobject role="html">
<imagedata format="PNG" fileref="images/arch1.png"/>
</imageobject>
<imageobject role="fop">
<imagedata format="SVG" fileref="images.vector/arch1.svg" />
</imageobject>
</mediaobject>
</para>
</section>
<title>Architecture overview</title>
 
<section>
<title>Kernel primitives</title>
<para>
<termdef><glossterm>Thread</glossterm> is the basic execution primitive.</termdef>
</para>
<section>
<title>Scheme</title>
 
<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><mediaobject id="arch1">
<imageobject role="html">
<imagedata fileref="images/arch1.png" format="PNG" />
</imageobject>
 
<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>
<imageobject role="fop">
<imagedata fileref="images.vector/arch1.svg" format="SVG" />
</imageobject>
</mediaobject></para>
</section>
 
</termdef>
</para>
<para>
<termdef>
<glossterm>Address space area</glossterm> is a mutually disjunctive range of memory with the code, stack and data.
</termdef>
</para>
<section>
<title>Kernel primitives</title>
 
<para>
<termdef>
<glossterm>Address space</glossterm> is a aggregating entity for address space areas, connecting them to the task.
</termdef>
</para>
</section>
<para><termdef><glossterm>Thread</glossterm> is the basic execution
primitive.</termdef></para>
 
<section>
<title>Monolithic microkernel</title>
<para>
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 subsystems, that are to be implemented as servers in classic microkernel design, were implemented
as a part of kernel, thus minimizing this overhead.
</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>
 
<formalpara>
<title>Memory management</title>
<para>
Unlike the classic microkernel, HelenOS has all its memory management functionality in the kernel, available to the memory
management server via the set of syscalls.
</para>
</formalpara>
<para><termdef> <glossterm>Task</glossterm> is a multi-purpose entity,
serving to <itemizedlist>
<listitem>incorporate set if its threads</listitem>
 
<formalpara>
<title>Kernel device drivers</title>
<para>
HelenOS kernel has some of the very basic device drivers
<itemizedlist>
<listitem>ACPI</listitem>
<listitem>APIC</listitem>
<listitem>SMP configuration</listitem>
<listitem>System clock</listitem>
<listitem>Interrupt controllers</listitem>
<listitem>Console</listitem>
<listitem>VESA &amp; frame buffer</listitem>
</itemizedlist>
<listitem>provide common address space to its threads</listitem>
 
</para>
</formalpara>
<listitem>be an end-point in IPC</listitem>
</itemizedlist> </termdef></para>
 
</section>
<para><termdef> <glossterm>Address space area</glossterm> is a mutually
disjunctive range of memory with the code, stack and data.
</termdef></para>
 
<section>
<title>IPC</title>
<para><termdef> <glossterm>Address space</glossterm> is a aggregating
entity for address space areas, connecting them to the task.
</termdef></para>
</section>
 
<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>Communication
is possible after the connection is established, and can be either <emphasis>asynchronious</emphasis> or <emphasis>synchronious</emphasis>.
</para>
</section>
<section>
<title>Monolithic microkernel</title>
 
<section>
<title>Functionality model</title>
<para>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 subsystems, that are to be implemented as servers in
classic microkernel design, were implemented as a part of kernel, thus
minimizing this overhead.</para>
 
<para>
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>
Moreover, problems experience the device drivers. Running in the user space, device driver still needs to recieve interrupts
and access hardware directly.
</para>
<para>
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>
<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>
<formalpara>
<title>Memory management</title>
 
<para>Unlike the classic microkernel, HelenOS has all its memory
management functionality in the kernel, available to the memory
management server via the set of syscalls.</para>
</formalpara>
 
</chapter>
<formalpara>
<title>Kernel device drivers</title>
 
<para>HelenOS kernel has some of the very basic device drivers
<itemizedlist>
<listitem>
ACPI
</listitem>
 
<listitem>
APIC
</listitem>
 
<listitem>
SMP configuration
</listitem>
 
<listitem>
System clock
</listitem>
 
<listitem>
Interrupt controllers
</listitem>
 
<listitem>
Console
</listitem>
 
<listitem>
VESA &amp; frame buffer
</listitem>
</itemizedlist></para>
</formalpara>
</section>
 
<section>
<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>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>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>Moreover, problems experience the device drivers. Running in the
user space, device driver still needs to recieve interrupts and access
hardware directly.</para>
 
<para>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>
 
<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>
</chapter>
/design/trunk/src/ch_memory_management.xml
24,10 → 24,9
Allowing, in general, to load and execute two programs that are linked on the same address without complicated relocations.
</listitem>
</itemizedlist></para>
<para><!--
 
<para><!--
 
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
43,23 → 42,19
</section>
 
<section>
 
<title>Paging</title>
 
<para>Virtual memory is usually using paged memory model, where virtual
memory address space is divided into the <emphasis>pages</emphasis>
(usually having size 4096 bytes) and physical memory is divided into the
frames (same sized as a page, of course). Each page may be mapped to some
frame and then, upon memory access to the virtual address, CPU performs
<emphasis>address translation</emphasis> during the instruction
frames (same sized as a page, of course). Each page may be mapped to
some frame and then, upon memory access to the virtual address, CPU
performs <emphasis>address translation</emphasis> during the instruction
execution. Non-existing mapping generates page fault exception, calling
kernel exception handler, thus allowing kernel to manipulate rules of
memory access. Information for pages mapping is stored by kernel in the
<link linkend="page_tables">page tables</link></para>
 
 
<para>The majority of the architectures use multi-level page tables,
which means need to access physical memory several times before getting
physical address. This fact would make serios performance overhead in
66,11 → 61,11
virtual memory management. To avoid this <link linkend="tlb">Traslation
Lookaside Buffer (TLB)</link> is used.</para>
 
 
<para>At the moment HelenOS does not support swapping.</para>
 
<para>- pouzivame vypadky stranky k alokaci ramcu on-demand v ramci as_area - na architekturach, ktere to podporuji, podporujeme non-exec stranky </para>
<para>- pouzivame vypadky stranky k alokaci ramcu on-demand v ramci
as_area - na architekturach, ktere to podporuji, podporujeme non-exec
stranky</para>
</section>
 
<section>
79,15 → 74,11
<section>
<title>Address spaces and areas</title>
 
<para>
 
- adresovy prostor se sklada z tzv. address space areas
<para>- adresovy prostor se sklada z tzv. address space areas
usporadanych v B+stromu; tyto areas popisuji vyuzivane casti
adresoveho prostoru patrici do user address space. Kazda cast je dana
svoji bazovou adresou, velikosti a flagy (rwx/dd).
svoji bazovou adresou, velikosti a flagy (rwx/dd).</para>
 
</para>
 
<para>- uzivatelske thready maji moznost manipulovat se svym adresovym
prostorem (vytvaret/resizovat/sdilet) as_areas pomoci syscallu</para>
</section>
116,9 → 107,6
a neni ani nijak osetrena. Tim padem plati, ze kazdy task ma vlastni
adresovy prostor</para>
</section>
</section>
 
<section>
221,6 → 209,16
<section id="frame_allocator">
<title>Frame allocator</title>
 
<para><mediaobject id="frame_alloc">
<imageobject role="html">
<imagedata fileref="images/frame_alloc.png" format="PNG" />
</imageobject>
 
<imageobject role="fop">
<imagedata fileref="images.vector/frame_alloc.svg" format="SVG" />
</imageobject>
</mediaobject></para>
 
<formalpara>
<title>Overview</title>
 
262,6 → 260,16
<section>
<title>Overview</title>
 
<para><mediaobject id="buddy_alloc">
<imageobject role="html">
<imagedata fileref="images/buddy_alloc.png" format="PNG" />
</imageobject>
 
<imageobject role="fop">
<imagedata fileref="images.vector/buddy_alloc.svg" format="SVG" />
</imageobject>
</mediaobject></para>
 
<para>In buddy allocator, memory is broken down into power-of-two
sized naturally aligned blocks. These blocks are organized in an array
of lists in which list with index i contains all unallocated blocks of
301,8 → 309,8
implementation of this interface, the buddy allocator can use
specialized external functions to find buddy for a block, split and
coalesce blocks, manipulate block order and mark blocks busy or
available. For precize documentation of this interface, refer to <link
linkend="???">HelenOS Generic Kernel Reference Manual</link>.</para>
available. For precize documentation of this interface, refer to
<emphasis>"HelenOS Generic Kernel Reference Manual"</emphasis>.</para>
 
<formalpara>
<title>Data organization</title>
394,6 → 402,16
<section>
<title>Implementation</title>
 
<para><mediaobject id="slab_alloc">
<imageobject role="html">
<imagedata fileref="images/slab_alloc.png" format="PNG" />
</imageobject>
 
<imageobject role="fop">
<imagedata fileref="images.vector/slab_alloc.svg" format="SVG" />
</imageobject>
</mediaobject></para>
 
<para>The SLAB allocator is closely modelled after <ulink
url="http://www.usenix.org/events/usenix01/full_papers/bonwick/bonwick_html/">
OpenSolaris SLAB allocator by Jeff Bonwick and Jonathan Adams </ulink>