README.md: Update to RTEMS 6

This commit is contained in:
Sebastian Huber 2022-05-12 14:52:36 +02:00
parent 0ad7038558
commit 95fde102a8

View File

@ -8,23 +8,22 @@ package is designed to be updated from the FreeBSD kernel sources and contains
more than just the networking code. more than just the networking code.
To build this package you need a current RTEMS tool set for your architecture, 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 and a recent RTEMS kernel for your BSP installed. If you already have this, you
built and installed. If you already have this you can skip to step 3 of the can skip to step 5 of the build procedure.
build procedure.
Building and Installing LibBSD Building and Installing LibBSD
------------------------------ ------------------------------
The following instructions show you how to build and install RTEMS Tools and The following instructions show you how to build and install the RTEMS Tool
RTEMS kernel for your BSP in separate paths. Using separate paths for the tools Suite for the `arm` target, the RTEMS kernel using the
and BSPs lets you manage what you have installed. If you are happy with a `arm/xilinx_zynq_a9_qemu` Board Support Package (BSP), and the LibBSD for this
single path you can use the same path in each stage. BSP.
The Waf build support for RTEMS requires you provide your BSP name as an 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 architecture and BSP pair. You must provide both or Waf will generate an error
message during the configure phase. message during the configure phase.
We will build an Xilinx Zynq QEMU BSP using the name We will build an Xilinx Zynq Qemu BSP using the name
*arm/xilinx_zynq_a9_qemu*. You can copy and paste the shell commands below to *arm/xilinx_zynq_a9_qemu*. You can copy and paste the shell commands below to
do this. The individual steps are explained afterwards. do this. The individual steps are explained afterwards.
@ -37,30 +36,23 @@ git clone git://git.rtems.org/rtems.git
git clone git://git.rtems.org/rtems-libbsd.git git clone git://git.rtems.org/rtems-libbsd.git
cd "$sandbox" cd "$sandbox"
cd rtems-source-builder/rtems cd rtems-source-builder/rtems
../source-builder/sb-set-builder --prefix="$sandbox/rtems/5" 5/rtems-arm ../source-builder/sb-set-builder --prefix="$sandbox/rtems/6" 6/rtems-arm
cd "$sandbox" cd "$sandbox"
cd rtems cd rtems
PATH="$sandbox/rtems/5/bin:$PATH" ./bootstrap echo -e "[arm/xilinx_zynq_a9_qemu]\nRTEMS_POSIX_API = True" > config.ini
cd "$sandbox" ./waf configure --prefix "$sandbox/rtems/6"
mkdir b-xilinx_zynq_a9_qemu ./waf
cd b-xilinx_zynq_a9_qemu ./waf install
PATH="$sandbox/rtems/5/bin:$PATH" "$sandbox/rtems/configure" \
--target=arm-rtems5 --prefix="$sandbox/rtems/5" \
--disable-networking --enable-rtemsbsp=xilinx_zynq_a9_qemu
PATH="$sandbox/rtems/5/bin:$PATH" make
PATH="$sandbox/rtems/5/bin:$PATH" make install
cd "$sandbox" cd "$sandbox"
cd rtems-libbsd cd rtems-libbsd
git submodule init git submodule init
git submodule update rtems_waf git submodule update rtems_waf
./waf configure --prefix="$sandbox/rtems/5" \ ./waf configure --prefix="$sandbox/rtems/6" \
--rtems-bsps=arm/xilinx_zynq_a9_qemu \ --rtems-bsps=arm/xilinx_zynq_a9_qemu \
--buildset=buildset/default.ini --buildset=buildset/default.ini
./waf ./waf
./waf install ./waf install
qemu-system-arm -no-reboot -serial null -serial mon:stdio -net none \ ../rtems/6/bin/rtems-test --rtems-bsp=xilinx_zynq_a9_qemu build
-nographic -M xilinx-zynq-a9 -m 256M \
-kernel build/arm-rtems5-xilinx_zynq_a9_qemu-default/selectpollkqueue01.exe
``` ```
1. Create a sandbox directory: 1. Create a sandbox directory:
@ -84,31 +76,21 @@ $ git clone git://git.rtems.org/rtems-libbsd.git
``` ```
$ cd "$sandbox" $ cd "$sandbox"
$ cd rtems-source-builder/rtems $ cd rtems-source-builder/rtems
$ ../source-builder/sb-set-builder --prefix="$sandbox/rtems/5" 5/rtems-arm $ ../source-builder/sb-set-builder --prefix="$sandbox/rtems/6" 6/rtems-arm
``` ```
4. Bootstrap the RTEMS sources: 4. Build and install the RTEMS Board Support Packages (BSP) you want to use:
``` ```
$ cd "$sandbox" $ cd "$sandbox"
$ cd rtems $ cd rtems
$ PATH="$sandbox/rtems/5/bin:$PATH" ./bootstrap $ echo -e "[arm/xilinx_zynq_a9_qemu]\nRTEMS_POSIX_API = True" > config.ini
$ ./waf configure --prefix "$sandbox/rtems/6"
$ ./waf
$ ./waf install
``` ```
5. Build and install the RTEMS Board Support Packages (BSP) you want to use: 5. Populate the rtems_waf git submodule. Note, make sure you specify
```
$ cd "$sandbox"
$ mkdir b-xilinx_zynq_a9_qemu
$ cd b-xilinx_zynq_a9_qemu
$ PATH="$sandbox/rtems/5/bin:$PATH" "$sandbox/rtems/configure" \
--target=arm-rtems5 --prefix="$sandbox/rtems/5" \
--disable-networking --enable-rtemsbsp=xilinx_zynq_a9_qemu
$ PATH="$sandbox/rtems/5/bin:$PATH" make
$ PATH="$sandbox/rtems/5/bin:$PATH" make install
```
6. Populate the rtems_waf git submodule. Note, make sure you specify
'rtems_waf' or the FreeBSD kernel source will be cloned: 'rtems_waf' or the FreeBSD kernel source will be cloned:
``` ```
@ -118,7 +100,7 @@ $ git submodule init
$ git submodule update rtems_waf $ git submodule update rtems_waf
``` ```
7. Run Waf's configure with your specific settings. In this case the path to 6. 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 the tools and RTEMS are provided on the command line and so do not need to
be in your path or environment [1]. You can use be in your path or environment [1]. You can use
'--rtems-archs=arm,sparc,i386' or '--rtems-archs=arm,sparc,i386' or
@ -133,12 +115,12 @@ $ git submodule update rtems_waf
``` ```
$ cd "$sandbox" $ cd "$sandbox"
$ cd rtems-libbsd $ cd rtems-libbsd
$ ./waf configure --prefix="$sandbox/rtems/5" \ $ ./waf configure --prefix="$sandbox/rtems/6" \
--rtems-bsps=arm/xilinx_zynq_a9_qemu \ --rtems-bsps=arm/xilinx_zynq_a9_qemu \
--buildset=buildset/default.ini --buildset=buildset/default.ini
``` ```
8. Build and install. The LibBSD package will be installed into the prefix 7. Build and install. The LibBSD package will be installed into the prefix
provided to configure: provided to configure:
``` ```
@ -148,23 +130,22 @@ $ ./waf
$ ./waf install $ ./waf install
``` ```
9. Run the tests on QEMU, for example using VDE: 9. Run the tests:
``` ```
$ qemu-system-arm -no-reboot -serial null -serial mon:stdio \ $ cd "$sandbox"
-net nic,model=cadence_gem -net vde,id=vde0,sock=/tmp/vde1 \ $ cd rtems-libbsd
-nographic -M xilinx-zynq-a9 -m 256M \ $ ../rtems/6/bin/rtems-test --rtems-bsp=xilinx_zynq_a9_qemu build
-kernel build/arm-rtems5-xilinx_zynq_a9_qemu/selectpollkqueue01.exe
``` ```
[1] It is good practice to keep your environment as empty as possible. Setting 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 paths to tools or specific values to configure or control a build is dangerous
dangerous because settings can leak between different builds and change because settings can leak between different builds and change what you expect a
what you expect a build to do. The Waf tool used here lets you specify on build to do. The Waf tool used here lets you specify on the command line the
the command line the tools and RTEMS paths and this is embedded in Waf's tools and RTEMS paths and this is embedded in Waf's configuration information.
configuration information. If you have a few source trees working at any If you have a few source trees working at any one time with different tool sets
one time with different tool sets or configurations you can easly move or configurations you can easly move between them safe in the knowledge that
between them safe in the knowledge that one build will not infect another. one build will not infect another.
Branches Branches
-------- --------
@ -273,7 +254,7 @@ qemu-system-arm -serial null -serial mon:stdio -nographic \
-M xilinx-zynq-a9 -m 256M \ -M xilinx-zynq-a9 -m 256M \
-net tap,ifname=qtap,script=no,downscript=no \ -net tap,ifname=qtap,script=no,downscript=no \
-net nic,model=cadence_gem,macaddr=0e:b0:ba:5e:ba:12 \ -net nic,model=cadence_gem,macaddr=0e:b0:ba:5e:ba:12 \
-kernel build/arm-rtems5-xilinx_zynq_a9_qemu-default/media01.exe -kernel build/arm-rtems6-xilinx_zynq_a9_qemu-default/media01.exe
``` ```
After some seconds it will acquire a IPv4 link-local address, e.g. After some seconds it will acquire a IPv4 link-local address, e.g.