<p>So, you realized how cool <b>eLua</b> is :), and you'd like to give it a try. Unfortunately, <b>eLua</b> doesn't have a port for your CPU or board of choice.
The solution is simple: write the port yourself. This might seem as a daunting task at first, but it's actually easier than it sounds. <b>eLua</b> was
designed to make the task of implementing new ports as easy and intuitive as possible. This section gives an overview of the porting process. It's not
an exhaustive guide, but it should be enough to point you in the right direction. Before diving into this, it's highly recommended that you take a look
<p>If all of the above is true, you should continue reading this document to bring your port to life. If not, we're sorry, but (at least at this point)
<p>If all you need is to add a new board that uses a CPU that's already supported by <b>eLua</b> (check <ahref="status.html">here</a> for a complete list), then it's
<li>edit <b>SConstruct</b> and add your board to the <b>board_list</b> dictionary, specifying its CPU. A part of the definition of <b>board_list</b> is given below:
<li>if your board has external memory, you'll probably want to use the "multiple" allocator by default to take advantage of that (see <ahref="building.html">building</a>)
<li>customize the <b>eLua</b> image for this new board. You can use the variable <b>boardname</b> in <b>conf.py</b> to define new preprocessor macros specifically for your board
(that you can use later in <b>platform_conf.h</b>, for example), or to include or exclude certain files from the build, or change the build flags and so on. An example taken from
<p>After you edit all the relevant source files, all you have to do is to execute <i>scons board=<boardname></i> and you'll have <b>eLua</b> compiled for your board.</p>
<p>If you want to add a new CPU to <b>eLua</b> and the new CPU happens to be supported by a platform on which <b>eLua</b> already runs (see <ahref="status.html">here</a> for a full
<li>edit <b>SConstruct</b> and add your new CPU to the <b>platform_list</b> dictionary. Use the "official" name of the CPU (as it appears in its datasheet). An example is shown below:
<li>you also need to add a new board to <b>eLua</b> (which makes sense, since you're most likely going to run <b>eLua</b> on a board built around the CPU
of your choice, not only on the CPU itself). So follow the instruction from the <ahref="arch_newport.html#newboard">previous paragraph</a> to add
your new board.</li>
<li>customize the <b>eLua</b> image for this new CPU. You can use the variable <b>cputype</b> in <b>conf.py</b> to define new preprocessor macros specifically for your CPU
(that you can use later in <b>platform_conf.h</b>, for example), or to include or exclude certain files from the build, or change the build flags and so on. An example taken from
<p>After you edit all the relevant source files, all you have to do is to execute <i>scons board=<boardname></i> and you'll have <b>eLua</b> compiled for your board (and implicitly for
<p>If you want to add a new CPU to <b>eLua</b> and the new CPU is not supported by a platform on which <b>eLua</b> already runs (see <ahref="status.html">here</a> for a full list), you have to
go the whole way and add a completely new platform to <b>eLua</b>. This is certainly more difficult than the previous cases, but still not that hard. Remember to start small (implement only
minimal support at first) and don't write everything from scratch, start from an already existing platform implementation and work your way up from there. The <b>i386</b> port is the simplest,
but also a bit different from the embedded ports. Another port that is quite simple at this point is the <b>lpc2888</b> port, you might take a look at that too. After you "get a feeling" of
how a port should look like, and after you read about the architecture of <b>eLua</b> and the structure of a port <ahref="arch_overview.html">here</a>, follow the steps below:</p>
<li>choose the name of your new platform. It should be an easy, descriptive name. For example, all the CPUs from the LM3S series are grouped inside a platform called <b>lm3s</b>.</li>
<li>create the <i>src/platform/<name></i> directory, and add all your platform-specific files here. Check <ahref="arch_overview.html#platforms">here</a> for specific details.</li>
<li>implement as much as you need from the <ahref="arch_platform.html">platform interface</a>.</li>
<li>if your new platform uses a toolchain that wasn't previously configured in <b>eLua</b>, add it now (see <ahref="toolchains.html">here</a> for more details about toolchains).</li>
<li>let <b>SConstruct</b> know about your new platform by modifying the <b>platform_list</b> variable to add information about the CPU(s) available for your platform and about its toolchains.
<p>After you edit all the relevant source files, all you have to do is to execute <i>scons board=<boardname></i> and you'll have <b>eLua</b> compiled for your board (and implicitly for