To get the operating system sources please visit GitHub https://github.com/phoenix-rtos/.
This section contains instructions how to quickly run Phoenix-RTOS on supported hardware platforms. In further examples it is assumed that Phoenix-RTOS modules are downloaded and compiled and reside in the same directory.
This version is designated for generic PC based on IA32 processor, it supports Intel Galileo platform as well. It could be launched using multiboot compliant loader (e.g. GRUB) or native Phoenix-RTOS loader (plo).
The easiest way to run Phoenix-RTOS directly from the image. Command line examples for running binaries available for download are shown below.
To run Phoenix-RTOS with libphoenix native API and psh shell the following command should be used:
qemu-system-i386 --serial stdio -hda ./phoenix-ia32-native.ext2
To run Phoenix-RTOS with libphoenix POSIX API and busybox ash shell the following command should be used:
qemu-system-i386 --serial stdio -hda ./phoenix-ia32-posix.ext2
To run the Phoenix-RTOS operating system is to load the kernel, console driver, fileserver and shell. To do it using qemu emulator just type:
qemu-system-i386 -kernel phoenix-ia32.elf -nographic -initrd "phoenix-ia32/phoenix-rtos-devices/pc-uart,phoenix-ia32/phoenix-rtos-filesystems/dummyfs,phoenix-ia32/libphoenix/psh" -append "Xpc-uart Xdummyfs Xpsh" -m 2
The example above loads kernel image and other binaries (uart driver, file system and shell) into the memory. The binaries are executed with accordance to the command line in append option. The execution option is marked with an X in front of the file name, e.g. Xpc-uart will execute previously loaded pc-uart binary.
To run the same version with VGA console output please use kernel compiled with the VGA support and pc-tty driver.
qemu-system-i386 -kernel phoenix-ia32-vga.elf -initrd "phoenix-ia32/phoenix-rtos-devices/pc-tty,phoenix-ia32/phoenix-rtos-filesystems/dummyfs,phoenix-ia32/libphoenix/psh" -append "Xpc-tty Xdummyfs Xpsh" -m 2
To run Phoenix-RTOS on development kit the SDP compliant loader is required. Kernel is compiled into the image compliant with iMX ROM loader. It can be loaded via USB using imx-usb-loader but preferred method is to use the phoenixd daemon. It loads kernel and initial applications via USB to OCRAM and supports protocol which allows to fetch binaries by dummyfs file server when DRAM is initialized.
Kernel command line is passed through the append parameter. In the command line you can use X to mark file for execution and F to mark files that are to be fetched via USB. The output log can be viewed in a console using the UART1 interface (available after conversion as USB on development board). The following command uploads Phoenix-RTOS kernel and executes uart driver, RAM fs - dummyfs and phoenix shell - psh.
phoenixd --upload --kernel phoenix-arm-imx.img --console phoenix-rtos-devices/imx6ull-uart --initrd phoenix-rtos-filesystems/dummyfs -x libphoenix/psh
Below you will find an example of upload and execution of Phoenix-RTOS with POSIX compatibility and ash shell.
phoenixd --upload --kernel phoenix-arm-imx.img --console phoenix-rtos-devices/imx6ull-uart --initrd phoenix-rtos-filesystems/dummyfs -x phoenix-rtos-posixsrv/posixsrv busybox/busybox=ash
- phoenix-arm.tgz root filesystem skeleton
This is the distribution for STM32L152 architecture. Below an example of binary image upload to the microcontroller using OpenOCD is presented.
openocd -f /usr/local/share/openocd/scripts/interface/jlink.cfg -f /usr/local/share/openocd/scripts/target/stm32l1.cfg -c "program phoenix-rtos.bin 0x08000000 verify reset exit"
This port is now under development.
RISC-V is a new open architecture developed at Berkeley becoming the new standard for IoT applications. To compile Phoenix-RTOS for this architecture, tools from http://github.com/riscv/ should be downloaded and compiled.
Two tools are required - Spike, a RISC-V ISA Simulator and bbl (Berkeley Boot Loader) which is the part of RISC-V Proxy Kernel. The bbl loader works in the Machine Mode, prepares the environment for the kernel, switches the processor into the Supervisor Mode and finally passes control to the kernel. The first step before boot is to compile the loader with the proper payload (path to the kernel in ELF format).
CC=/opt/local/bin/riscv64-unknown-elf-gcc RANLIB=/opt/local/bin/riscv64-unknown-elf-ranlib READELF=/opt/local/bin/riscv64-unknown-elf-readelf AR=/opt/local/bin/riscv64-unknown-elf-ar OBJCOPY=/opt/local/bin/riscv64-unknown-elf-objcopy ../configure --prefix=/opt/local --host=riscv64 --with-payload=../../../phoenix-rtos-kernel/phoenix-riscv64.elf
The last step of compilation is embedding the kernel into the bbl loader. After compilation the loader with embedded kernel is ready to run in Spike simulator. To run kernel in simulator the following commands shall be used.
After each kernel compilation the embedding process should be repeated by remaking the loader.Kernel can be run in qemu-riscv64 emulator as well. To do it following command should be use:
qemu-system-riscv64 -machine spike_v1.10 -nographic -kernel ./bblTo run Phoenix-RTOS on VirtIO compatible RISCV platform:
qemu-system-riscv64 -machine virt -nographic -kernel ./bbl