gnuk/ChibiOS_2.0.2/docs/html/architecture.html

132 lines
8.9 KiB
HTML
Raw Normal View History

2010-08-10 03:11:02 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: Architecture</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="main.html">ChibiOS/RT</a>
</div>
</div>
<div class="contents">
<h1><a class="anchor" id="architecture">Architecture </a></h1><p>ChibiOS/RT General Architecture</p>
<ul>
<li><a class="el" href="architecture.html#components">Components</a></li>
<li><a class="el" href="architecture.html#dependencies">Dependencies</a></li>
<li><a class="el" href="architecture.html#kernel_arch">Kernel Architecture</a></li>
<li><a class="el" href="architecture.html#hal_arch">HAL Architecture</a></li>
</ul>
<h2><a class="anchor" id="components">
Components</a></h2>
<p>ChibiOS/RT is composed of several major components, each component can be composed of one of more subsystems. The main components are:</p>
<ul>
<li><b>Kernel</b>, this is the platform independent part of the OS kernel.</li>
<li><b>HAL</b>, this component contains a set of abstract device drivers that offer a common I/O API to the application across all the support platforms. The HAL code is totally portable across platforms.</li>
<li><b>Port</b>, this is the platform dependent part of the OS kernel. This component is responsible of the system startup, interrupts abstraction, lock/unlock primitives, context switch related structures and code.<br/>
The component usually contains very little code because the OS is very portable but the quality of the implementation of the Port component affects heavily the performance of the ported OS. It is probably the most critical part of the whole OS.</li>
<li><b>Platform</b>, this component contains a set of device drivers implementations.</li>
<li><b>Various</b>, a library of various extra components that do not belong to any particular component but can make life easier while developing an embedded application.</li>
</ul>
<h2><a class="anchor" id="dependencies">
Dependencies</a></h2>
<p>The following diagram shows the relationships among the various components that compose the system:<br/>
<br/>
</p>
<div align="center">
<img src="inline_dotgraph_1.dot.png" alt="inline_dotgraph_1.dot" border="0" usemap="#inline_dotgraph_1.dot.map">
<map name="inline_dotgraph_1.dot.map" id="inline_dotgraph_1.dot.map"></map>
</div>
<h2><a class="anchor" id="kernel_arch">
Kernel Architecture</a></h2>
<p>The kernel itself is very modular and is composed of several subsystems, most subsystems are optional and can be switched of in the kernel configuration file <code><a class="el" href="chconf_8h.html" title="Configuration file template.">chconf.h</a></code>.<br/>
The current kernel subsystems are divided in five categories:</p>
<ul>
<li><a class="el" href="group__base.html">Base Kernel Services</a>, this category contains the mandatory kernel subsystems:<ul>
<li><a class="el" href="group__system.html">System Management</a>, low level locks, initialization.</li>
<li><a class="el" href="group__time.html">Time and Virtual Timers</a>, virtual timers and time APIs.</li>
<li><a class="el" href="group__scheduler.html">Scheduler</a>, scheduler APIs, all the higher level synchronization mechanism are implemented through this subsystem, it is very flexible but not recommended for direct use in user code.</li>
<li><a class="el" href="group__threads.html">Threads</a>, thread-related APIs.</li>
</ul>
Base services diagram:<br/>
<br/>
<div align="center">
<img src="inline_dotgraph_2.dot.png" alt="inline_dotgraph_2.dot" border="0" usemap="#inline_dotgraph_2.dot.map">
<map name="inline_dotgraph_2.dot.map" id="inline_dotgraph_2.dot.map"></map>
</div>
</li>
<li><a class="el" href="group__synchronization.html">Synchronization</a>, this category contains the synchronization-related subsystems, each one of the provided mechanism can be configured out of the kernel if not needed.<ul>
<li><a class="el" href="group__semaphores.html">Semaphores</a>, counter semaphores subsystem.</li>
<li><a class="el" href="group__mutexes.html">Mutexes</a>, mutexes subsystem with support to the priority inheritance algorithm (fully implemented, any depht).</li>
<li><a class="el" href="group__condvars.html">Condition Variables</a>, condition variables, together with mutexes the condition variables allow the implementation of monitor constructs.</li>
<li><a class="el" href="group__events.html">Event Flags</a>, event sources and event flags with flexible support for and/or conditions and automatic dispatching to handler functions.</li>
<li><a class="el" href="group__messages.html">Synchronous Messages</a>, lightweight synchronous messages.</li>
<li><a class="el" href="group__mailboxes.html">Mailboxes</a>, asynchronous messages queues.</li>
</ul>
All the synchronization mechanisms are built on top of the Scheduler APIs except Mailboxes that are build on top of Semaphores and Condition Variables that implicitly refer to Mutexes:<br/>
<br/>
<div align="center">
<img src="inline_dotgraph_3.dot.png" alt="inline_dotgraph_3.dot" border="0" usemap="#inline_dotgraph_3.dot.map">
<map name="inline_dotgraph_3.dot.map" id="inline_dotgraph_3.dot.map"></map>
</div>
</li>
<li><a class="el" href="group__memory.html">Memory Management</a>, memory management, multiple non-alternative schemes are available:<ul>
<li><a class="el" href="group__memcore.html">Core Memory Manager</a>, centralized core memory manager, this subsystems is used by the other allocators in order to get chunks of memory in a consistent way.</li>
<li><a class="el" href="group__heaps.html">Heaps</a>, central heap manager using a first fit strategy, it also allow the creation of multiple heaps in order to handle non uniform memory areas.</li>
<li><a class="el" href="group__pools.html">Memory Pools</a>, very fast fixed size objects allocator.</li>
<li><a class="el" href="group__threads.html">Threads</a> (dynamic), usually threads are static objects in ChibiOS/RT but there is the option for dynamic threads management, please see the article <a class="el" href="article__lifecycle.html">Threads Lifecycle</a>.</li>
</ul>
The various allocators follow a precise hierarchy:<br/>
<br/>
<div align="center">
<img src="inline_dotgraph_4.dot.png" alt="inline_dotgraph_4.dot" border="0" usemap="#inline_dotgraph_4.dot.map">
<map name="inline_dotgraph_4.dot.map" id="inline_dotgraph_4.dot.map"></map>
</div>
Please also see the article <a class="el" href="article__manage__memory.html">How to manage memory</a>.</li>
<li><a class="el" href="group__io__support.html">I/O Support</a>, the kernel also provides mechanisms and abstract data interfaces that can be used by non-kernel components, the HAL as example.<ul>
<li><a class="el" href="group__data__streams.html">Data Streams</a>, abstract streams interface.</li>
<li><a class="el" href="group__io__channels.html">I/O Channels</a>, abstract I/O channels that inherits from the abstract stream interface.</li>
<li><a class="el" href="group__io__queues.html">I/O Queues</a>, generic, byte wide, I/O queues APIs.</li>
</ul>
</li>
<li><a class="el" href="group__debug.html">Debug</a>, debug services and APIs. The <a class="el" href="group__registry.html">Registry</a> susystem can be seen as part of the debug category even if it finds use in non-debug roles.</li>
</ul>
<h2><a class="anchor" id="hal_arch">
HAL Architecture</a></h2>
<p>The HAL is a collection of abstract device drivers, it relies on the Platform component for the low level implementation on specific hardware.<br/>
The current internal HAL organization is the following:<br/>
<br/>
</p>
<div align="center">
<img src="inline_dotgraph_5.dot.png" alt="inline_dotgraph_5.dot" border="0" usemap="#inline_dotgraph_5.dot.map">
<map name="inline_dotgraph_5.dot.map" id="inline_dotgraph_5.dot.map"></map>
</div>
<p> <br/>
See <a class="el" href="group___i_o.html">HAL</a> for details about the various HAL subsystems. </p>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Jul 11 13:13:07 2010 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.3</small></address>
</body>
</html>