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

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

Revision 1.1, Tue Jun 3 09:38:42 2008 UTC (15 years, 11 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: 281px; height: 56px;"></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="main" style="vertical-align: top;">
      <h1>Prex Build Guide</h1>

<i>Version 1.3.0, 2007/06/20</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 Win32 with Cygwin</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>
And, 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 for compiling 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 about 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
PREX_SRC as follow.<br>
<pre class="terminal">
$ export PREX_SRC=/usr/src/prex-X.X.X
</pre>


<h2 id="cygwin">Compiling on Win32 with Cygwin</h2>

Target Platform: <b>i386-pc</b><br><br>

The gcc on Cygwin generates PE files as Win32 program. However,
Prex supports only ELF file format.
So, you have to prepare the toolchain for i386-elf with the following steps.

<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 required to build binutils/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. Setup</h4>

Set the prefix of the build tools before compiling Prex.
<pre class="terminal">$ export CROSS_COMPILE=i386-elf-</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 "/img" 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 "TASK=" option in Makefile
placed in "/img" 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>