RTEMS serial (2) Compilation of RTEMS

xiaoxiao2021-03-06  39

Compilation of RTEMS

Author ray

RTEMS copyright, reproduced please indicate: Source http://www.rtems.net, author ray@rtems.net

Summary

This section mainly introduces the steps compiled by RTEMS.

After the cross-compilation environment is established, it is very simple to compile, unzip the RTEMS folder.

$ tar xjvf rtems4.6.2.tar.bz2

Built the RTEMS compilation path:

$ mkdir RTEMS_I386

Here, it will be described as an example of 386. After all, 386 is most easily practiced, in addition, the CPU architecture of i386 is much more complicated than common embedded CPUs. Familiar with the compilation process of 386 type RTEMS, other platforms have been pushed according to this class.

First, you want to output a tool chain just compiled:

Export Path = / bin: $ {pat}

Here is the directory where the toolchain is located (that is, the directory of the ARM-RTEMS-GCC these executable). For FreeBSD users, this step can be ignored, and the reader of the toolchain is established according to the steps, corresponds to Yes: / Home / Ray / Embedded / Toolchain / Configure directive format is:

. ../rtems-4.6.2/configure --target = / - disable-posix --disable-networking --disable-cxx / - enable-rtemsbsp = / - prefix =

For FreeBSD users

You can use the following command:

. ../rtems-4.6.2/configure --target = i386-rtems / - enable-rtemsbsp = i386EX / - prefix = / home / ray / RTEMS / RTEMS-Build

Then generate binary code using the GMAKE instruction

$ GMAKE RTEMS_BSP = i386EX

Generate I386 library code

$ GMAKE RTEMS_BSP = PC686

Generate the binary code of the Pentium PRO or the above version of the CPU. It should be noted that CONFIGURE can make an optimization option for GCC, such as:

CFLAGS_FOR_BUILD = -O1 CXXFLAGS_FOR_BUILD = -o1 cflags_for_host = -o1 / cxxflags_for_host = -o1 cflags_for_target = -O1 cxxflags_for_target = -O1

For Linux users

Enter the compilation directory:

$ CD RTEMS-I386

Configure

. ../rtems-4.6.2/configure - Target = i386-RTEMS --DISABLE-POSIX - DISABLE-NETWORKING --DISABLE-CXX --Nable-RTemsbsp = i386EX --PREFIX = / home / ray / RTEMS / RTEMS-Build

Then compile:

$ GMAKE RTEMS_BSP = "BSP1 BSP2 ..."

E.g:

GMAKE RTEMS_BSP = PC586

It should be noted that in most Linux versions, the default Make is Gmake! You can also use the following configuration command examples:

$ ../rtems-4.6.2/configure --target = i386-rTem --disable-Posix --disable-networking --disable-cxx --enable-rtemsbsp = pc386 - prefix = / home / ray / RTEMS / RTEMS-Build $ GMAKE this example

Direct PC386 Code Example 2:

. ../rtems-4.6.2/configure - Target = i386-rtems / - enable-rtemsbsp = i386 / - prefix = / home / ray all install

Produces all I386 BSP (including PC386, PC586, PC686 ...)

Example 3:

. ../rtems-4.6.2/configure - Target = i386-RTEMS / - DISABLE-POSIX --DISABLE-NETWORKING --DISABLE-CXX / - Enable-RTemsbsp = i386EX / - prefix = / home / ray / RTEMS / RTEMS-Build

Here the toolchain is installed in the / home / ray / Embedded / Toolchain / directory.

Example 4:

. ../rtems-4.6.2/configure - Target = i386-RTEMS / - DISABLE-POSIX --DISABLE-NETWORKING - DISABLE-CXX / - Enable-RTemsbsp = PC686 / - prefix = / home / ray / RTEMS / RTEMS-Build

Generate the Makefile of the PC686.

Pay attention to space! ! = I can't have spaces after the number, / Before you have a space

转载请注明原文地址:https://www.9cbs.com/read-63347.html

New Post(0)