Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
RTEMS BSD Porting project.
C Python C++ Logos Makefile Java Other
Branch: master
Failed to load latest commit information.
dhcpcd DHCPCD(8): Add MASTER_ONLY option
freebsd-org @ 99a648a Update freebsd-org submodule
freebsd PCI: Enable some functions
mDNSResponder mDNS: Avoid uninitialized memory
patches Tool patches: Add newlib patch needed
rtems-dummy-pic-irq/include/bsp Add dummy PIC IRQ support for Simple Vectored Architectures
rtems_waf @ 7bcf72b Add support to build using waf.
rtemsbsd nexus-devices: Add pc386 nexus device and drivers
services Update files to match FreeBSD layout
testsuite Update due to header guard changes
.gitignore Add support to build using waf.
.gitmodules Add support to build using waf.
Changes kern/kern_subr.c added for hashinit
Makefile TCPDUMP and PCAP fixes to defines.
Makefile.todo mmc: Import MMC/SDCard support from libusb
README.waf waf: Update the README.waf with better documentation.
builder.py Add tcpdump and libpcap.
config.inc Fix install Makefile target
freebsd-to-rtems.py Add tcpdump and libpcap.
libbsd.py e1000: Add missing file
libbsd.txt libbsd.txt: Clarify rules to modify FreeBSD code
makefile.py Add tcpdump and libpcap.
waf_generator.py waf_generator.py: Move arch header includes
wscript waf_generator.py: Move arch header includes

README.waf

RTEMS LibBSD Waf
~~~~~~~~~~~~~~~~

Welcome to building LibBSD for RTEMS using Waf. This package is a library
containing various parts of the FreeBSD kernel ported to RTEMS. The library
replaces the networking port of FreeBSD in the RTEMS kernel sources. This
package is designed to be updated from the FreeBSD kernel sources and contains
more than just the networking code.

To build this package you need a current RTEMS tool set for your architecture,
and a recent RTEMS kernel for your BSP configured with networking disabled
built and installed. If you already have this you can skip to step 3 of the
build procedure.

Waf Setup
~~~~~~~~~

You can find the Waf project at:

 https://waf.io/

Waf is not intended to be installed by distribution packages so we recommend
you download a recent waf version and install it in your home directory.

Waf is a Python program so you will also need to have a current Python version
installed and in your path.

Download the latest signed executable file version to $HOME/bin and symlink it
to waf. Add the directory $HOME/bin to your path if it is not already in your
default path.

Building and Installing LibBSD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following instructions show you how to build and install RTEMS Tools and
RTEMS kernel for your BSP in separate paths. Using separate paths for the tools
and BSPs lets you manage what you have installed. If you are happy with a
single path you can use the same path in each stage.

The waf build support for RTEMS requires you provide your BSP name as an
architecture and BSP pair. You must provide both or waf will generate an error
message during the configure phase.

We will build an ARM Realview PBX A9 QEMU BSP using the name
'arm/realview_pbx_a9_qemu'.

Steps
-----

1. Build and install the tools. In this example the path is
   /opt/rtems/4.11/tools:

    $ cd rtems-source-builder/rtems
    $ ../souce-builder/sb-set-builder \
            --prefix=/opt/rtems/4.11/tools 4.11/rtems-arm

2. Build and install the RTEMS Board Support Packages (BSP) you want to use. In
   this example the path is /opt/rtems/4.11/bsps:

    $ mkdir realview_pbx_a9_qemu
    $ cd realview_pbx_a9_qemu
    $ ../rtems-4.11/configure \
            --target=arm-rtems4.11 --prefix=/opt/rtems/4.11/bsps \
            --disable-networking --enable-rtemsbsp=realview_pbx_a9_qemu
    $ make
    $ make install

3. Populate the rtems_waf git submodule:

    $ cd rtems-libbsd
    $ git submodule init
    $ git submodule update rtems_waf

   Note, make sure you specify 'rtems_waf' or the FreeBSD kernel source will be
   cloned.

4. Run Waf's configure with your specific settings. In this case the path to
   the tools and RTEMS are provided on the command line and so do not need to
   be in your path or environment [1]:

    $ waf configure --prefix=/opt/rtems/4.11/bsps \
                    --rtems=/opt/rtems/4.11/bsps \
                    --rtems-tools=/opt/rtems/4.11/tools \
                    --rtems-bsps=arm/realview_pbx_a9_qemu

   You can use '--rtems-archs=arm,sparc,i386' or
   '--rtems-bsps=arm/realview_pbx_a9_qemu,sparc/sis,i386/pc586' to build for
   more than BSP at a time.

   Note, you must provide the architecture and BSP as a pair. Providing just the
   BSP name will fail.

6. Build and install:

   The LibBSD package will be installed into the prefix provided to configure.

   $ waf
   $ waf install

[1] It is good practice to keep your environment as empty as possible. Setting
    paths to tools or specific values to configure or control a build is
    dangerous because settings can leak between different builds and change
    what you expect a build to do. The waf tool used here lets you specify on
    the command line the tools and RTEMS paths and this is embedded in waf's
    configuration information. If you have a few source trees working at any
    one time with different tool sets or configurations you can easly move
    between them safe in the knowledge that one build will not infect another.
Something went wrong with that request. Please try again.