[BACK]Return to build.html CVS log [TXT][DIR] Up to [local] / prex / doc / html / doc

File: [local] / prex / doc / html / doc / build.html (download) (as text)

Revision 1.1, Tue Aug 19 12:46:48 2008 UTC (15 years, 9 months ago) by nbrk
Branch point for: MAIN

Initial revision

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Prex Build Guide</title>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <meta name="keywords" content="Prex, embedded, real-time, operating system, RTOS, open source, free">
  <meta name="author" content="Kohsuke Ohtani">
  <link rel="stylesheet" type="text/css" href="../default.css" media="screen">
  <link rel="stylesheet" type="text/css" href="../print.css" media="print">
</head>
<body>
<div id="top">
</div>
<div id="middle">

<table id="content" cellpadding="0" cellspacing="0">
  <tbody>

    <tr>
      <td id="header" colspan="2" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td id="logo">
            <a href="http://prex.sourceforge.net/">
            <img alt="Prex logo" src="../img/logo.gif" border="0"
            style="width: 250px; height: 54px;"></a>
          </td>
          <td id="brief" align="right" valign="bottom">
            An Open Source, Royalty-free,<br>
	    Real-time Operating System
          </td>
        </tr>
        </table>
      </td>
    </tr>

    <tr>
      <td id="directory" style="vertical-align: top;">
      <a href="http://prex.sourceforge.net/">Prex Home</a> >
      <a href="index.html">Document Index</a> >
      Prex Build Guide
    </tr>
    <tr><td class="pad" colspan="2" style="vertical-align: top;"></td></tr>

    <tr>
      <td id="doc" style="vertical-align: top;">
      <h1>Prex Build Guide</h1>

<i>Version 1.4.0, 2007/12/26</i><br>


<h3>Table of Contents</h3>
<ul>
  <li><a href="#get">Getting Source</a></li>
  <li><a href="#compile">Compiling Prex</a></li>
  <li><a href="#cygwin">Compiling on Windows</a></li>
  <li><a href="#custom">Customizing OS Boot Image</a></li>
</ul>
<br>


<h2 id="get">Getting Source</h2>
<p>
You can download the source files at the
<a href="http://prex.sourceforge.net/downloads.html">download page</a>.<br>
Some binary files may be available there.
</p>


<h2 id="compile">Compiling Prex</h2>

<h4>Step 1. Prepare Toolchain</h4>
The following packages are required to compile Prex.
<ul>
  <li>GCC 2.95 or later (~4.2)</li>
  <li>GNU Binutils</li>
  <li>GNU Make</li>
</ul>
GCC and Binutils should be built appropriately for your target
architecture if you cross-compile Prex.

<h4>Step 2. Unpack Sources</h4>
Unpack the sources and move to top level directory of the source tree.
<pre class="terminal">$ cd /usr/src
$ tar zxvf prex-X.X.X.tar.gz
$ cd prex-X.X.X
</pre>

<h4>Step 3. Configure</h4>
Setup target architecture and platform.
The following sample shows the setting for i386-pc target.
<pre class="terminal">$ ./configure --target=i386-pc
</pre>

<h4>Step 4. Make</h4>
Run make.<br>
<pre class="terminal">
$ make
</pre>

<h4>(Tips)</h4>
If you want to run 'make' in the subdirectory, you have to set the
SRCDIR as follow.<br>
<pre class="terminal">
$ export SRCDIR=/usr/src/prex-X.X.X
</pre>


<h2 id="cygwin">Compiling on Windows</h2>
<p>
Cygwin is required to build Prex on Windows environment.
</p>
<p>
Please note that we can not use the default gcc version included in Cygwin.
This is because the pre-compiled gcc in Cygwin is built to generate a native Windows binary (PE format).
Since Prex supports only ELF file format, you have to prepare the toolchain
for i386-elf with the following steps.
(Target Platform is i386-pc here.)
</p>

<h4>Step 1. Install Cygwin</h4>

You can find the latest Cygwin setup program at
<a href="http:/www.cygwin.com">this site</a>.

Download setup.exe and run it. During Cygwin installation, you have to select
at least the following packages in addition to the default selection.<br>
<ul>
  <li>make</li>
  <li>binutils</li>
  <li>gcc-core</li>
  <li>flex</li>
  <li>perl</li>
</ul>
Note: These tools are not required to build Prex itself.
They are required to build "binutils and gcc".

<h4>Step 2. Unpack Archives</h4>
You have to download and unpack the following files.

<pre class="terminal">$ cd /usr/src
$ tar zxvf binitils-2.15.tar.gz
$ tar zxvf gcc-core-3.4.3.tar.gz
<!-- Temporary removed
$ tar zxvf newlib-1.13.0.tar.gz--></pre>

<h4>Step 3. Build Binutils</h4>

<p>
Configure and build binutils.
</p>
<pre class="terminal">$ mkdir binutils-2.15-i386-elf
$ cd binutils-2.15-i386-elf
$ ../binutils-2.15/configure --prefix=/usr/local/i386 --target=i386-elf --disable-nls
$ make
$ make install</pre>
<p>
You must set the path to this binutils before compiling gcc.
</p>
<pre class="terminal">$ export PATH=/usr/local/i386/bin:$PATH
$ cd /usr/src</pre>


<h4>Step 4. Build gcc</h4>

<pre class="terminal">$ mkdir gcc-3.4.3-i386-elf
$ cd gcc-3.4.3-i386-elf
$ ../gcc-3.4.3/configure --prefix=/usr/local/i386 --target=i386-elf \
 --with-gnu-as --with-gnu-ld --disable-nls --enable-languages=c --without-headers \
 --without-libs --disable-libssp
$ make LANGUAGES="c"
$ make LANGUAGES="c" install
$ cd /usr/src</pre>



<h4>Step 5. Configure Prex and make</h4>
<pre class="terminal">$ cd prex-X.X.X
$ ./configure --target=i386-pc
$ make
</pre>

<h2 id="custom">Customizing OS Boot Image</h2>
<p>
If you compile the Prex source with "make" command, the OS boot image is created
as "prexos" in the root directory. The file "prexos" must exist in root directory
of the Prex disk. You can test your own Prex image by replacing the "prexos" in
the floppy image.
The file "prexos" includes the following files.
</p>
<ul>
  <li>Boot loader</li>
  <li>Kernel module</li>
  <li>Driver module</li>
  <li>Boot task(s)</li>
</ul>
<p>
The boot task is a special task which is loaded by kernel directly at boot
time. You can specify your own boot task(s) in "BOOTTASKS=" option in files.conf
placed in "/conf/etc" directory.
</p>


      </td>
    </tr>
    <tr>
      <td id="footer" colspan="2" style="vertical-align: top;">
        <a href="http://sourceforge.net">
        <img src="http://sourceforge.net/sflogo.php?group_id=132028&amp;type=1"
        alt="SourceForge.net Logo" border="0" height="31" width="88"></a><br>
        Copyright&copy; 2005-2007 Kohsuke Ohtani
      </td>
    </tr>

  </tbody>
</table>

</div>
<div id="bottom"></div>

</body>
</html>