Newer
Older
UbixOS / doc / html / main_8c-source.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>UbixOS V2: src/sys/init/main.c Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="dirs.html"><span>Directories</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="dir_897b6a2d7bab147dd1db58381aad3984.html">src</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_832905b1f7f5feaf61a306b40c0ac817.html">sys</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_dffcdd1ad37a0b2305f9cf289deb8f95.html">init</a></div>
<h1>main.c</h1><a href="main_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2002-2004, 2005 The UbixOS Project</span>
<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> Redistribution and use in source and binary forms, with or without modification, are</span>
<a name="l00006"></a>00006 <span class="comment"> permitted provided that the following conditions are met:</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> Redistributions of source code must retain the above copyright notice, this list of</span>
<a name="l00009"></a>00009 <span class="comment"> conditions, the following disclaimer and the list of authors.  Redistributions in binary</span>
<a name="l00010"></a>00010 <span class="comment"> form must reproduce the above copyright notice, this list of conditions, the following</span>
<a name="l00011"></a>00011 <span class="comment"> disclaimer and the list of authors in the documentation and/or other materials provided</span>
<a name="l00012"></a>00012 <span class="comment"> with the distribution. Neither the name of the UbixOS Project nor the names of its</span>
<a name="l00013"></a>00013 <span class="comment"> contributors may be used to endorse or promote products derived from this software</span>
<a name="l00014"></a>00014 <span class="comment"> without specific prior written permission.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY</span>
<a name="l00017"></a>00017 <span class="comment"> EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00018"></a>00018 <span class="comment"> MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL</span>
<a name="l00019"></a>00019 <span class="comment"> THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<a name="l00020"></a>00020 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT</span>
<a name="l00021"></a>00021 <span class="comment"> OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
<a name="l00022"></a>00022 <span class="comment"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR</span>
<a name="l00023"></a>00023 <span class="comment"> TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00024"></a>00024 <span class="comment"> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment"> $Id: main_8c-source.html 88 2016-01-12 00:11:29Z reddawg $</span>
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">*****************************************************************************************/</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;<a class="code" href="init_8h.html">ubixos/init.h</a>&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="gdt_8h.html">sys/gdt.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="video_8h.html">sys/video.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="tss_8h.html">sys/tss.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="exec_8h.html">ubixos/exec.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="kpanic_8h.html">ubixos/kpanic.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="systemtask_8h.html">ubixos/systemtask.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="mount_8h.html">vfs/mount.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="kprintf_8h.html">lib/kprintf.h</a>&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;<a class="code" href="kmalloc_8h.html">lib/kmalloc.h</a>&gt;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="main_8c.html#51559a670a393f5106970bd330e35e55">00041</a> <span class="preprocessor">#define B_ADAPTORSHIFT          24</span>
<a name="l00042"></a><a class="code" href="main_8c.html#f921ea6d044d9c201c0e226ea326aad5">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define B_ADAPTORMASK           0x0f</span>
<a name="l00043"></a><a class="code" href="main_8c.html#b92c162a9080b9c4112514027886c9aa">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define B_ADAPTOR(val)          (((val) &gt;&gt; B_ADAPTORSHIFT) &amp; B_ADAPTORMASK)</span>
<a name="l00044"></a><a class="code" href="main_8c.html#6eb2af607543a4b165ec24683128ba63">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define B_CONTROLLERSHIFT       20</span>
<a name="l00045"></a><a class="code" href="main_8c.html#8904a61fb70a4e415a9079e66b2a1c6b">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define B_CONTROLLERMASK        0xf</span>
<a name="l00046"></a><a class="code" href="main_8c.html#ed28ca8a4cbb1afd0efb24acc27c637c">00046</a> <span class="preprocessor"></span><span class="preprocessor">#define B_CONTROLLER(val)       (((val)&gt;&gt;B_CONTROLLERSHIFT) &amp; B_CONTROLLERMASK)</span>
<a name="l00047"></a><a class="code" href="main_8c.html#481ca7ef4223d24ad4d9d1a6758b43e8">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define B_SLICESHIFT            20</span>
<a name="l00048"></a><a class="code" href="main_8c.html#90967877afc3807bbe1b82219b88337d">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define B_SLICEMASK             0xff</span>
<a name="l00049"></a><a class="code" href="main_8c.html#bb3e38e306d89ebc417f8cede85671ab">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define B_SLICE(val)            (((val)&gt;&gt;B_SLICESHIFT) &amp; B_SLICEMASK)</span>
<a name="l00050"></a><a class="code" href="main_8c.html#6b58a68c1e36e9f1efa48516f618cbf0">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define B_UNITSHIFT             16</span>
<a name="l00051"></a><a class="code" href="main_8c.html#a62f6a41c4e9aaa8441e129c13e6153b">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define B_UNITMASK              0xf</span>
<a name="l00052"></a><a class="code" href="main_8c.html#e7b63278ee65b6dfd6b5e2bc89d3945e">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define B_UNIT(val)             (((val) &gt;&gt; B_UNITSHIFT) &amp; B_UNITMASK)</span>
<a name="l00053"></a><a class="code" href="main_8c.html#8b92fffbfc22d7e499986a428fa0ab55">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define B_PARTITIONSHIFT        8</span>
<a name="l00054"></a><a class="code" href="main_8c.html#4ec3b9af2fec01cc27e811dc8c27c82d">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define B_PARTITIONMASK         0xff</span>
<a name="l00055"></a><a class="code" href="main_8c.html#130cc4d8d831b007dff151a64bce5946">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define B_PARTITION(val)        (((val) &gt;&gt; B_PARTITIONSHIFT) &amp; B_PARTITIONMASK)</span>
<a name="l00056"></a><a class="code" href="main_8c.html#4bcb437e907c24b07dbc1d94bb0d6954">00056</a> <span class="preprocessor"></span><span class="preprocessor">#define B_TYPESHIFT             0</span>
<a name="l00057"></a><a class="code" href="main_8c.html#43c1ba15038b0ac4bc7e0d521ffa57f5">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define B_TYPEMASK              0xff</span>
<a name="l00058"></a><a class="code" href="main_8c.html#001a03933a758f0930b5c26b0c00e50a">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define B_TYPE(val)             (((val) &gt;&gt; B_TYPESHIFT) &amp; B_TYPEMASK)</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 <span class="comment">/*****************************************************************************************</span>
<a name="l00062"></a>00062 <span class="comment"> Desc: The Kernels Descriptor table:</span>
<a name="l00063"></a>00063 <span class="comment">       0x00 - Dummy Entry</span>
<a name="l00064"></a>00064 <span class="comment">       0x08 - Ring 0 CS</span>
<a name="l00065"></a>00065 <span class="comment">       0x10 - Ring 0 DS </span>
<a name="l00066"></a>00066 <span class="comment">       0x18 - Dummy LDT</span>
<a name="l00067"></a>00067 <span class="comment">       0x20 - Scheduler TSS</span>
<a name="l00068"></a>00068 <span class="comment">       0x28 - Ring 3 CS</span>
<a name="l00069"></a>00069 <span class="comment">       0x30 - Ring 3 DS</span>
<a name="l00070"></a>00070 <span class="comment">       0x38 - GPF TSS</span>
<a name="l00071"></a>00071 <span class="comment">       0x40 - Stack Fault TSS</span>
<a name="l00072"></a>00072 <span class="comment"></span>
<a name="l00073"></a>00073 <span class="comment"> Notes: </span>
<a name="l00074"></a>00074 <span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment">*****************************************************************************************/</span>
<a name="l00076"></a><a class="code" href="main_8c.html#bc24c46464ccafa098c421ad858c742b">00076</a> <a class="code" href="gdt_8h.html#f3cff64995ffb5584c82c7bf27ee802d">ubixDescriptorTable</a>(ubixGDT,9) {
<a name="l00077"></a>00077   {dummy:0},
<a name="l00078"></a>00078   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x0000, 0xFFFFF, (<a class="code" href="gdt_8h.html#f37890c8c59b0fd3d83cea8d6034a035">dCode</a> + <a class="code" href="gdt_8h.html#4427d6b09e5682b1c554a5a61e9bee55">dRead</a> + <a class="code" href="gdt_8h.html#6b595357c10a17c620edcbeeb1c7f6a1">dBig</a> + <a class="code" href="gdt_8h.html#bc269d96e027bb39b828cadb2fc8660f">dBiglim</a>)),
<a name="l00079"></a>00079   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x0000, 0xFFFFF, (<a class="code" href="gdt_8h.html#fcbb50cc521f6214eda9bca84aaee513">dData</a> + <a class="code" href="gdt_8h.html#9785c919d49cacd1b0fa92590a7562c8">dWrite</a> + <a class="code" href="gdt_8h.html#6b595357c10a17c620edcbeeb1c7f6a1">dBig</a> + <a class="code" href="gdt_8h.html#bc269d96e027bb39b828cadb2fc8660f">dBiglim</a>)),
<a name="l00080"></a>00080   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x0000, 0xFFFFF, (<a class="code" href="gdt_8h.html#5ebc94affcfbf066336ac0910680345e">dLdt</a>)),
<a name="l00081"></a>00081   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x4200, (<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code" href="structtssStruct.html">tssStruct</a>)), (<a class="code" href="gdt_8h.html#4d5c962ea8bc3d8422e6c3b92ce4b74f">dTss</a> + <a class="code" href="gdt_8h.html#2e29d1e158d5e81dc70dfae75f17d7f4">dDpl3</a>)),
<a name="l00082"></a>00082   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x0000, 0xFFFFF, (<a class="code" href="gdt_8h.html#f37890c8c59b0fd3d83cea8d6034a035">dCode</a> + <a class="code" href="gdt_8h.html#9785c919d49cacd1b0fa92590a7562c8">dWrite</a> + <a class="code" href="gdt_8h.html#6b595357c10a17c620edcbeeb1c7f6a1">dBig</a> + <a class="code" href="gdt_8h.html#bc269d96e027bb39b828cadb2fc8660f">dBiglim</a> + <a class="code" href="gdt_8h.html#2e29d1e158d5e81dc70dfae75f17d7f4">dDpl3</a>)),
<a name="l00083"></a>00083   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x0000, 0xFFFFF, (<a class="code" href="gdt_8h.html#fcbb50cc521f6214eda9bca84aaee513">dData</a> + <a class="code" href="gdt_8h.html#9785c919d49cacd1b0fa92590a7562c8">dWrite</a> + <a class="code" href="gdt_8h.html#6b595357c10a17c620edcbeeb1c7f6a1">dBig</a> + <a class="code" href="gdt_8h.html#bc269d96e027bb39b828cadb2fc8660f">dBiglim</a> + <a class="code" href="gdt_8h.html#2e29d1e158d5e81dc70dfae75f17d7f4">dDpl3</a>)),
<a name="l00084"></a>00084   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x4200, (<span class="keyword">sizeof</span>(<span class="keyword">struct</span> tssStruct)), (<a class="code" href="gdt_8h.html#4d5c962ea8bc3d8422e6c3b92ce4b74f">dTss</a>)),
<a name="l00085"></a>00085   <a class="code" href="gdt_8h.html#c84a835fad3118c457254bf67013ad5b">ubixStandardDescriptor</a>(0x6200, (<span class="keyword">sizeof</span>(<span class="keyword">struct</span> tssStruct)), (<a class="code" href="gdt_8h.html#4d5c962ea8bc3d8422e6c3b92ce4b74f">dTss</a>)),
<a name="l00086"></a>00086   };
<a name="l00087"></a>00087 <span class="keyword">struct </span>{
<a name="l00088"></a>00088   <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> limit __attribute__ ((<a class="code" href="gdt_8h.html#a8e25552752eade51544ff9e9fbd7bdf">packed</a>));
<a name="l00089"></a>00089   <span class="keyword">union </span><a class="code" href="uniondescriptorTableUnion.html">descriptorTableUnion</a> *gdt __attribute__ ((<a class="code" href="gdt_8h.html#a8e25552752eade51544ff9e9fbd7bdf">packed</a>));
<a name="l00090"></a>00090   } <a class="code" href="main_8c.html#ac0f90734a3334640d5e1a24e297fd9a">loadGDT</a> = { (9 * <span class="keyword">sizeof</span>(<span class="keyword">union </span><a class="code" href="uniondescriptorTableUnion.html">descriptorTableUnion</a>) - 1), ubixGDT };
<a name="l00091"></a>00091 
<a name="l00097"></a><a class="code" href="main_8c.html#a099bb67b4698f94150184a0ee8ccffb">00097</a> <span class="keywordtype">int</span> <a class="code" href="main_8c.html#a099bb67b4698f94150184a0ee8ccffb">kmain</a>(<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> rootdev) {
<a name="l00098"></a>00098   <span class="comment">/* Set up counter for startup routine */</span>
<a name="l00099"></a>00099   <span class="keywordtype">int</span> i = 0x0;
<a name="l00100"></a>00100   <a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> *sysTask = 0x0;
<a name="l00101"></a>00101 
<a name="l00102"></a>00102   <span class="comment">/* Do A Clear Screen Just To Make The TEXT Buffer Nice And Empty */</span>
<a name="l00103"></a>00103   <a class="code" href="video_8h.html#9d7e8af417b6d543da691e9c0e2f6f9f">clearScreen</a>();
<a name="l00104"></a>00104   <a class="code" href="video_8h.html#5429378b96a24fadfd2d1f8d777eb95a">kprint</a>(<span class="stringliteral">"AAA"</span>);
<a name="l00105"></a>00105   <a class="code" href="video_8h.html#5429378b96a24fadfd2d1f8d777eb95a">kprint</a>(<span class="stringliteral">"BBB"</span>);
<a name="l00106"></a>00106 <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"TEST"</span>);
<a name="l00107"></a>00107   <span class="comment">/* Modify src/sys/include/ubixos/init.h to add a startup routine */</span>
<a name="l00108"></a>00108   <span class="keywordflow">for</span> (i=0x0;i&lt;<a class="code" href="init_8h.html#21f47c950626424757538f3419d77fa9">init_tasksTotal</a>;i++) {
<a name="l00109"></a>00109     <span class="keywordflow">if</span> (<a class="code" href="init_8h.html#c2942ccd2cc88a56391dd2b836b38150">init_tasks</a>[i]() != 0x0) {
<a name="l00110"></a>00110       <a class="code" href="kpanic_8h.html#db9a182aa071791a306163d50d653deb">kpanic</a>(<span class="stringliteral">"Error: Initializing System.\n"</span>);
<a name="l00111"></a>00111       }
<a name="l00112"></a>00112     }
<a name="l00113"></a>00113 
<a name="l00114"></a>00114   <span class="comment">/* New Root Mount Point */</span>
<a name="l00115"></a>00115   <span class="comment">//Old 2 new 10</span>
<a name="l00116"></a>00116   <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"[0xX][0x%X:0x%X:0x%X:0x%X:0x%X:0x%X]\n"</span>,<a class="code" href="main_8c.html#b92c162a9080b9c4112514027886c9aa">B_ADAPTOR</a>(rootdev),<a class="code" href="main_8c.html#ed28ca8a4cbb1afd0efb24acc27c637c">B_CONTROLLER</a>(rootdev),<a class="code" href="main_8c.html#bb3e38e306d89ebc417f8cede85671ab">B_SLICE</a>(rootdev),<a class="code" href="main_8c.html#e7b63278ee65b6dfd6b5e2bc89d3945e">B_UNIT</a>(rootdev),<a class="code" href="main_8c.html#130cc4d8d831b007dff151a64bce5946">B_PARTITION</a>(rootdev),<a class="code" href="main_8c.html#001a03933a758f0930b5c26b0c00e50a">B_TYPE</a>(rootdev));
<a name="l00117"></a>00117   <span class="keywordflow">if</span> (<a class="code" href="mount_8h.html#1255ebfdcd5f7048ffe187e836f8eb28">vfs_mount</a>(0<a class="code" href="ap-boot_8S.html#1a3ac2137e21f6f0d400f1996914dd19">x1</a>,<a class="code" href="main_8c.html#130cc4d8d831b007dff151a64bce5946">B_PARTITION</a>(rootdev)+2,0x0,0xAA,<span class="stringliteral">"sys"</span>,<span class="stringliteral">"rw"</span>) != 0x0) {
<a name="l00118"></a>00118     <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"Problem Mounting sys Mount Point\n"</span>);
<a name="l00119"></a>00119     }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121   <span class="comment">/* Do our mounting */</span>
<a name="l00122"></a>00122  <span class="comment">/* </span>
<a name="l00123"></a>00123 <span class="comment">  if (vfs_mount(0x0,0x0,0x0,0x0,"sys","rw") != 0x0) {</span>
<a name="l00124"></a>00124 <span class="comment">    kprintf("Problem Mounting sys Mount Point\n");</span>
<a name="l00125"></a>00125 <span class="comment">    }</span>
<a name="l00126"></a>00126 <span class="comment">  if (vfs_mount(0x0,0x0,0x1,0x0,"tmp","rw") != 0x0) {</span>
<a name="l00127"></a>00127 <span class="comment">    kprintf("Problem Mounting tmp Mount Point\n");</span>
<a name="l00128"></a>00128 <span class="comment">    }</span>
<a name="l00129"></a>00129 <span class="comment">  */</span>
<a name="l00130"></a>00130   
<a name="l00131"></a>00131   <span class="comment">/* Initialize the system */</span>
<a name="l00132"></a>00132   <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"Free Pages: [%i]\n"</span>,<a class="code" href="vitals_8h.html#67aae71be472453526fc1a0bfbf80280">systemVitals</a>-&gt;<a class="code" href="structvitalsStruct.html#1f45a0348eac13344950507efaf565f8">freePages</a>); 
<a name="l00133"></a>00133 
<a name="l00134"></a>00134   <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"MemoryMap:  [0x%X]\n"</span>,<a class="code" href="vmm_8h.html#89e87741958ee81f1811075b25af058a">vmmMemoryMap</a>);
<a name="l00135"></a>00135   <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"Starting OS\n"</span>);
<a name="l00136"></a>00136   
<a name="l00137"></a>00137         sysTask = <a class="code" href="kmalloc_8h.html#150eab2ac4ce4553e21ca10e7f441762">kmalloc</a>(0<a class="code" href="start_8S.html#d95bd4ee2ca78187e68aa0746a24e64d">x2000</a>);
<a name="l00138"></a>00138         <span class="keywordflow">if</span>(sysTask == <a class="code" href="types_8h.html#070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00139"></a>00139                 <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"OS: Unable to allocate memory\n"</span>);
<a name="l00140"></a>00140 
<a name="l00141"></a>00141         <a class="code" href="exec_8h.html#e9945e606ad208cb00dc9166d06452b4">execThread</a>(<a class="code" href="systemtask_8h.html#c7cc6a806237f8657fcdce169319fd7f">systemTask</a>, (<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>)sysTask+0<a class="code" href="start_8S.html#d95bd4ee2ca78187e68aa0746a24e64d">x2000</a>,0x0);
<a name="l00142"></a>00142 
<a name="l00143"></a>00143         <a class="code" href="exec_8h.html#f80d4412d42ed1b5bf9a1b9774230f33">execFile</a>(<span class="stringliteral">"sys:/bin/init"</span>,0x0,0x0,0x0); <span class="comment">/* OS Initializer    */</span>
<a name="l00144"></a>00144   
<a name="l00145"></a>00145         <a class="code" href="8259_8h.html#0ac079c4d770f02e505f4d8569a6960a">irqEnable</a>(0x0);
<a name="l00146"></a>00146   
<a name="l00147"></a>00147         <span class="keywordflow">while</span> (0<a class="code" href="ap-boot_8S.html#1a3ac2137e21f6f0d400f1996914dd19">x1</a>)
<a name="l00148"></a>00148                 <span class="keyword">asm</span>(<span class="stringliteral">"hlt"</span>); <span class="comment">/* Keep haulting until the scheduler reacts */</span>
<a name="l00149"></a>00149   
<a name="l00150"></a>00150         <span class="comment">/* Return to start however we should never get this far */</span>
<a name="l00151"></a>00151         <span class="keywordflow">return</span>(0x0);
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153 
<a name="l00154"></a>00154 <span class="comment">/***</span>
<a name="l00155"></a>00155 <span class="comment"> END</span>
<a name="l00156"></a>00156 <span class="comment"> ***/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Dec 15 11:18:55 2006 for UbixOS V2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>