rtems qemu
系统信息
[root@centos7 ~]# qemu-system-aarch64 -version QEMU emulator version 4.2.0 Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers [root@centos7 ~]# uname -a Linux centos7 4.14.0-115.el7a.0.1.aarch64 #1 SMP Sun Nov 25 20:54:21 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux [root@centos7 ~]# lscpu Architecture: aarch64 Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Thread(s) per core: 1 Core(s) per socket: 64 Socket(s): 2 NUMA node(s): 4 Model: 0 CPU max MHz: 2600.0000 CPU min MHz: 200.0000 BogoMIPS: 200.00 L1d cache: 64K L1i cache: 64K L2 cache: 512K L3 cache: 65536K NUMA node0 CPU(s): 0-31 NUMA node1 CPU(s): 32-63 NUMA node2 CPU(s): 64-95 NUMA node3 CPU(s): 96-127 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop [root@centos7 ~]#
rtems 版本
[root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -serial null -serial mon:stdio -net none -nographic -M xilinx-zynq-a9 -m 256M -kernel o-optimize/hello.exe qemu-system-aarch64: GLib: g_mapped_file_unref: assertion 'file != NULL' failed
改成低版本rtems
[root@centos7 rtems]# git checkout -b remotes/origin/5 Switched to a new branch 'remotes/origin/5' [root@centos7 rtems]# git branch master * remotes/origin/5 [root@centos7 rtems]#
[root@centos7 rtems]# git checkout 5 Branch 5 set up to track remote branch 5 from origin. Switched to a new branch '5' [root@centos7 rtems]# ./waf bsp_list -bash: ./waf: No such file or directory [root@centos7 rtems]# ls acinclude.m4 bootstrap c config.ini config.sub depcomp INSTALL LICENSE.BSD-2-Clause LICENSE.JFFS2 MAINTAINERS Makefile.maint README rtemslogo.png aclocal bsps compile config.ini.bak configure.ac Doxyfile install-sh LICENSE.CC-BY-SA-4.0 LICENSE.NET make mdate-sh rtems-bootstrap testsuites automake build config.guess config-ml.in cpukit gccdeps.pyc LICENSE LICENSE.GPL-2.0 LICENSE.RPCXDR Makefile.am missing rtems-bsps [root@centos7 rtems]#
[root@centos7 development]# ls rtems rtems_rv [root@centos7 development]# du -sh rtems 8.2G rtems --可以用的 [root@centos7 development]# du -sh rtems_rv 2.0G rtems_rv [root@centos7 development]# cd rtems [root@centos7 rtems]# ls compiler kernel profile rtems-examples rtems-source-builder [root@centos7 rtems]# du -sh compiler 1.1G compiler [root@centos7 rtems]# du -sh * 1.1G compiler 615M kernel 4.0K profile 18M rtems-examples 7.0G rtems-source-builder [root@centos7 rtems]#
[root@centos7 rtems]# ./bootstrap -c removing automake generated Makefile.in files removing configure files removing aclocal.m4 files [root@centos7 rtems]# ./rtems-bootstrap RTEMS Bootstrap, 1.0 1/121: autoreconf: configure.ac 2/121: autoreconf: c/configure.ac 3/121: autoreconf: c/src/configure.ac 4/121: autoreconf: c/src/lib/libbsp/arm/configure.ac 5/121: autoreconf: c/src/lib/libbsp/arm/altera-cyclone-v/configure.ac 6/121: autoreconf: c/src/lib/libbsp/arm/atsam/configure.ac 7/121: autoreconf: c/src/lib/libbsp/arm/beagle/configure.ac 8/121: autoreconf: c/src/lib/libbsp/arm/csb336/configure.ac 9/121: autoreconf: c/src/lib/libbsp/arm/csb337/configure.ac 10/121: autoreconf: c/src/lib/libbsp/arm/edb7312/configure.ac 11/121: autoreconf: c/src/lib/libbsp/arm/gumstix/configure.ac 12/121: autoreconf: c/src/lib/libbsp/arm/imx/configure.ac 13/121: autoreconf: c/src/lib/libbsp/arm/lm3s69xx/configure.ac 14/121: autoreconf: c/src/lib/libbsp/arm/lpc176x/configure.ac 15/121: autoreconf: c/src/lib/libbsp/arm/lpc24xx/configure.ac 16/121: autoreconf: c/src/lib/libbsp/arm/lpc32xx/configure.ac
[root@centos7 xilinx_zynq_a9_qemu]# $HOME/development/rtems/kernel/rtems/configure --prefix=$HOME/development/rtems/compiler/6 --enable-maintainer-mode --target=rtems-aarch64 --enable-rtemsbsp=xilinx_zynq_a9_qemu --enable-tests --enable-posix --disable-networking --enable-cxx
checking for gmake... gmake
checking for RTEMS Version... 5.0.0
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... Invalid configuration `rtems-aarch64': machine `rtems' not recognized
configure: error: /bin/sh /root/development/rtems/kernel/rtems/./config.sub rtems-aarch64 failed
[root@centos7 xilinx_zynq_a9_qemu]#
改成
新版本采用waf,老版本采用configure
[root@centos7 xilinx_zynq_a9_qemu]# $HOME/development/rtems/kernel/rtems/configure --prefix=$HOME/development/rtems/compiler/6 --enable-maintainer-mode --target=aarch64-rtems --enable-rtemsbsp=xilinx_zynq_a9_qemu --enable-tests --enable-posix --disable-networking --enable-cxx checking for gmake... gmake checking for RTEMS Version... 5.0.0 checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-rtems checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether gmake sets $(MAKE)... yes checking whether gmake supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... yes configure: error: BSP 'xilinx_zynq_a9_qemu' architecture does not match the --target architecture, run 'rtems-bsps' (in the top of the source tree) for a valid BSP list [root@centos7 xilinx_zynq_a9_qemu]#
[root@centos7 xilinx_zynq_a9_qemu]# ls arm-rtems5 config.log config.status Makefile [root@centos7 xilinx_zynq_a9_qemu]#
[root@centos7 rtems]# ./rtems-bsps -P arm/altcycv_devkit arm/atsamv arm/bbxm arm/beagleboardorig arm/beagleboardxm arm/beagleboneblack arm/beaglebonewhite arm/csb336 arm/csb337 arm/csb637 arm/kit637_v6 arm/edb7312 arm/gumstix arm/imx7 arm/lm3s3749 arm/lm3s6965 arm/lm3s6965_qemu arm/lm4f120 arm/lpc1768_mbed arm/lpc1768_mbed_ahb_ram arm/lpc1768_mbed_ahb_ram_eth arm/lpc17xx_ea_ram arm/lpc17xx_ea_rom_int arm/lpc17xx_plx800_ram arm/lpc17xx_plx800_rom_int arm/lpc2362 arm/lpc23xx_tli800 arm/lpc24xx_ea arm/lpc24xx_ncs_ram arm/lpc24xx_ncs_rom_ext arm/lpc24xx_ncs_rom_int arm/lpc24xx_plx800_ram arm/lpc24xx_plx800_rom_int arm/lpc40xx_ea_ram arm/lpc40xx_ea_rom_int arm/lpc32xx_mzx arm/lpc32xx_mzx_stage_1 arm/lpc32xx_mzx_stage_2 arm/lpc32xx_phycore arm/raspberrypi arm/raspberrypi2 arm/realview_pbx_a9_qemu arm/rtl22xx arm/rtl22xx_t arm/smdk2410 arm/stm32f105rc arm/stm32f4 arm/tms570ls3137_hdk arm/tms570ls3137_hdk_intram arm/tms570ls3137_hdk_sdram arm/tms570ls3137_hdk_with_loader arm/xen_virtual arm/xilinx_zynq_a9_qemu arm/xilinx_zynq_zc702 arm/xilinx_zynq_zc706 arm/xilinx_zynq_zedboard arm/xilinx_zynqmp_ultra96 bfin/TLL6527M bfin/bf537Stamp bfin/eZKit533
第一步
mkdir /root/development/rtems/compiler/6/
[root@centos7 rtems]# ../source-builder/sb-set-builder --log=build-log.txt --prefix=$HOME/development/rtems/compiler/6 6/rtems-aarch64 RTEMS Source Builder - Set Builder, 6 (889cf95db012) Build Set: 6/rtems-aarch64 config: devel/expat-2.1.0-1.cfg package: expat-2.1.0-aarch64-linux-gnu-1 warning: checksum error: expat-2.1.0.tar.gz building: expat-2.1.0-aarch64-linux-gnu-1
改成master支持aarch64
参考https://docs.rtems.org/branches/master/user/bsps/bsps-aarch64.html
[root@centos7 rtems]# git branch --all * 5 master remotes/origin/4.10 remotes/origin/4.11 remotes/origin/4.8 remotes/origin/4.9 remotes/origin/5 remotes/origin/HEAD -> origin/master remotes/origin/master [root@centos7 rtems]# git checkout master Switched to branch 'master' [root@centos7 rtems]# ./waf bsp_list Regenerate build specification cache (needs a couple of seconds)... aarch64/a53_ilp32_qemu aarch64/a53_lp64_qemu aarch64/a72_ilp32_qemu aarch64/a72_lp64_qemu aarch64/xilinx_versal_ilp32_qemu aarch64/xilinx_versal_ilp32_vck190 aarch64/xilinx_versal_lp64_qemu aarch64/xilinx_versal_lp64_vck190 aarch64/xilinx_zynqmp_ilp32_qemu aarch64/xilinx_zynqmp_ilp32_zu3eg aarch64/xilinx_zynqmp_lp64_qemu aarch64/xilinx_zynqmp_lp64_zu3eg
第二步
./waf distclean
[root@centos7 rtems]# ./waf bsp_defaults --rtems-bsps=aarch64/a53_lp64_qemu > config.ini [root@centos7 rtems]# ./waf configure --prefix=$HOME/development/rtems/compiler/6 Setting top to : /root/development/rtems/kernel/rtems Setting out to : /root/development/rtems/kernel/rtems/build Configure board support package (BSP) : aarch64/a53_lp64_qemu Checking for program 'aarch64-rtems6-gcc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'aarch64-rtems6-g++' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-g++ Checking for program 'aarch64-rtems6-ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'aarch64-rtems6-ld' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ld Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'g++, c++' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-g++ Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'gas, gcc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'gcc, cc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for asm flags '-MMD' : yes Checking for c flags '-MMD' : yes Checking for cxx flags '-MMD' : yes 'configure' finished successfully (0.652s) [root@centos7 rtems]# ./waf
[1378/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/base_sp.exe [1379/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/capture.exe [1380/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/cdtest.exe [1381/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/fileio.exe [1382/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/hello.exe [1383/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/iostream.exe [1384/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/nsecs.exe [1385/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/ticker.exe [1386/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/unlimited.exe [1387/1391] Linking build/aarch64/a53_lp64_qemu/libz.a [1388/1391] Linking build/aarch64/a53_lp64_qemu/libdebugger.a [1389/1391] Linking build/aarch64/a53_lp64_qemu/librtemscxx.a [1390/1391] Linking build/aarch64/a53_lp64_qemu/testsuites/samples/paranoia.exe [1391/1391] Linking build/aarch64/a53_lp64_qemu/libmghttpd.a Waf: Leaving directory `/root/development/rtems/kernel/rtems/build/aarch64/a53_lp64_qemu' 'build_aarch64/a53_lp64_qemu' finished successfully (6.474s) [root@centos7 rtems]# ls /root/development/rtems/kernel/rtems/build/aarch64/a53_lp64_qemu a53_lp64_qemu.cfg bsp.cfg cpukit libftpd.a libjffs2.a librtemsbsp.a librtemscxx.a librtemstest.a libtftpfs.a linkcmds start.d target.cfg aarch64-rtems6-a53_lp64_qemu.pc bsps libdebugger.a libftpfs.a libmghttpd.a librtemscpu.a librtemsdefaultconfig.a libtelnetd.a libz.a Makefile.inc start.o testsuites [root@centos7 rtems]# ls /root/development/rtems/compiler/6/ aarch64-rtems6/ bin/ include/ lib/ libexec/ make/ share/ [root@centos7 rtems]#
第三步
[root@centos7 rtems]# ./waf install Waf: Entering directory `/root/development/rtems/kernel/rtems/build' Waf: Leaving directory `/root/development/rtems/kernel/rtems/build' 'install' finished successfully (0.501s) Waf: Entering directory `/root/development/rtems/kernel/rtems/build/aarch64/a53_lp64_qemu' + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/linkcmds.base (from bsps/aarch64/shared/start/linkcmds.base) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp/linker-symbols.h (from bsps/aarch64/include/bsp/linker-symbols.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/start.o (from build/aarch64/a53_lp64_qemu/start.o) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/clock/arm-generic-timer.h (from bsps/include/dev/clock/arm-generic-timer.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/irq/arm-gic-arch.h (from bsps/aarch64/include/dev/irq/arm-gic-arch.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp.h (from bsps/aarch64/a53/include/bsp.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp/irq.h (from bsps/aarch64/a53/include/bsp/irq.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp/start.h (from bsps/aarch64/include/bsp/start.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/libchip/am29lv160.h (from bsps/include/libchip/am29lv160.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp/bootcard.h (from bsps/include/bsp/bootcard.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/tm27.h (from bsps/aarch64/a53/include/tm27.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/ofw/ofw.h (from bsps/include/ofw/ofw.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/irq/arm-gic-irq.h (from bsps/include/dev/irq/arm-gic-irq.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/serial/arm-pl011-regs.h (from bsps/include/dev/serial/arm-pl011-regs.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/libchip/ata.h (from bsps/include/libchip/ata.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/libchip/mc146818a.h (from bsps/include/libchip/mc146818a.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/rtems/zilog/z8036.h (from bsps/include/rtems/zilog/z8036.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/bsp/console-polled.h (from bsps/include/bsp/console-polled.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/ofw/ofw_compat.h (from bsps/include/ofw/ofw_compat.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/irq/arm-gic-regs.h (from bsps/include/dev/irq/arm-gic-regs.h) + install /root/development/rtems/compiler/6/lib/pkgconfig/aarch64-rtems6-a53_lp64_qemu.pc (from build/aarch64/a53_lp64_qemu/aarch64-rtems6-a53_lp64_qemu.pc) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/dev/serial/arm-pl011.h (from bsps/include/dev/serial/arm-pl011.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/make/bsp.cfg (from build/aarch64/a53_lp64_qemu/bsp.cfg) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/arm/ti/ti_pinmux.h (from bsps/include/arm/ti/ti_pinmux.h) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/libchip/mc68681.h (from bsps/include/libchip/mc68681.h) + install /root/development/rtems/compiler/6/make/custom/a53_lp64_qemu.cfg (from build/aarch64/a53_lp64_qemu/a53_lp64_qemu.cfg) + install /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include/rtems/zilog/z8530.h (from bsps/include/rtems/zilog/z8530.h)
[root@centos7 rtems]# ls /root/development/rtems/compiler/6/aarch64-rtems6/ a53_lp64_qemu bin include lib xilinx_zynqmp_lp64_qemu [root@centos7 rtems]# ls /root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/ lib make Makefile.inc [root@centos7 rtems]#
rtems-libbsd-可选
[root@centos7 rtems-libbsd]# ./waf configure --prefix=$HOME/development/rtems/compiler/6 --rtems-bsps=aarch64/a53_lp64_qemu Setting top to : /root/development/rtems/rtems-libbsd Setting out to : /root/development/rtems/rtems-libbsd/build RTEMS Version : 6 Architectures : aarch64-rtems6 Board Support Package (BSP) : aarch64-rtems6-a53_lp64_qemu Show commands : no Long commands : no Checking for program 'aarch64-rtems6-gcc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'aarch64-rtems6-g++' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-g++ Checking for program 'aarch64-rtems6-gcc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'aarch64-rtems6-ld' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ld Checking for program 'aarch64-rtems6-ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'aarch64-rtems6-nm' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-nm Checking for program 'aarch64-rtems6-objdump' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-objdump Checking for program 'aarch64-rtems6-objcopy' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-objcopy Checking for program 'aarch64-rtems6-readelf' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-readelf Checking for program 'aarch64-rtems6-strip' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-strip Checking for program 'aarch64-rtems6-ranlib' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ranlib Checking for program 'rtems-ld' : /root/development/rtems/compiler/6/bin/rtems-ld Checking for program 'rtems-tld' : /root/development/rtems/compiler/6/bin/rtems-tld Checking for program 'rtems-syms' : /root/development/rtems/compiler/6/bin/rtems-syms Checking for program 'rtems-bin2c' : /root/development/rtems/compiler/6/bin/rtems-bin2c Checking for program 'tar' : /usr/bin/tar Checking for program 'gcc, cc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'g++, c++' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-g++ Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for program 'gas, gcc' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-gcc Checking for program 'ar' : /root/development/rtems/compiler/6/bin/aarch64-rtems6-ar Checking for c flags '-MMD' : yes Checking for cxx flags '-MMD' : yes Compiler version (aarch64-rtems6-gcc) : 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) Checking for a valid RTEMS BSP installation : yes Checking for RTEMS_DEBUG : no Checking for RTEMS_MULTIPROCESSING : no Checking for RTEMS_NEWLIB : yes Checking for RTEMS_POSIX_API : no Checking for RTEMS_SMP : no Checking for RTEMS_NETWORKING : no Checking for header dlfcn.h : yes Checking for header rtems/pci.h : yes RTEMS kernel POSIX support is disabled; configure RTEMS with --enable-posix (complete log in /root/development/rtems/rtems-libbsd/build/config.log) [root@centos7 rtems-libbsd]#
编译hello
[root@centos7 hello_world_c]# export RTEMS_MAKEFILE_PATH=/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu [root@centos7 hello_world_c]# make make: Nothing to be done for `default_target'. [root@centos7 hello_world_c]# make clean rm -f a.out core mon.out gmon.out rm -f -r rm -f -r a.out *.o *.BAK Depends-o-optimize.tmp rm -f -r o-optimize o-debug [root@centos7 hello_world_c]# make test -d o-optimize || mkdir o-optimize aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -c -o o-optimize/test.o test.c aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -B/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib -qrtems -Wl,--gc-sections -mcpu=cortex-a53 -o o-optimize/hello.exe o-optimize/test.o aarch64-rtems6-nm -g -n o-optimize/hello.exe > o-optimize/hello.num aarch64-rtems6-size o-optimize/hello.exe text data bss dec hex filename 76144 1856 134105400 134183400 7ff79e8 o-optimize/hello.exe cp o-optimize/hello.exe o-optimize/hello.ralf [root@centos7 hello_world_c]#
[root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -serial null -serial mon:stdio -net none -nographic -M xilinx-zynq-a9 -m 256M -kernel o-optimize/hello.exe qemu-system-aarch64: GLib: g_mapped_file_unref: assertion 'file != NULL' failed [root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/hello.exe *** FATAL *** fatal source: 6 (RTEMS_FATAL_SOURCE_BSP) fatal code: 11 (0x0000000b) RTEMS version: 6.0.0.671f126a3a8e6ce5da87aa75c7205fb764e95c78 RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x089010001 executing thread name: IDLE
gdb
[root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/hello.exe *** FATAL *** fatal source: 6 (RTEMS_FATAL_SOURCE_BSP) fatal code: 11 (0x0000000b) RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x089010001 executing thread name: IDLE [root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/hello.exe -S -gdb tcp::8889
[root@centos7 rtems]# cat profile export PATH=$HOME/development/rtems/compiler/6/bin:$PATH [root@centos7 rtems]# ls $HOME/development/rtems/compiler/6/bin aarch64-rtems6-addr2line aarch64-rtems6-cpp aarch64-rtems6-gcc-ar aarch64-rtems6-gcov-tool aarch64-rtems6-ld.bfd aarch64-rtems6-readelf mkimage.py rtems-exeinfo rtems-run rtems-tld aarch64-rtems6-ar aarch64-rtems6-elfedit aarch64-rtems6-gcc-nm aarch64-rtems6-gdb aarch64-rtems6-nm aarch64-rtems6-run rtems-addr2line rtems-ld rtems-syms trace-converter aarch64-rtems6-as aarch64-rtems6-g++ aarch64-rtems6-gcc-ranlib aarch64-rtems6-gdb-add-index aarch64-rtems6-objcopy aarch64-rtems6-size rtems-bin2c rtems-ra rtems-test xmlwf aarch64-rtems6-c++ aarch64-rtems6-gcc aarch64-rtems6-gcov aarch64-rtems6-gprof aarch64-rtems6-objdump aarch64-rtems6-strings rtems-boot-image rtems-rap rtems-tftp-proxy aarch64-rtems6-c++filt aarch64-rtems6-gcc-10.3.1 aarch64-rtems6-gcov-dump aarch64-rtems6-ld aarch64-rtems6-ranlib aarch64-rtems6-strip rtems-bsp-builder rtems-record-lttng rtems-tftp-server [root@centos7 rtems]# ls compiler kernel profile rtems-examples rtems-source-builder [root@centos7 rtems]# cd rtems-examples/hello/ both_hello/ hello_world_c/ Makefile posix_hello_world/ wscript [root@centos7 rtems]# cd rtems-examples/hello/hello_world_c/ [root@centos7 hello_world_c]# ls Makefile o-optimize test.c wscript [root@centos7 hello_world_c]# cd o-optimize/ [root@centos7 o-optimize]# ls hello.exe hello.num hello.ralf test.o [root@centos7 o-optimize]# aarch64-rtems6-gdb hello.exe GNU gdb (GDB) 10.1.90.20210409-git Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=aarch64-linux-gnu --target=aarch64-rtems6". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from hello.exe... (gdb) target remote :8889 Remote debugging using :8889 bsp_vector_table_begin () at ../../../bsps/aarch64/shared/start/start.S:55 55 mov x5, x1 /* machine type number or ~0 for DT boot */ (gdb) break start_kernel Function "start_kernel" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb)
(gdb) load Loading section .start, size 0x1fc lma 0x40008000 Loading section .text, size 0x10220 lma 0x40008800 Loading section .init, size 0x34 lma 0x40018a20 Loading section .fini, size 0x34 lma 0x40018a54 Loading section .rodata, size 0x2450 lma 0x40018a88 Loading section .eh_frame, size 0x4 lma 0x4001aed8 Loading section .init_array, size 0x8 lma 0x4001aee0 Loading section .fini_array, size 0x8 lma 0x4001aee8 Loading section .rtemsroset, size 0x98 lma 0x4001aef0 Loading section .data, size 0x730 lma 0x40100000 Start address 0x0000000040008000, load size 78000 Transfer rate: 8463 KB/sec, 1695 bytes/write. (gdb)
[root@centos7 o-optimize]# aarch64-rtems6-gdb hello.exe GNU gdb (GDB) 10.1.90.20210409-git Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=aarch64-linux-gnu --target=aarch64-rtems6". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from hello.exe... (gdb) load You can't do that when your target is `exec' (gdb) r Don't know how to run. Try "help target". (gdb) target remote :8889 Remote debugging using :8889 bsp_vector_table_begin () at ../../../bsps/aarch64/shared/start/start.S:55 55 mov x5, x1 /* machine type number or ~0 for DT boot */ (gdb) load Loading section .start, size 0x1fc lma 0x40008000 Loading section .text, size 0x10220 lma 0x40008800 Loading section .init, size 0x34 lma 0x40018a20 Loading section .fini, size 0x34 lma 0x40018a54 Loading section .rodata, size 0x2450 lma 0x40018a88 Loading section .eh_frame, size 0x4 lma 0x4001aed8 Loading section .init_array, size 0x8 lma 0x4001aee0 Loading section .fini_array, size 0x8 lma 0x4001aee8 Loading section .rtemsroset, size 0x98 lma 0x4001aef0 Loading section .data, size 0x730 lma 0x40100000 Start address 0x0000000040008000, load size 78000 Transfer rate: 8463 KB/sec, 1695 bytes/write. (gdb) r The "remote" target does not support "run". Try "help target" or "continue". (gdb) continue Continuing. [Inferior 1 (process 1) exited normally] (gdb) bt No stack. (gdb)
continue 命令
[root@centos7 o-optimize]# aarch64-rtems6-gdb hello.exe GNU gdb (GDB) 10.1.90.20210409-git Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=aarch64-linux-gnu --target=aarch64-rtems6". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from hello.exe... (gdb) target remote :8889 Remote debugging using :8889 bsp_vector_table_begin () at ../../../bsps/aarch64/shared/start/start.S:55 55 mov x5, x1 /* machine type number or ~0 for DT boot */ (gdb) load Loading section .start, size 0x1fc lma 0x40008000 Loading section .text, size 0x10220 lma 0x40008800 Loading section .init, size 0x34 lma 0x40018a20 Loading section .fini, size 0x34 lma 0x40018a54 Loading section .rodata, size 0x2450 lma 0x40018a88 Loading section .eh_frame, size 0x4 lma 0x4001aed8 Loading section .init_array, size 0x8 lma 0x4001aee0 Loading section .fini_array, size 0x8 lma 0x4001aee8 Loading section .rtemsroset, size 0x98 lma 0x4001aef0 Loading section .data, size 0x730 lma 0x40100000 Start address 0x0000000040008000, load size 78000 Transfer rate: 8463 KB/sec, 1695 bytes/write. (gdb) continue Continuing. [Inferior 1 (process 1) exited normally] (gdb) bt No stack. (gdb)
参考/root/development/rtems/kernel/rtems/testsuites/samples/hello
[root@centos7 hello]# cat init.c /* * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <rtems.h> #include <tmacros.h> const char rtems_test_name[] = "HELLO WORLD"; static rtems_task Init( rtems_task_argument ignored ) { rtems_print_printer_fprintf_putc(&rtems_test_printer); TEST_BEGIN(); printf( "Hello World\n" ); TEST_END(); rtems_test_exit( 0 ); } /* NOTICE: the clock driver is explicitly disabled */ #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_INIT #include <rtems/confdefs.h>
不进行#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
[root@centos7 hello_world_c]# vi test.c /* * Classic API Hello World */ #include <rtems.h> #include <stdlib.h> #include <stdio.h> rtems_task Init( rtems_task_argument ignored ) { printf( "\n\n*** HELLO WORLD TEST ***\n" ); printf( "Hello World\n" ); printf( "*** END OF HELLO WORLD TEST ***\n" ); exit( 0 ); } /* configuration information */ #include <bsp.h> /* NOTICE: the clock driver is explicitly disabled */ #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER //#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */
成功运行
[root@centos7 hello_world_c]# make aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -c -o o-optimize/test.o test.c aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -B/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib -qrtems -Wl,--gc-sections -mcpu=cortex-a53 -o o-optimize/hello.exe o-optimize/test.o aarch64-rtems6-nm -g -n o-optimize/hello.exe > o-optimize/hello.num aarch64-rtems6-size o-optimize/hello.exe text data bss dec hex filename 84336 1856 134097208 134183400 7ff79e8 o-optimize/hello.exe cp o-optimize/hello.exe o-optimize/hello.ralf [root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/hello.exe *** HELLO WORLD TEST *** Hello World *** END OF HELLO WORLD TEST *** [ RTEMS shutdown ] RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x08a010001 executing thread name: UI1 [root@centos7 hello_world_c]#
再次运行gdb
[root@centos7 hello_world_c]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/hello.exe -S -gdb tcp::8889 *** HELLO WORLD TEST *** Hello World *** END OF HELLO WORLD TEST *** [ RTEMS shutdown ] RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x08a010001 executing thread name: UI1 You have new mail in /var/spool/mail/root [root@centos7 hello_world_c]#
[root@centos7 o-optimize]# aarch64-rtems6-gdb hello.exe GNU gdb (GDB) 10.1.90.20210409-git Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=aarch64-linux-gnu --target=aarch64-rtems6". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from hello.exe... (gdb) target remote :8889 Remote debugging using :8889 bsp_vector_table_begin () at ../../../bsps/aarch64/shared/start/start.S:55 55 mov x5, x1 /* machine type number or ~0 for DT boot */ (gdb) b bsp_start Breakpoint 1 at 0x40008c90: file ../../../bsps/aarch64/a53/start/bspstart.c, line 44. (gdb) c Continuing. Breakpoint 1, bsp_start () at ../../../bsps/aarch64/a53/start/bspstart.c:44 44 bsp_interrupt_initialize(); (gdb) bt #0 bsp_start () at ../../../bsps/aarch64/a53/start/bspstart.c:44 #1 0x000000004000f060 in rtems_initialize_executive () at ../../../cpukit/sapi/src/exinit.c:116 #2 0x0000000040008c7c in boot_card (cmdline=<optimized out>) at ../../../bsps/shared/start/bootcard.c:55 #3 0x00000000400080cc in _el1_start () at ../../../bsps/aarch64/shared/start/start.S:308 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) c Continuing. [Inferior 1 (process 1) exited normally] (gdb)
成功運行rtems-examples/ticker/low_ticker
[root@centos7 low_ticker]# make test -d o-optimize || mkdir o-optimize aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -c -o o-optimize/init.o init.c init.c: In function 'Test_task': init.c:28:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'rtems_task_argument' {aka 'long unsigned int'} [-Wformat=] 28 | printk( "TA%d %s%02d:%02d:%02d %02d/%02d/%04d\n", | ~^ | | | int | %ld 29 | task_index, " - rtems_clock_get_tod - ", | ~~~~~~~~~~ | | | rtems_task_argument {aka long unsigned int} init.c:20:21: warning: variable 'status' set but not used [-Wunused-but-set-variable] 20 | rtems_status_code status; | ^~~~~~ init.c: In function 'Init': init.c:42:21: warning: variable 'status' set but not used [-Wunused-but-set-variable] 42 | rtems_status_code status; | ^~~~~~ init.c:69:1: warning: no return statement in function returning non-void [-Wreturn-type] 69 | } | ^ aarch64-rtems6-gcc --pipe -Wall -O2 -g -fdata-sections -ffunction-sections -I/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib/include -mcpu=cortex-a53 -B/root/development/rtems/compiler/6/aarch64-rtems6/a53_lp64_qemu/lib -qrtems -Wl,--gc-sections -mcpu=cortex-a53 -o o-optimize/low_ticker.exe o-optimize/init.o aarch64-rtems6-nm -g -n o-optimize/low_ticker.exe > o-optimize/low_ticker.num aarch64-rtems6-size o-optimize/low_ticker.exe text data bss dec hex filename 45376 904 134137088 134183368 7ff79c8 o-optimize/low_ticker.exe cp o-optimize/low_ticker.exe o-optimize/low_ticker.ralf [root@centos7 low_ticker]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel o-optimize/low_ticker.exe *** LOW MEMORY CLOCK TICK TEST *** TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:09 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:19 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:29 12/31/1988 *** END OF LOW MEMORY CLOCK TICK TEST *** [ RTEMS shutdown ] RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x08a010002 executing thread name: TA1 [root@centos7 low_ticker]# pwd /root/development/rtems/rtems-examples/ticker/low_ticker [root@centos7 low_ticker]#
testsuites
支持test的bsp
Available BSP testers
You can list the available BSP testers with (not all shown):
[root@centos7 rtems]# ls /root/development/rtems/compiler/6/bin aarch64-rtems6-addr2line aarch64-rtems6-cpp aarch64-rtems6-gcc-ar aarch64-rtems6-gcov-tool aarch64-rtems6-ld.bfd aarch64-rtems6-readelf mkimage.py rtems-exeinfo rtems-run rtems-tld aarch64-rtems6-ar aarch64-rtems6-elfedit aarch64-rtems6-gcc-nm aarch64-rtems6-gdb aarch64-rtems6-nm aarch64-rtems6-run rtems-addr2line rtems-ld rtems-syms trace-converter aarch64-rtems6-as aarch64-rtems6-g++ aarch64-rtems6-gcc-ranlib aarch64-rtems6-gdb-add-index aarch64-rtems6-objcopy aarch64-rtems6-size rtems-bin2c rtems-ra rtems-test xmlwf aarch64-rtems6-c++ aarch64-rtems6-gcc aarch64-rtems6-gcov aarch64-rtems6-gprof aarch64-rtems6-objdump aarch64-rtems6-strings rtems-boot-image rtems-rap rtems-tftp-proxy aarch64-rtems6-c++filt aarch64-rtems6-gcc-10.3.1 aarch64-rtems6-gcov-dump aarch64-rtems6-ld aarch64-rtems6-ranlib aarch64-rtems6-strip rtems-bsp-builder rtems-record-lttng rtems-tftp-server
[root@centos7 rtems]# rtems-test --list-bsps RTEMS Testing - Tester, 6.0.not_released BSP List: a53_ilp32_qemu a53_lp64_qemu-cov a53_lp64_qemu a72_lp64_qemu beagleboardxm beagleboneblack bf537Stamp-run bf537Stamp erc32-sis fvp_cortex_r52x1 fvp_cortex_r52x2 fvp_cortex_r52x4 generic_or1k gr740-sis griscv-sis-cov griscv-sis griscv h8sxsim-run h8sxsim imx7 jmr3904-run jmr3904 leon2-run leon2-sis leon3-qemu-cov leon3-qemu leon3-run leon3-sis-cov leon3-sis leon3_tsim-run leon3_tsim lm32_evr_gdbsim-run lm32_evr_gdbsim mcf5235 pc-qemu-cov pc-qemu pc psim-run psim qoriq_e500 qoriq_e6500_32 qoriq_e6500_64 raspberrypi2 realview_pbx_a9_qemu rv32i_spike rv32iac_spike rv32im_spike rv32imac_spike rv32imafc_spike rv32imafd_spike rv32imafdc_spike rv64imac_medany_spike rv64imac_spike rv64imafd_medany rv64imafd_medany_spike rv64imafd_spike rv64imafdc_medany rv64imafdc_medany_spike rv64imafdc_spike simsh1-run simsh1 simsh2-run simsh2 simsh2e-run simsh2e simsh4-run simsh4 sis-run sis v850e1sim-run v850e1sim v850e2sim-run v850e2sim v850e2v3sim-run v850e2v3sim v850esim-run v850esim v850essim-run v850essim v850sim-run v850sim xilinx_versal_lp64_qemu xilinx_versal_vck190 xilinx_zynq_a9_qemu-cov xilinx_zynq_a9_qemu xilinx_zynq_a9_qemu_smp xilinx_zynq_zc706 xilinx_zynq_zc706_qemu xilinx_zynq_zedboard xilinx_zynqmp_ilp32_qemu xilinx_zynqmp_ilp32_zu3eg xilinx_zynqmp_lp64_qemu-cov xilinx_zynqmp_lp64_qemu xilinx_zynqmp_lp64_zu3eg
./waf命令
[1384/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/base_sp.exe [1385/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/capture.exe [1386/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/cdtest.exe [1387/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/fileio.exe [1388/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/hello.exe [1389/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/iostream.exe [1390/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/nsecs.exe [1391/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/ticker.exe [1392/1397] Linking build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/unlimited.exe
[root@centos7 rtems]# find ./ -name hello.exe ./build/aarch64/xilinx_zynqmp_lp64_qemu/testsuites/samples/hello.exe ./build/aarch64/a53_lp64_qemu/testsuites/samples/hello.exe [root@centos7 rtems]# rtems-test --list-bsps | grep xilinx_zynqmp_lp64_qemu xilinx_zynqmp_lp64_qemu-cov xilinx_zynqmp_lp64_qemu [root@centos7 rtems]#
[root@centos7 rtems]# pwd /root/development/rtems/kernel/rtems [root@centos7 rtems]#
[root@centos7 rtems]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel build/aarch64/a53_lp64_qemu/testsuites/samples/hello.exe *** BEGIN OF TEST HELLO WORLD *** *** TEST VERSION: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce *** TEST STATE: EXPECTED_PASS *** TEST BUILD: *** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) Hello World *** END OF TEST HELLO WORLD *** [ RTEMS shutdown ] RTEMS version: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce RTEMS tools: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) executing thread ID: 0x08a010001 executing thread name: UI1 [root@centos7 rtems]#
capture.exe
[root@centos7 samples]# qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel capture.exe *** BEGIN OF TEST CAPTURE ENGINE *** *** TEST VERSION: 6.0.0.822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce *** TEST STATE: USER_INPUT *** TEST BUILD: *** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB 889cf95db0122bd1a6b21598569620c40ff2069d, Newlib eb03ac1) Press any key to start capture engine (20s remaining) Press any key to start capture engine (19s remaining) Press any key to start capture engine (18s remaining) Press any key to start capture engine (17s remaining) Monitor ready, press enter to login. 1-rtems $ ls Unrecognised command; try 'help' 1-rtems $ copen 50000 capture engine opened. 1-rtems $ cwceil 100 watch ceiling is 100. 1-rtems $ cwfloor 102 watch floor is 102. 1-rtems $ cwglob on global watch enabled. 1-rtems $ ctset RMON trigger set. 1-rtems $ cenable capture engine enabled. 1-rtems $ cdisable capture engine disabled. 1-rtems $ ctrace 1-rtems $ ctrace 1-rtems $ q ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE ------------------------------------------------------------------------------ 1-rtems $ qui Unrecognised command; try 'help' 1-rtems $ quit Unrecognised command; try 'help' 1-rtems $ exit Unrecognised command; try 'help' 1-rtems $ 1-rtems $
[root@centos7 hello_world_c]# mkdir -p cdrom/opt [root@centos7 hello_world_c]# mkdir -p cdrom/boot/grub [root@centos7 hello_world_c]# cp o-optimize/hello.exe cdrom/opt
[root@centos7 hello_world_c]# cat cdrom/boot/grub/grub.cfg # RTEMS Grubs Configuration for the Sample Tests set default=12 menuentry "RTEMS - Hello" { multiboot /opt/hello.exe } [root@centos7 hello_world_c]#
[root@centos7 rtems]# yum -y install grub2
[root@centos7 hello_world_c]# ls /usr/bin/grub2- grub2-editenv grub2-fstest grub2-kbdcomp grub2-mkfont grub2-mklayout grub2-mkpasswd-pbkdf2 grub2-mkrescue grub2-script-check grub2-file grub2-glue-efi grub2-menulst2cfg grub2-mkimage grub2-mknetdir grub2-mkrelpath grub2-mkstandalone grub2-syslinux2cfg [root@centos7 hello_world_c]# ls /usr/bin/grub2-
[root@centos7 hello_world_c]# cp grup.cfg cdrom/boot/grub
[root@centos7 hello_world_c]#
鏡像製作
[root@centos7 hello_world_c]# dd if=/dev/zero of=rtems-boot.img bs=512 count=32130 32130+0 records in 32130+0 records out 16450560 bytes (16 MB) copied, 0.1166 s, 141 MB/s [root@centos7 hello_world_c]# losetup /dev/loop0 rtems-boot.img [root@centos7 hello_world_c]# fdisk /dev/loop0 Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x9036e64b. Command (m for help): Command (m for help): Command (m for help): m^H Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): o Building a new DOS disklabel with disk identifier 0x86e019af. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-32129, default 2048): a First sector (2048-32129, default 2048): a First sector (2048-32129, default 2048): 2048 Last sector, +sectors or +size{K,M,G} (2048-32129, default 32129): a Last sector, +sectors or +size{K,M,G} (2048-32129, default 32129): 32129 Partition 1 of type Linux and of size 14.7 MiB is set Command (m for help): a Selected partition 1 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@centos7 hello_world_c]#
[root@centos7 hello_world_c]# ls /mnt
huge
[root@centos7 hello_world_c]# mkdir /data3
[root@centos7 hello_world_c]# kpartx -av /dev/loop0 add map loop0p1 (253:0): 0 30082 linear /dev/loop0 2048 [root@centos7 hello_world_c]# losetup -f /dev/loop1 [root@centos7 hello_world_c]# losetup /dev/loop1 /dev/mapper/loop0p1 [root@centos7 hello_world_c]# mkfs.ext2 /dev/loop1 && mount /dev/loop1 /data3 mke2fs 1.42.9 (28-Dec-2013) Discarding device blocks: done Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 3760 inodes, 15040 blocks 752 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=15466496 2 block groups 8192 blocks per group, 8192 fragments per group 1880 inodes per group Superblock backups stored on blocks: 8193 Allocating group tables: done Writing inode tables: done Writing superblocks and filesystem accounting information: done
[root@centos7 hello_world_c]# mkdir -p /data3/boot/grub/ [root@centos7 hello_world_c]# echo 'source (hd1,msdos1)/grub.cfg' > /data3/boot/grub/grub.cfg [root@centos7 hello_world_c]# cat /data3/boot/grub/grub.cfg source (hd1,msdos1)/grub.cfg
[root@centos7 hello_world_c]# grub2-install --allow-floppy --boot-directory=/mnt/boot --disk-module=biosdisk --modules="ext2 part_msdos" --force /dev/loop0 grub2-install: error: /usr/lib/grub/arm64-efi/modinfo.sh doesn't exist. Please specify --target or --directory. [root@centos7 hello_world_c]#
yum -y install grub2-efi-aa64-modules.noarch
yum install yum install grub2-efi-aa64-modules.noarch (
yum install grub2-efi-aa64.aarch64
https://gitlab.com/c-mauderer/rtems-libbsd