Running EPOS on an IA32 (Multicore) Processor

This tutorial presents the fundamental considerations about how to run EPOS on a real IA32 machine. After reading this material, you will be able to configure and to execute EPOS on a real processor. Before continuing reading you should read the EPOS User's guide.

1. Configuring the system

All the configuration parameters are defined in the Traits classes.

  • "include/traits.h": enables SMP support and defines the scheduler. Also defines the scheduling QUANTUM when the scheduler is timer-based. The current available schedulers for SMP are G-EDF, P-EDF, G-RM, and P-RM.

template <> struct Traits<Thread>: public Traits<void>
    typedef Scheduling_Criteria::GEDF Criterion; // defines GEDF as the scheduler
    static const bool smp = true; // enables SMP support
    static const bool trace_idle = false;
    static const unsigned int QUANTUM = 10000; // us

You must also disable the Serial_Display support. When the Serial_Display is enabled, all the output are redirected to the UART. When disabled, the output is sent to the Display (monitor screen). If you do not disable the Serial_Display, nothing is printed on the screen and the system may be restart itself.

template <> struct Traits<Serial_Display>: public Traits<void>
    static const bool enabled = false; //disables Serial_Display
    static const int COLUMNS = 80;
    static const int LINES = 24;
    static const int TAB_SIZE = 8;

  • "include/mach/pc/traits.h": defines the number of available CPUs and the heap and stack sizes (see the user's guide for details). You must define the correct number of CPUs as the processor that will execute EPOS. The number of processor can be less than the processor's cores, but never greater.

template <> struct Traits<PC>: public Traits<PC_Common>
    static const unsigned int MAX_CPUS = 8; // the processor has 8 cores

    static const unsigned int BOOT_IMAGE_ADDR = 0x00008000;

    static const unsigned int APPLICATION_STACK_SIZE = 16 * 1024; //each application thread has 16KB of stack
    static const unsigned int APPLICATION_HEAP_SIZE = 16 * 1024 * 1024; // the application heap has 16MB

    static const unsigned int SYSTEM_STACK_SIZE = 4096; //not used
    static const unsigned int SYSTEM_HEAP_SIZE = 128 * APPLICATION_STACK_SIZE; //the system heap has 2MB

    static const unsigned int PRIORITY_HEAP_BASE_ADDR = 0; //not used
    static const unsigned int PRIORITY_HEAP_SIZE = 4; //not used
    static const unsigned int PRIORITY_HEAP_TOP_ADDR = PRIORITY_HEAP_BASE_ADDR + PRIORITY_HEAP_SIZE - 1; //not used

2. Compiling

For compiling the system you must download and install the IA32 compiler available on the Software page. Then, follow the EPOS User's guide about how to compile an application.

3. Booting EPOS

The easiest way to boot EPOS in a (multicore) IA32 processor is through a network boot (PXE) server. You must configure a PXE server and a dnsmasq server to serve the boot machine requests and the DHCP requests. A good tutorial about how to configure a PXE server is found here.

After configuring the PXE boot server, you can copy the EPOS image file generated in the previously step to the tftp server directory. The machine will boot and receive the EPOS image through the network. After executing the application, EPOS will reboot. To avoid rebooting you can insert an while(1) loop in the end of the application.

Alternatively, you can copy your EPOS image to a floppy disk or CD disk and boot the processor accordingly.

4. Multicore Real-Time Support

EPOS has been used to conduct research in multicore real-time related areas. We have improved the source code of G-EDF schedulability analyses developed by Bjorn Brandenburg to also support EDF and the execution of tests both in parallel and sequential. The new source code can be downloaded here.

5. Color-Aware Task Partitioning Algorithm

We have extented the Bjorn Brandenburg's work and implemented the first-fit, best-fit, and worst-fit decreasing bin packing heuristics. Also, we proposed a color-aware task partitioning, in which partitions a task set respecting the usage of colors (or partitions) by the tasks. Tasks that share one or more partitions are grouped together and the whole group is assigned to the same processor. The new source code can be downloaded here.