Porting eLua

So, you realized how cool eLua is :), and you'd like to give it a try. Unfortunately, eLua doesn't have a port on your CPU 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. eLua 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 at the eLua architecture page.

Prerequisites

Before starting to work on the port, make sure that:

If all of the above are true, you should continue reading this document to bring your port to life. If not, we're sorry, but (at least at this point) eLua can't be ported to your CPU.

Overall structure of a port

eLua uses the notion of platform to denote a group of CPUs that share the same core structure, although their specific silicon implementation might differ in terms of intergrated peripherals, internal memory and other such attributes. An eLua port implements one or more CPUs from a given platform. For example, the lm3s port of eLua runs on LM3S8962, LM3S6965 and LM3S6918 CPUs, all of them part of the lm3s platform (reffer to the status page for a full list of platforms and CPUs on which eLua runs).

All the source files specific to a platform/port reside in a subdirectory of src/platform that has the same name as the platform (for lm3s it would be src/platform/lm3s, for example). Each such platform-specific subdirectory must contain at least these files:

Prerequisites

The very first thing to do before starting a new port is to verify if you can use one of the already existing platforms. A platform groups CPUs that share the same core structure, although their specific silicon implementation might differ in terms of integrated peripherals, internal memory, package size and other such attributes. For a list of ports currently supported by eLua check the status page. If you find