├── _fs └── root-skel │ ├── tmp │ └── .keep │ ├── etc │ ├── hostid │ ├── group │ ├── platform │ ├── rc.conf.d │ │ ├── ntpd │ │ ├── ntp │ │ └── network │ ├── shells │ ├── passwd │ ├── syslog.conf │ ├── rc.subr │ ├── profile │ ├── inittab │ ├── rc.d │ │ ├── sshd.sh │ │ ├── telnetd.sh │ │ ├── ntpd.sh │ │ └── network.sh │ ├── logo │ └── rc │ └── root │ └── .keep ├── scripts ├── zynq7000-zc702.dtb ├── zynqmp-zcu104.dtb ├── zynq7000-zc702-single.dtb ├── riscv64-generic-spike.sh ├── ia32-generic-qemu.sh ├── ia32-generic-qemu-test.sh ├── ia32-generic-qemu-virt.sh ├── ia32-generic-qemu-net.sh ├── sparcv8leon-generic-qemu.sh ├── armv8r52-mps3an536-qemu.sh ├── sparcv8leon-generic-qemu-test.sh ├── run-armv7a7-imx6ull-evk.sh ├── armv7a9-zynq7000-qemu.sh ├── armv7a9-zynq7000-qemu-test.sh ├── armv7r5f-zynqmp-qemu.sh ├── riscv64-generic-qemu.sh └── aarch64a53-zynqmp-qemu.sh ├── mtd-utils ├── mtd-utils-patched.tar.gz └── build.sh ├── .gitignore ├── _projects ├── riscv64-gr765-vcu118 │ ├── riscv64-gr765-vcu118.dtb │ ├── nvm.yaml │ ├── user.plo.yaml │ ├── preinit.plo.yaml │ ├── build.project │ ├── board_config.h │ └── riscv64-gr765-vcu118.dts ├── riscv64-grfpga-artya7 │ ├── riscv64-grfpga-artya7.dtb │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── build.project │ ├── board_config.h │ └── riscv64-grfpga-artya7.dts ├── aarch64a53-zynqmp-qemu │ ├── rootfs-overlay │ │ └── etc │ │ │ ├── system.dtb │ │ │ └── rc.psh │ ├── nvm.yaml │ ├── user.plo.yaml │ └── build.project ├── aarch64a53-zynqmp-som │ ├── rootfs-overlay │ │ └── etc │ │ │ ├── system.dtb │ │ │ └── rc.psh │ ├── nvm.yaml │ ├── preinit.plo.yaml │ ├── user.plo.yaml │ └── build.project ├── aarch64a53-zynqmp-zcu104 │ ├── rootfs-overlay │ │ └── etc │ │ │ ├── system.dtb │ │ │ └── rc.psh │ ├── nvm.yaml │ ├── user.plo.yaml │ └── build.project ├── ia32-generic-qemu │ ├── rootfs-overlay │ │ ├── usr │ │ │ └── share │ │ │ │ └── cow │ │ │ │ ├── bomb.vt │ │ │ │ ├── nasa.vt │ │ │ │ ├── flatmap.vt │ │ │ │ ├── wineglas.vt │ │ │ │ ├── sig.vt │ │ │ │ ├── file_id.diz │ │ │ │ ├── slowcat.c │ │ │ │ ├── xmas-07.vt │ │ │ │ ├── dodgeram.vt │ │ │ │ ├── sun.vt │ │ │ │ ├── nifty.vt │ │ │ │ ├── duckpaint.vt │ │ │ │ ├── vt_files.nfo │ │ │ │ ├── xmas-06.vt │ │ │ │ └── spinweb.vt │ │ └── etc │ │ │ ├── rc.psh │ │ │ ├── rc.conf.d │ │ │ └── network │ │ │ ├── rc │ │ │ └── ssl │ │ │ └── certs │ │ │ ├── Baltimore_CyberTrust_Root.pem │ │ │ └── DigiCert_Global_Root_G2.pem │ ├── board_config.h │ ├── build.project │ └── lwip │ │ └── lwipopts.h ├── sparcv8leon-gr712rc-board │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── build.project │ └── board_config.h ├── armv7a9-zynq7000-zturn │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── nvm.yaml │ ├── build.project │ └── user.plo.yaml ├── riscv64-generic-qemu │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── board_config.h │ └── build.project ├── sparcv8leon-gr740-mini │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ └── build.project ├── armv7a9-zynq7000-zedboard │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── build.project │ ├── nvm.yaml │ └── user.plo.yaml ├── armv7a9-zynq7000-qemu │ ├── rootfs-overlay │ │ └── etc │ │ │ ├── rc.psh │ │ │ └── rc │ ├── nvm.yaml │ ├── build.project │ └── user.plo.yaml ├── ia32-generic-pc │ ├── rootfs-overlay │ │ └── etc │ │ │ └── rc.psh │ ├── build.project │ └── board_config.h ├── host-generic-pc │ ├── board_config.h │ └── build.project ├── armv7a7-imx6ull-evk │ ├── board_config.h │ ├── rootfs-overlay │ │ └── etc │ │ │ ├── rc.psh │ │ │ └── rc.conf.d │ │ │ └── network │ ├── user.plo.yaml │ └── build.project ├── riscv64-generic-spike │ ├── user.plo.yaml │ ├── nvm.yaml │ ├── preinit.plo.yaml │ ├── build.project │ └── board_config.h ├── sparcv8leon-gr716-mimas │ ├── user.plo.yaml │ ├── preinit.plo.yaml │ ├── build.project │ └── board_config.h ├── armv8m55-stm32n6-nucleo │ ├── build.project │ └── board_config.h ├── armv7m7-imxrt105x-evk │ └── build.project ├── sparcv8leon-generic-qemu │ ├── build.project │ └── board_config.h ├── armv7m4-stm32l4x6-nucleo │ ├── board_config.h │ └── build.project ├── armv8r52-mps3an536-qemu │ ├── build.project │ └── board_config.h ├── armv8m33-mcxn94x-frdm │ └── build.project ├── armv8m33-mcxn94x-frdm_cpu1 │ └── build.project ├── armv7r5f-zynqmp-qemu │ ├── nvm.yaml │ └── build.project ├── armv7m7-imxrt106x-evk │ └── build.project ├── armv7m7-imxrt117x-evk │ └── build.project └── sparcv8leon-gr716-mini │ ├── build.project │ └── board_config.h ├── _targets ├── riscv64 │ ├── gr765 │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project │ ├── grfpga │ │ ├── nvm.yaml │ │ ├── preinit.plo.yaml │ │ └── user.plo.yaml │ └── generic │ │ ├── preinit.plo.yaml │ │ ├── user.plo.yaml │ │ └── nvm.yaml ├── armv8m55 │ └── stm32n6 │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ └── preinit.plo.yaml ├── armv7a7 │ └── imx6ull │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ └── preinit.plo.yaml ├── sparcv8leon │ ├── generic │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project │ ├── gr712rc │ │ ├── nvm.yaml │ │ ├── preinit.plo.yaml │ │ └── user.plo.yaml │ ├── gr740 │ │ ├── nvm.yaml │ │ ├── preinit.plo.yaml │ │ └── user.plo.yaml │ └── gr716 │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project ├── armv7a9 │ └── zynq7000 │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ └── preinit.plo.yaml ├── aarch64a53 │ └── zynqmp │ │ ├── user.plo.yaml │ │ ├── nvm.yaml │ │ └── preinit.plo.yaml ├── armv8r52 │ └── mps3an536 │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project ├── armv7r5f │ └── zynqmp │ │ ├── user.plo.yaml │ │ ├── nvm.yaml │ │ └── preinit.plo.yaml ├── armv7m7 │ ├── imxrt105x │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project │ ├── imxrt117x │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project │ └── imxrt106x │ │ ├── nvm.yaml │ │ ├── user.plo.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project ├── armv8m33 │ └── mcxn94x │ │ ├── user.plo.yaml │ │ ├── nvm.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project ├── armv7m4 │ └── stm32l4x6 │ │ ├── user.plo.yaml │ │ ├── nvm.yaml │ │ ├── preinit.plo.yaml │ │ └── build.project ├── ia32 │ └── generic │ │ ├── user.plo.yaml │ │ ├── nvm.yaml │ │ └── preinit.plo.yaml └── host │ └── generic │ └── build.project ├── _user ├── hello │ ├── Makefile │ └── main.c ├── serverdemo │ └── Makefile ├── hellocpp │ ├── Makefile │ └── main.cpp ├── voxeldemo │ └── Makefile ├── rotrectangle │ └── Makefile └── Makefile ├── .docker_env ├── .github ├── workflows │ ├── ci.yml │ ├── nightly.yml │ ├── nightly-quick.yml │ └── ci-release.yml ├── problem-matchers │ ├── gcc.json │ └── sanitizer-errors.json ├── PULL_REQUEST_TEMPLATE.md └── actions │ ├── phoenix-runner │ └── action.yml │ └── phoenix-build │ └── action.yml ├── docker-devel.sh ├── .clang-format ├── docker-build.sh ├── LICENSE ├── .gitmodules └── README.md /_fs/root-skel/tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/hostid: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_fs/root-skel/root/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/group: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/platform: -------------------------------------------------------------------------------- 1 | ia32 2 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.conf.d/ntpd: -------------------------------------------------------------------------------- 1 | ENABLED=1 2 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.conf.d/ntp: -------------------------------------------------------------------------------- 1 | PEERS="194.146.251.100" 2 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/shells: -------------------------------------------------------------------------------- 1 | # /etc/shells: valid login shells 2 | /bin/sh 3 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/passwd: -------------------------------------------------------------------------------- 1 | root:0B1ANiYi45IhxkfmUW155/GBd4IRE=:0:0:root:/:/bin/sh 2 | -------------------------------------------------------------------------------- /scripts/zynq7000-zc702.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/scripts/zynq7000-zc702.dtb -------------------------------------------------------------------------------- /scripts/zynqmp-zcu104.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/scripts/zynqmp-zcu104.dtb -------------------------------------------------------------------------------- /mtd-utils/mtd-utils-patched.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/mtd-utils/mtd-utils-patched.tar.gz -------------------------------------------------------------------------------- /scripts/zynq7000-zc702-single.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/scripts/zynq7000-zc702-single.dtb -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _fs/* 2 | !_fs/root-skel/ 3 | _build/* 4 | _boot/* 5 | .DS_Store 6 | .vscode/* 7 | compile_commands.json 8 | .cache/* 9 | .venv/ 10 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/riscv64-gr765-vcu118.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/riscv64-gr765-vcu118/riscv64-gr765-vcu118.dtb -------------------------------------------------------------------------------- /_projects/riscv64-grfpga-artya7/riscv64-grfpga-artya7.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/riscv64-grfpga-artya7/riscv64-grfpga-artya7.dtb -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-qemu/rootfs-overlay/etc/system.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/aarch64a53-zynqmp-qemu/rootfs-overlay/etc/system.dtb -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/rootfs-overlay/etc/system.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/aarch64a53-zynqmp-som/rootfs-overlay/etc/system.dtb -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-zcu104/rootfs-overlay/etc/system.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/aarch64a53-zynqmp-zcu104/rootfs-overlay/etc/system.dtb -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/bomb.vt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/bomb.vt -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/nasa.vt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/nasa.vt -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/flatmap.vt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/flatmap.vt -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr712rc-board/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | X /bin/posixsrv 6 | X /bin/psh 7 | -------------------------------------------------------------------------------- /_targets/riscv64/gr765/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x1000000 # 16 MB 3 | block_size: 1 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | -------------------------------------------------------------------------------- /_user/hello/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for user application 3 | # 4 | # Copyright 2021 Phoenix Systems 5 | # 6 | 7 | NAME := hello 8 | LOCAL_SRCS := main.c 9 | 10 | include $(binary.mk) 11 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zturn/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/psh 7 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/wineglas.vt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phoenix-rtos/phoenix-rtos-project/HEAD/_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/wineglas.vt -------------------------------------------------------------------------------- /_user/serverdemo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for server application demo 3 | # 4 | # Copyright 2024 Phoenix Systems 5 | # 6 | 7 | NAME := serverdemo 8 | LOCAL_SRCS := main.c 9 | 10 | include $(binary.mk) 11 | -------------------------------------------------------------------------------- /.docker_env: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # host env variables passed to the docker 3 | TARGET 4 | CONSOLE 5 | LONG_TEST 6 | SIL 7 | DEBUG 8 | 9 | 10 | 11 | # project-specific env variables should be added below this line 12 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-qemu/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /bin/psh 8 | -------------------------------------------------------------------------------- /_projects/riscv64-grfpga-artya7/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /bin/psh 8 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr740-mini/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /bin/psh 8 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zedboard/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /bin/psh 8 | -------------------------------------------------------------------------------- /_user/hellocpp/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for user application 3 | # 4 | # Copyright 2023 Phoenix Systems 5 | # 6 | 7 | NAME := hellocpp 8 | LOCAL_SRCS := main.cpp 9 | LOCAL_LDLIBS := -lstdc++ 10 | 11 | include $(binary.mk) 12 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-qemu/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | T /dev/console 8 | X /linuxrc 9 | -------------------------------------------------------------------------------- /_user/voxeldemo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for user application 3 | # 4 | # Copyright 2021 Phoenix Systems 5 | # 6 | 7 | NAME := voxeldemo 8 | LOCAL_SRCS := main.c 9 | LIBS := libgraph libvga libvirtio 10 | 11 | include $(binary.mk) 12 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-zcu104/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | T /dev/console 8 | X /bin/psh 9 | -------------------------------------------------------------------------------- /_user/rotrectangle/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for user application 3 | # 4 | # Copyright 2021 Phoenix Systems 5 | # 6 | 7 | NAME := rotrectangle 8 | LOCAL_SRCS := main.c 9 | LIBS := libgraph libvga libvirtio 10 | 11 | include $(binary.mk) 12 | -------------------------------------------------------------------------------- /_targets/armv8m55/stm32n6/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 0x10000 # program page size 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: user 9 | offs: 0x10000 10 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/syslog.conf: -------------------------------------------------------------------------------- 1 | #all messages 2 | *.* /var/log/messages 3 | 4 | # kernel messages are being kept in another log 5 | kern.* /var/log/kernel 6 | 7 | # daemon messages (mostly startup) also: 8 | daemon.* /var/log/daemon 9 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x10000000 # 8 MB 3 | block_size: 0x100 # program page size 4 | padding_byte: 0x00 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | size: 0x40000 9 | - name: kernel 10 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-qemu/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | T /dev/console 8 | X /bin/psh 9 | X /sbin/pcie 10 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | T /dev/console 8 | X /bin/psh 9 | X /sbin/pcie 10 | 11 | -------------------------------------------------------------------------------- /_projects/ia32-generic-pc/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /sbin/lwip rtl:0x18:11 8 | T /dev/console 9 | X /bin/psh 10 | -------------------------------------------------------------------------------- /_targets/armv7a7/imx6ull/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x2000000 # 32 MB 3 | block_size: 0x1000 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | - name: rootfs 11 | offs: 0x100000 12 | type: jffs2 13 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | W /sbin/dummyfs -m /tmp -D 6 | X /bin/posixsrv 7 | X /sbin/lwip rtl:0x18:11 8 | T /dev/console 9 | X /bin/psh 10 | X /bin/psh -i /etc/secondary.psh 11 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.conf.d/network: -------------------------------------------------------------------------------- 1 | # 2 | # Network configuration 3 | # 4 | 5 | network_interfaces="en1" 6 | 7 | network_en1_enabled="1" 8 | network_en1_mode="static" 9 | network_en1_ip="192.168.122.10" 10 | network_en1_mask="255.255.255.0" 11 | network_en1_gateway="192.168.122.0" 12 | network_en1_metric="0" 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # vim:sw=2:ts=2 2 | name: ci 3 | 4 | on: 5 | push: 6 | branches: 7 | - master 8 | - 'feature/*' 9 | pull_request: 10 | branches: 11 | - master 12 | - 'feature/*' 13 | 14 | jobs: 15 | call-ci: 16 | uses: ./.github/workflows/ci-project.yml 17 | secrets: inherit 18 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/etc/rc.conf.d/network: -------------------------------------------------------------------------------- 1 | # 2 | # Network configuration 3 | # 4 | 5 | network_interfaces="en1" 6 | 7 | network_en1_enabled="1" 8 | network_en1_mode="dhcp" 9 | network_en1_ip="192.168.122.10" 10 | network_en1_mask="255.255.255.0" 11 | network_en1_gateway="192.168.122.1" 12 | network_en1_metric="0" 13 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/generic/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x800000 # 8 MB 3 | block_size: 0x100 # program page size 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x10000 10 | # if size not set - last non-virtual partition will be extnded to the end of flash 11 | -------------------------------------------------------------------------------- /_projects/host-generic-pc/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for host-generic-pc 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /_targets/armv8m55/stm32n6/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -xn psh axi_app axi_app 9 | - app {{ env.BOOT_DEVICE }} -xn stm32l4-multi axi_app axi_app;per 10 | - wait 1000 11 | - go! 12 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr712rc/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x1000000 # 16 MB 3 | block_size: 0x20000 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | - name: rootfs 11 | offs: 0x100000 12 | - name: ptable 13 | offs: 0xfe0000 14 | size: 0x20000 15 | -------------------------------------------------------------------------------- /scripts/riscv64-generic-spike.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on SPIKE (riscv64-generic-spike) 4 | # 5 | # Copyright 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | exec spike -m0x80000000:0x10000000 --real-time-clint "$(dirname "${BASH_SOURCE[0]}")/../_boot/riscv64-generic-spike/sbi-generic.elf" 10 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: nightly 2 | 3 | on: 4 | schedule: 5 | # triggered every day at 1:00 UTC 6 | - cron: '0 1 * * *' 7 | 8 | jobs: 9 | call-ci: 10 | uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/ci-project.yml@master 11 | with: 12 | build_params: all tests 13 | nightly: true 14 | secrets: inherit 15 | -------------------------------------------------------------------------------- /_projects/armv7a7-imx6ull-evk/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for armv7a7-imx6ull-evk 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /_targets/armv7a9/zynq7000/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x1000000 # 16 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x10000 10 | - name: bitstr 11 | offs: 0x400000 12 | - name: rootfs 13 | offs: 0x800000 14 | size: 0x800000 15 | type: jffs2 16 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zturn/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x2000000 # 32 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x10000 10 | - name: bitstr 11 | offs: 0x400000 12 | - name: rootfs 13 | offs: 0x800000 14 | size: 0x800000 15 | type: jffs2 16 | -------------------------------------------------------------------------------- /_targets/aarch64a53/zynqmp/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - wait 500 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/armv8r52/mps3an536/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | # Qemu emulates flash as a ROM memory 3 | size: 0x800000 # 8 MB 4 | block_size: 0x100 # program page size 5 | padding_byte: 0xff 6 | partitions: 7 | - name: plo 8 | offs: 0x0 9 | - name: user 10 | offs: 0x8000 11 | # if size not set - last non-virtual partition will be extnded to the end of flash 12 | -------------------------------------------------------------------------------- /_targets/riscv64/gr765/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x grlib-uart ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 11 | - wait 500 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr740/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x8000000 # 128 MB 3 | block_size: 0x20000 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | - name: rootfs 11 | offs: 0x100000 12 | size: 0x1000000 13 | - name: ptable 14 | offs: 0x7fe0000 15 | size: 0x20000 16 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-spike/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x spike-tty ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 11 | - wait 500 12 | - go! 13 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 500 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x grlib-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/armv7a7/imx6ull/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 2000 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x imx6ull-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/armv7r5f/zynqmp/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr;devs 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 11 | - wait 1500 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/armv8r52/mps3an536/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x cmsdk-apbuart ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 11 | - wait 500 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/generic/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs sram sram 9 | - app {{ env.BOOT_DEVICE }} -x grlib-uart sram sram 10 | - app {{ env.BOOT_DEVICE }} -x psh sram sram 11 | - wait 500 12 | - go! 13 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr716/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x1000000 # 16 MB 3 | block_size: 0x100 # program page size 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0xe400 10 | # if size not set - last non-virtual partition will be extnded to the end of flash 11 | # TODO: add explicit/virtual partition for BCH 12 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-spike/nvm.yaml: -------------------------------------------------------------------------------- 1 | loader: 2 | size: 0x2000000 # 32 MB 3 | block_size: 512 4 | partitions: 5 | - name: plo 6 | offs: 0x0 7 | # NOTE: we need enough free space in "plo" to also copy the kernel from `kernel` partition 8 | size: 0x200000 # 2 MB 9 | 10 | - name: kernel 11 | # offs/size will be set based on the offset of the prev/next partition 12 | -------------------------------------------------------------------------------- /_targets/armv7r5f/zynqmp/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | - name: rootfs 11 | offs: 0x200000 12 | size: 0x1000000 # 16 MB 13 | type: jffs2 14 | - name: bitstr 15 | offs: 0x2c00000 # 20 MB from the end 16 | -------------------------------------------------------------------------------- /_user/hello/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Hello World 5 | * 6 | * Example of user application 7 | * 8 | * Copyright 2021 Phoenix Systems 9 | * Author: Hubert Buczynski 10 | * 11 | * This file is part of Phoenix-RTOS. 12 | * 13 | * %LICENSE% 14 | */ 15 | 16 | #include 17 | 18 | 19 | int main(void) 20 | { 21 | printf("Hello World!!\n"); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /_targets/aarch64a53/zynqmp/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | - name: rootfs 11 | offs: 0x200000 12 | size: 0x1000000 # 16 MB 13 | type: jffs2 14 | - name: bitstr 15 | offs: 0x2c00000 # 20 MB from the end 16 | -------------------------------------------------------------------------------- /.github/workflows/nightly-quick.yml: -------------------------------------------------------------------------------- 1 | # vim:sw=2:ts=2 2 | name: nightly-quick 3 | 4 | on: 5 | # Run workflow every day to make sure that in the incoming day everything will work properly 6 | schedule: 7 | # triggered every day at 5:00 UTC 8 | - cron: '0 5 * * *' 9 | jobs: 10 | call-ci: 11 | uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/ci-project.yml@master 12 | secrets: inherit 13 | -------------------------------------------------------------------------------- /_projects/host-generic-pc/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building host-generic-pc project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | b_image_project () { 13 | b_log "The images have been built for the ${TARGET} platform" 14 | } 15 | -------------------------------------------------------------------------------- /_projects/ia32-generic-pc/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building ia32-generic-pc project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | b_image_project () { 13 | b_log "The images have been built for the ${TARGET} platform" 14 | } 15 | -------------------------------------------------------------------------------- /_projects/armv7a7-imx6ull-evk/rootfs-overlay/etc/rc.psh: -------------------------------------------------------------------------------- 1 | :{}: 2 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 3 | export HOME=/root 4 | W /bin/bind devfs /dev 5 | X /sbin/imx6ull-gpio 6 | W /sbin/dummyfs -m /var -D 7 | W /sbin/dummyfs -m /tmp -D 8 | X /sbin/lwip enet:0x02188000:150:PHY:ksz8081rnb:0.2:irq:-5:/dev/gpio5 enet:0x020b4000:152:no-mdio:PHY:ksz8081rnb:0.1:irq:-6:/dev/gpio5 9 | X /bin/posixsrv 10 | X /bin/psh 11 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mimas/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs extram extram 9 | - app {{ env.BOOT_DEVICE }} -x grlib-multi extram extram 10 | - app {{ env.BOOT_DEVICE }} -x psh extram extram 11 | - wait 2000 12 | - go! 13 | 14 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt105x/nvm.yaml: -------------------------------------------------------------------------------- 1 | # example NVM config - based on EVK board 2 | flash0: 3 | # external qspi flash - is25wp064a (64Mbit) 4 | size: 0x800000 # 8 MB 5 | block_size: 0x1000 6 | padding_byte: 0xff 7 | partitions: 8 | - name: plo 9 | offs: 0x0 10 | - name: user 11 | offs: 0x11000 12 | # if size not set - last non-virtual partition will be extnded to the end of flash 13 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt117x/nvm.yaml: -------------------------------------------------------------------------------- 1 | # example NVM config - based on EVK board 2 | flash0: 3 | # external qspi flash - is25wp064a (64Mbit) 4 | size: 0x800000 # 8 MB 5 | block_size: 0x1000 6 | padding_byte: 0xff 7 | partitions: 8 | - name: plo 9 | offs: 0x0 10 | - name: user 11 | offs: 0x12000 12 | # if size not set - last non-virtual partition will be extnded to the end of flash 13 | -------------------------------------------------------------------------------- /_targets/riscv64/gr765/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ddr 0x40000 0x7ffffff rwx 6 | - console 0.0 7 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 8 | action: call 9 | set_base: True 10 | device: '{{ env.BOOT_DEVICE }}' 11 | filename: user.plo 12 | offset: '{{ nvm.flash0.kernel.offs }}' 13 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 14 | -------------------------------------------------------------------------------- /_user/hellocpp/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Hello World++ 5 | * 6 | * Example of user application 7 | * 8 | * Copyright 2023 Phoenix Systems 9 | * Author: Dawid Szpejna 10 | * 11 | * This file is part of Phoenix-RTOS. 12 | * 13 | * %LICENSE% 14 | */ 15 | 16 | #include 17 | 18 | 19 | int main(void) 20 | { 21 | std::cout << "Hello World++!" << std::endl; 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /_projects/armv7a7-imx6ull-evk/rootfs-overlay/etc/rc.conf.d/network: -------------------------------------------------------------------------------- 1 | # 2 | # Network configuration 3 | # 4 | 5 | network_interfaces="en1 en2" 6 | 7 | network_en1_enabled="1" 8 | network_en1_mode="static" 9 | network_en1_ip="192.168.122.10" 10 | network_en1_mask="255.255.255.0" 11 | network_en1_gateway="192.168.122.0" 12 | network_en1_metric="0" 13 | 14 | network_en2_enabled="1" 15 | network_en2_mode="dhcp" 16 | network_en2_metric="0" 17 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr712rc-board/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-gr712rc-board project 4 | # 5 | # Copyright 2023 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | b_image_project () { 13 | b_log "The images have been built for the ${TARGET} platform" 14 | } 15 | -------------------------------------------------------------------------------- /_targets/armv7a9/zynq7000/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x zynq-flash ddr ddr 12 | - wait 500 13 | - go! 14 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt105x/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs xip1 dtcm 9 | - app {{ env.BOOT_DEVICE }} -x imxrt-multi xip1 dtcm;io 10 | - app {{ env.BOOT_DEVICE }} -x psh xip1 dtcm 11 | #WARN: no flash driver is being run 12 | - wait 2000 13 | - go! 14 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/sig.vt: -------------------------------------------------------------------------------- 1 | | || | 2 | | || | 3 | / || \ 4 | / || \ 5 |  6 | [6@ 7 | [6@ 8 | [6@ 9 | [6@ 10 |  11 | [6@ 12 | [6@ 13 | [6@ 14 | [6@ 15 |  16 | [6@ 17 | [6@ 18 | [6@ 19 | [6@ 20 |  21 | [6@ 22 | [6@ 23 | [6@ 24 | [6@ 25 |  26 | [6@ 27 | [6@ 28 | [6@ 29 | [6@ 30 |  31 | 32 | Power Without 33 | The Price! 34 | Atari Computers 35 | -------------------------------------------------------------------------------- /_targets/riscv64/grfpga/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | # Spansion S25FL128S 3 | size: 0x1000000 # 16 MB 4 | block_size: 0x10000 5 | padding_byte: 0xff 6 | ptable_blocks: 1 7 | partitions: 8 | - name: bitstr 9 | offs: 0x0 10 | empty: True 11 | - name: plo 12 | offs: 0x400000 13 | size: 0x40000 14 | - name: kernel 15 | - name: rootfs 16 | type: jffs2 17 | offs: 0x500000 18 | size: 0x500000 19 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ddr 0x40000 0x1fffffff rwx 6 | - phfs ram0 4.0 raw 7 | - console 0.0 8 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 9 | action: call 10 | set_base: True 11 | device: '{{ env.BOOT_DEVICE }}' 12 | filename: user.plo 13 | offset: '{{ nvm.flash0.kernel.offs }}' 14 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 15 | -------------------------------------------------------------------------------- /_targets/riscv64/generic/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ddr 0x80200000 0x87ffffff rwx 6 | - phfs ram0 4.0 raw 7 | - console 0.0 8 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 9 | action: call 10 | set_base: True 11 | device: '{{ env.BOOT_DEVICE }}' 12 | filename: user.plo 13 | offset: '{{ nvm.loader.kernel.offs }}' 14 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 15 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.subr: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | rc_log() { 5 | echo -e "\033[1;33m$1\033[0m" 6 | echo $1 > /var/log/bootlog 7 | } 8 | 9 | 10 | rc_msg() { 11 | if [ "X$3" == "Xerr" ]; then 12 | echo $2 -e "\033[1;31m$1\033[0m" 13 | else 14 | echo $2 -e "$1" 15 | fi 16 | } 17 | 18 | 19 | rc_panic() { 20 | rc_msg "[RC PANIC] ==> Enter to diagnostic console" " " err 21 | /bin/ash 22 | while :; do 23 | echo -n "" >/dev/null 24 | done; 25 | } 26 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-spike/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ddr 0x80200000 0x87ffffff rwx 6 | - phfs ram0 4.0 raw 7 | - console 0.0 8 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 9 | action: call 10 | set_base: True 11 | device: '{{ env.BOOT_DEVICE }}' 12 | filename: user.plo 13 | offset: '{{ nvm.loader.kernel.offs }}' 14 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 15 | -------------------------------------------------------------------------------- /_projects/armv8m55-stm32n6-nucleo/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv8m55-stm32n6-nucleo 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | b_image_project () { 15 | b_log "The images have been built for the ${TARGET} platform" 16 | } 17 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr716/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs extram extram 9 | - app {{ env.BOOT_DEVICE }} -x grlib-multi extram extram 10 | - app {{ env.BOOT_DEVICE }} -x psh extram extram 11 | - app {{ env.BOOT_DEVICE }} -x gr716-flash extram extram 12 | - wait 2000 13 | - go! 14 | -------------------------------------------------------------------------------- /_projects/armv7m7-imxrt105x-evk/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt105x-evk project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | b_image_project () { 15 | b_log "The images have been built for the ${TARGET} platform" 16 | } 17 | -------------------------------------------------------------------------------- /_targets/armv8m33/mcxn94x/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: '{{ nvm.flash0.kernel.offs - nvm.flash0.user.offs }}' # 0x800 but ensure we're consistent with NVM config 4 | is_relative: True 5 | 6 | contents: 7 | - kernelimg {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x mcxn94x-multi {{ env.BOOT_DEVICE }} ram;io 9 | - app {{ env.BOOT_DEVICE }} -x psh {{ env.BOOT_DEVICE }} ram 10 | - wait 2000 11 | - go! 12 | -------------------------------------------------------------------------------- /_targets/riscv64/generic/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x uart16550 ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x virtio-blk;-r;0:0 ddr ddr 12 | - wait 500 13 | - go! 14 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/generic/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map sram 0x40000000 0x47ffffff rwx 6 | - console 0.0 7 | - phfs ram0 4.0 raw 8 | 9 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 10 | action: call 11 | set_base: True 12 | device: '{{ env.BOOT_DEVICE }}' 13 | filename: user.plo 14 | offset: '{{ nvm.flash0.kernel.offs }}' 15 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 16 | 17 | -------------------------------------------------------------------------------- /_targets/armv7m4/stm32l4x6/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: '{{ nvm.flash0.kernel.offs - nvm.flash0.user.offs }}' # 0x800 but ensure we're consistent with NVM config 4 | is_relative: True 5 | 6 | contents: 7 | - kernelimg {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x stm32l4-multi {{ env.BOOT_DEVICE }} ram;io;otp 9 | - app {{ env.BOOT_DEVICE }} -x psh {{ env.BOOT_DEVICE }} ram 10 | - wait 2000 11 | - go! 12 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-generic-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-generic-qemu project 4 | # 5 | # Copyright 2023 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export PLO_DEVICES="ram-storage uart-grlib" 12 | 13 | b_image_project () { 14 | b_log "The images have been built for the ${TARGET} platform" 15 | } 16 | -------------------------------------------------------------------------------- /_targets/riscv64/grfpga/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ddr 0x40000 0x7ffffff rwx 6 | - phfs flash0 2.0 raw 7 | - phfs uart1 0.1 phoenixd 8 | - console 0.0 9 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 10 | action: call 11 | set_base: True 12 | device: '{{ env.BOOT_DEVICE }}' 13 | filename: user.plo 14 | offset: '{{ nvm.flash0.kernel.offs }}' 15 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 16 | -------------------------------------------------------------------------------- /scripts/ia32-generic-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running Phoenix-RTOS on QEMU (ia32-generic-qemu) 4 | # 5 | # Copyright 2021 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | exec qemu-system-i386 \ 10 | -cpu pentium3 \ 11 | -smp 1 \ 12 | -serial stdio \ 13 | -vga cirrus \ 14 | -drive "file=$(dirname "${BASH_SOURCE[0]}")/../_boot/ia32-generic-qemu/hd0.disk,format=raw,media=disk,index=0" \ 15 | -netdev user,id=net0 -device rtl8139,netdev=net0 "$@" 16 | -------------------------------------------------------------------------------- /_projects/armv7m4-stm32l4x6-nucleo/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for armv7m4-stm32l4x6-nucleo 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #define TTY2 1 18 | #define UART_CONSOLE 2 19 | #define TTY2_DMA 1 20 | 21 | #define BUILTIN_POSIXSRV 1 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /_projects/armv8r52-mps3an536-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv8r52-mps3an536-qemu project 4 | # 5 | # Copyright 2022, 2024 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | export PLO_DEVICES="flash-mps3an536 uart-cmsdk-apb" 13 | 14 | 15 | b_image_project () { 16 | b_log "The images have been built for the ${TARGET} platform" 17 | } 18 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr740-mini/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-gr740-mini project 4 | # 5 | # Copyright 2025 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | b_image_project () { 13 | b_log "The images have been built for the ${TARGET} platform" 14 | } 15 | 16 | export LWIPOPTS_DIR="$(pwd)/_projects/sparcv8leon-gr740-mini/lwip" 17 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr712rc/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map sram 0x40000000 0x7fffffff rwx 6 | - console 0.0 7 | - phfs uart1 0.1 phoenixd 8 | - phfs flash0 2.0 raw 9 | 10 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 11 | action: call 12 | set_base: True 13 | device: '{{ env.BOOT_DEVICE }}' 14 | filename: user.plo 15 | offset: '{{ nvm.flash0.kernel.offs }}' 16 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 17 | 18 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr740/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map sdram 0x00000000 0x07ffffff rwx 6 | - map flash 0xc0000000 0xcfffffff rwx 7 | - console 0.0 8 | - phfs flash0 2.0 raw 9 | 10 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 11 | action: call 12 | set_base: True 13 | device: '{{ env.BOOT_DEVICE }}' 14 | filename: user.plo 15 | offset: '{{ nvm.flash0.kernel.offs }}' 16 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 17 | -------------------------------------------------------------------------------- /_targets/riscv64/grfpga/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 9 | - app {{ env.BOOT_DEVICE }} -x grlib-uart ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x flashdrv;-r;rootfs:jffs2;-c;0xffff0000;-m;0x90000000;-d;spimctrl ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 12 | - wait 500 13 | - go! 14 | -------------------------------------------------------------------------------- /scripts/ia32-generic-qemu-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running Phoenix-RTOS on QEMU for testing purposes (ia32-generic-qemu) 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | exec qemu-system-i386 \ 10 | -cpu pentium3 \ 11 | -drive "file=$(dirname "${BASH_SOURCE[0]}")/../_boot/ia32-generic-qemu/hd0.disk,format=raw,media=disk,index=0" \ 12 | -nographic \ 13 | -monitor none \ 14 | -netdev user,id=net0 -device rtl8139,netdev=net0 "$@" \ 15 | -d cpu_reset 16 | -------------------------------------------------------------------------------- /.github/problem-matchers/gcc.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "gcc", 5 | "pattern": [ 6 | { 7 | "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "severity": 4, 12 | "message": 5 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /_projects/armv8m33-mcxn94x-frdm/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt117x-evk project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # Use CPU1 15 | export MCX_USE_CPU1=n 16 | 17 | b_image_project () { 18 | b_log "The images have been built for the ${TARGET} platform" 19 | } 20 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | # TODO: rootfs limited temporarily to 8 MB - without working USB it takes a long time to transfer all that data... 11 | - name: rootfs 12 | offs: 0x200000 13 | size: 0x800000 14 | type: jffs2 15 | - name: bitstr 16 | offs: 0x2c00000 # 20 MB from the end 17 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-zcu104/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | # TODO: rootfs limited temporarily to 8 MB - without working USB it takes a long time to transfer all that data... 11 | - name: rootfs 12 | offs: 0x200000 13 | size: 0x800000 14 | type: jffs2 15 | - name: bitstr 16 | offs: 0x2c00000 # 20 MB from the end 17 | -------------------------------------------------------------------------------- /_projects/armv8m33-mcxn94x-frdm_cpu1/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv8m33-mcxn94x-frdm_cpu1 project 4 | # 5 | # Copyright 2025 Phoenix Systems 6 | # Author: Daniel Sawka 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # Use CPU1 15 | export MCX_USE_CPU1=y 16 | 17 | b_image_project () { 18 | b_log "The images have been built for the ${TARGET} platform" 19 | } 20 | -------------------------------------------------------------------------------- /scripts/ia32-generic-qemu-virt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running Phoenix-RTOS on QEMU with VirtIO devices (ia32-generic-qemu) 4 | # 5 | # Copyright 2021 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | exec qemu-system-i386 \ 10 | -cpu pentium3 \ 11 | -smp 1 \ 12 | -serial stdio \ 13 | -device virtio-gpu-pci \ 14 | -drive "file=$(dirname "${BASH_SOURCE[0]}")/../_boot/ia32-generic-qemu/hd0.disk,format=raw,media=disk,index=0" \ 15 | -netdev user,id=net0 -device virtio-net-pci,netdev=net0 16 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-qemu/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x1000000 # 16 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x10000 10 | # bitstream is not used in qemu, make larger rootfs instead 11 | - name: rootfs 12 | offs: 0x400000 13 | size: 0xc00000 14 | type: jffs2 15 | # provide empty virtual bitstr region for _target generic approach to work 16 | - name: bitstr 17 | virtual: True 18 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr712rc/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D sram sram 9 | - app {{ env.BOOT_DEVICE }} -x grlib-multi sram sram 10 | - app {{ env.BOOT_DEVICE }} -x flashdrv;-r;rootfs:jffs2;-c;0x80000000;-m;0x00000000;-d;ftmctrl sdram sdram 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh sram sram 12 | - wait 500 13 | - go! 14 | -------------------------------------------------------------------------------- /scripts/ia32-generic-qemu-net.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running Phoenix-RTOS on QEMU with vibr0 bridge (ia32-generic-qemu) 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | exec qemu-system-i386 \ 10 | -cpu pentium3 \ 11 | -smp 1 \ 12 | -serial stdio \ 13 | -vga cirrus \ 14 | -drive "file=$(dirname "${BASH_SOURCE[0]}")/../_boot/ia32-generic-qemu/hd0.disk,format=raw,media=disk,index=0" \ 15 | -netdev bridge,br=virbr0,id=net0 -device rtl8139,netdev=net0,id=nic0,addr=03.0 16 | -------------------------------------------------------------------------------- /_projects/armv7r5f-zynqmp-qemu/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x40000 10 | # bitstream is not used in qemu - make rootfs take up the rest of disk 11 | - name: rootfs 12 | offs: 0x400000 13 | size: 0x3c00000 14 | type: jffs2 15 | # provide empty virtual bitstr region for _target generic approach to work 16 | - name: bitstr 17 | virtual: True 18 | -------------------------------------------------------------------------------- /_targets/armv7a7/imx6ull/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | #TODO: add SRAM 6 | - map ddr 0x80000000 0x87ffffff rwx 7 | - phfs usb0 1.2 phoenixd 8 | - phfs {{ env.BOOT_DEVICE }} 2.0 raw 9 | - console 0.0 10 | 11 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 12 | action: call 13 | set_base: True 14 | device: '{{ env.BOOT_DEVICE }}' 15 | filename: user.plo 16 | offset: '{{ nvm.flash0.kernel.offs }}' 17 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 18 | 19 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-qemu/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x4000000 # 64 MB 3 | block_size: 512 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x20000 10 | # bitstream is not used in qemu - make rootfs take up the rest of disk 11 | - name: rootfs 12 | offs: 0x400000 13 | size: 0x3c00000 14 | type: jffs2 15 | # provide empty virtual bitstr region for _target generic approach to work 16 | - name: bitstr 17 | virtual: True 18 | -------------------------------------------------------------------------------- /_projects/armv7r5f-zynqmp-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7r5f-zynqmp-qemu project 4 | # 5 | # Copyright 2025 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=y 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | b_image_project () { 17 | b_log "The images have been built for the ${TARGET} platform" 18 | } 19 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zturn/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-zturn project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=n 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | b_image_project () { 17 | b_log "The images have been built for the ${TARGET} platform" 18 | } 19 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mimas/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ocram 0x31000000 0x3101FFFF rwx 6 | - map extram 0x40000000 0x401FFFFF rwx 7 | - phfs uart0 0.0 phoenixd 8 | - console 0.1 9 | 10 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 11 | action: call 12 | set_base: True 13 | device: '{{ env.BOOT_DEVICE }}' 14 | filename: user.plo 15 | offset: 0 # BOOT_DEVICE is UART, offset doesn't matter? 16 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 17 | 18 | 19 | -------------------------------------------------------------------------------- /_targets/armv8m33/mcxn94x/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | # internal flash - 2 banks 1MB - assume the target image can't exceed one bank 3 | size: 0x100000 # 1 MB 4 | block_size: 0x100 # program page size 5 | padding_byte: 0xff 6 | partitions: 7 | - name: plo 8 | offs: 0x0 9 | - name: user 10 | offs: 0xc800 11 | # if size not set - last non-virtual partition will be extnded to the end of flash 12 | 13 | # virtual offset [user.offs] + [user.script.size] 14 | - name: kernel 15 | offs: 0xd000 16 | virtual: True 17 | -------------------------------------------------------------------------------- /_targets/armv7m4/stm32l4x6/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | # internal flash - 2 banks 512 kB - assume the target image can't exceed one bank 3 | size: 0x80000 # 512 kB 4 | block_size: 0x100 # program page size 5 | padding_byte: 0xff 6 | partitions: 7 | - name: plo 8 | offs: 0x0 9 | - name: user 10 | offs: 0xc800 11 | # if size not set - last non-virtual partition will be extnded to the end of flash 12 | 13 | # virtual offset [user.offs] + [user.script.size] 14 | - name: kernel 15 | offs: 0xd000 16 | virtual: True 17 | -------------------------------------------------------------------------------- /_targets/ia32/generic/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ram ram 9 | - if: '{{ env.CONSOLE_APP2 }}' 10 | str: app {{ env.BOOT_DEVICE }} -x {{ env.CONSOLE_APP2 }};-n ram ram 11 | - app {{ env.BOOT_DEVICE }} -x {{ env.CONSOLE_APP }} ram ram 12 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ram ram 13 | - app {{ env.BOOT_DEVICE }} -x pc-ata ram ram 14 | - go! 15 | -------------------------------------------------------------------------------- /_targets/host/generic/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building host-generic project 4 | # 5 | # Copyright 2021 Phoenix Systems 6 | # Author: Tomasz Korniluk 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | b_build_target() { 11 | : 12 | } 13 | 14 | 15 | b_image_target() { 16 | : 17 | } 18 | 19 | b_test_target() { 20 | b_log "Build and install tests in the phoenix-rtos filesystem" 21 | make -C "phoenix-rtos-tests" all install 22 | } 23 | 24 | 25 | export -f b_build_target 26 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt106x/nvm.yaml: -------------------------------------------------------------------------------- 1 | # example NVM config - based on EVK board 2 | flash0: 3 | # internal flash - W25Q32JV (32Mbit) 4 | # not used currently 5 | size: 0x400000 # 4 MB 6 | block_size: 0x1000 7 | padding_byte: 0xff 8 | 9 | flash1: 10 | # external qspi flash - is25wp064a (64Mbit) 11 | size: 0x800000 # 8 MB 12 | block_size: 0x1000 13 | padding_byte: 0xff 14 | partitions: 15 | - name: plo 16 | offs: 0x0 17 | - name: user 18 | offs: 0x11000 19 | # if size not set - last non-virtual partition will be extnded to the end of flash 20 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr716/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map dram 0x30000000 0x3000FFFF rw 6 | - map iram 0x31000000 0x3101FFFF rx 7 | - map extram 0x40000000 0x401FFFFF rwx 8 | - phfs uart3 0.3 phoenixd 9 | - phfs flash0 2.0 raw 10 | - console 0.2 11 | 12 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 13 | action: call 14 | set_base: True 15 | device: '{{ env.BOOT_DEVICE }}' 16 | filename: user.plo 17 | offset: '{{ nvm.flash0.kernel.offs }}' 18 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 19 | 20 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for ia32-generic-qemu 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* UART16550 configuration */ 18 | #define UART16550_CONSOLE_USER 0 19 | #define UART16550_BAUDRATE 115200 20 | 21 | /* pc-tty configuration */ 22 | #define PC_TTY_CREATE_PS2_VDEVS 0 23 | #define PC_TTY_MOUSE_ENABLE 0 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /_targets/ia32/generic/nvm.yaml: -------------------------------------------------------------------------------- 1 | hd0: 2 | size: 0x8000000 # 128 MB 3 | block_size: 512 4 | partitions: 5 | - name: plo 6 | offs: 0x0 7 | size: 0x20000 8 | - name: mbr # place for MBR is reserved inside PLO image 9 | offs: 0x1be 10 | size: 16 # bytes 11 | virtual: True # virtual partitions can overlap with others 12 | - name: kernel 13 | # offs/size will be set based on the offset of the prev/next partition 14 | - name: rootfs 15 | offs: 0x200000 16 | # size will be extended to the end of the disk 17 | # TODO: add type: ext2 18 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/profile: -------------------------------------------------------------------------------- 1 | PATH=/bin:/sbin:/usr/bin:/usr/sbin 2 | 3 | logcat() { 4 | FNAME="$1" 5 | [ -z "$FNAME" ] && FNAME=/var/log/messages 6 | sed 's/\^\[/'$(echo -e "\x1B")'/g' < "$FNAME" 7 | } 8 | 9 | logread() { 10 | tail -F -n 100 "$1" | sed 's/\^\[/'$(echo -e "\x1B")'/g' 11 | } 12 | 13 | log() { 14 | # add more colored facilities if needed 15 | tail -F -n 100 /var/log/messages | sed 's/\^\[/'$(echo -e "\x1B")'/g' 16 | } 17 | 18 | case $- in *i*) 19 | # interactive shell 20 | export PS1='\u@\h:\w \$ ' 21 | export HISTSIZE=500 22 | 23 | cat /etc/logo 24 | esac 25 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt106x/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs xip1 ocram2 9 | - app {{ env.BOOT_DEVICE }} -x imxrt-multi xip1 ocram2;aips14;aips5 10 | - app {{ env.BOOT_DEVICE }} -x psh xip1 ocram2 11 | - app {{ env.BOOT_DEVICE }} imxrt-flash ocram2 ocram2;aips14 12 | - app {{ env.BOOT_DEVICE }} -xn lwip;enet:0x402D8000:130:PHY:ksz8081rnb:0.2:irq:-10:/dev/gpio1:reset:-9:/dev/gpio1 xip1 dtcm;aips14 13 | - wait 2000 14 | - go! 15 | -------------------------------------------------------------------------------- /_targets/ia32/generic/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map ram 0x0 0xffffffff rwx 6 | - phfs com2 0.1 phoenixd 7 | - phfs floppy 2.0 raw 8 | - phfs hd0 2.1 raw 9 | - phfs hd1 2.2 raw 10 | - phfs hd2 2.3 raw 11 | - phfs hd3 2.4 raw 12 | - console {{ env.CONSOLE_DEVICES }} 13 | - wait 1000 14 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 15 | action: call 16 | set_base: True 17 | device: '{{ env.BOOT_DEVICE }}' 18 | filename: user.plo 19 | offset: '{{ nvm.hd0.kernel.offs }}' 20 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 21 | -------------------------------------------------------------------------------- /_projects/ia32-generic-pc/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for ia32-generic-pc 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* UART16550 configuration */ 18 | #define UART16550_CONSOLE_USER 0 19 | #define UART16550_BAUDRATE 115200 20 | 21 | /* pc-tty configuration */ 22 | #define PC_TTY_CREATE_PS2_VDEVS 0 23 | #define PC_TTY_MOUSE_ENABLE 0 24 | #define PC_TTY_MOUSE_SKIP_CONFIG 1 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map kddr 0x000000 0x1fffff rwx # 0 ~ 2 MB 6 | - map ddr 0x200000 0x1fffffff rwx # 2 ~ 512 MB 7 | - map ocram 0xfffc0000 0xffffffff rwx 8 | - phfs uart0 0.0 raw 9 | - phfs flash0 2.0 raw 10 | - phfs ramdisk 4.0 raw 11 | - console 0.0 12 | 13 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 14 | action: call 15 | set_base: True 16 | device: '{{ env.BOOT_DEVICE }}' 17 | filename: user.plo 18 | offset: '{{ nvm.flash0.kernel.offs }}' 19 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 20 | -------------------------------------------------------------------------------- /scripts/sparcv8leon-generic-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on sparcv8leon-generic-qemu 4 | # 5 | # Copyright 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | IMG_PLO_LEON3="$(dirname "${BASH_SOURCE[0]}")/../_boot/sparcv8leon-generic-qemu/plo.elf" 10 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/sparcv8leon-generic-qemu/phoenix.disk" 11 | 12 | exec qemu-system-sparc \ 13 | -smp 1 \ 14 | -m 128M \ 15 | -M leon3_generic \ 16 | -serial mon:stdio \ 17 | -kernel "$IMG_PLO_LEON3" \ 18 | -device loader,file="$IMG_FLASH_QEMU",addr=0x47e00000,force-raw=on 19 | -------------------------------------------------------------------------------- /_projects/armv7m4-stm32l4x6-nucleo/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m4-stm32l4x6-nucleo project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # 15 | # Ports configuration - additional to the one from _targets 16 | # 17 | if [ "$LONG_TEST" = "y" ]; then 18 | export PORTS_COREMARK_PRO=y 19 | fi 20 | 21 | b_image_project () { 22 | b_log "The images have been built for the ${TARGET} platform" 23 | } 24 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/file_id.diz: -------------------------------------------------------------------------------- 1 | _______ _/\______ _____ __/\________ 2 | ___ / |/ / __/ | /| / / _ )/ _/ __/ __/ 3 | __ / /|_/ / _/ | |/ |/ / _ |/ // _/_\ \ 4 | /_/ /_/___/ |__/|__/____/___/___/ / 5 | \ / 6 | +-mw-------- ... mewbies.com ... --/ /------+ 7 | \/ 8 | collection of 101 VT100 ASCII art animation 9 | files by various artist for http://mewbies.com 10 | /acute_terminal_fun_02_view_ascii_art_ansi_art 11 | _and_movies_on_the_terminal.htm#vt100 12 | [vt_files.zip] [01/01] 13 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/gr740/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D sdram sdram 9 | - app {{ env.BOOT_DEVICE }} -x grlib-multi sdram sdram 10 | - app {{ env.BOOT_DEVICE }} -x lwip;greth:0xff940000:24:PHY:ksz9031mnx:0.1:irq:MAC sdram sdram 11 | - app {{ env.BOOT_DEVICE }} -x flashdrv;-r;rootfs:jffs2;-c;0xff903000;-m;0xc0000000;-d;ftmctrl sdram sdram 12 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh sdram sdram 13 | - wait 500 14 | - go! 15 | -------------------------------------------------------------------------------- /_targets/armv7a9/zynq7000/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map kddr 0x100000 0x12ffff rwx 6 | - map ddr 0x130000 0x900000 rwx 7 | - map ocram1 0x00000000 0x00030000 rwx 8 | - phfs usb0 1.2 phoenixd 9 | - phfs uart0 0.0 phoenixd 10 | - phfs uart1 0.1 raw 11 | - phfs flash0 2.0 raw 12 | - console 0.1 13 | 14 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 15 | action: call 16 | set_base: True 17 | device: '{{ env.BOOT_DEVICE }}' 18 | filename: user.plo 19 | offset: '{{ nvm.flash0.kernel.offs }}' 20 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 21 | 22 | -------------------------------------------------------------------------------- /_targets/armv8r52/mps3an536/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | - map atcm 0x00000000 0x00007fff rwxcb 7 | - map bram 0x10000000 0x1007ffff rwxcb 8 | - map ddr 0x20000000 0xdfffffff rwxcb 9 | - phfs flash0 2.0 raw 10 | - console 0.2 11 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 12 | action: call 13 | set_base: True 14 | device: '{{ env.BOOT_DEVICE }}' 15 | filename: user.plo 16 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 17 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 18 | 19 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-qemu/rootfs-overlay/etc/rc: -------------------------------------------------------------------------------- 1 | #!/bin/busybox sh 2 | 3 | . /etc/rc.subr 4 | 5 | export PATH=/bin:/usr/bin 6 | 7 | # Mount RAM disks 8 | mkdir -p /var/log /var/run /var/cfg /var/cfg-req /var/tmp /var/login /var/users-req 9 | 10 | # Create directories if local is empty 11 | if [ ! -d /local/etc ]; then 12 | mkdir /local/etc 13 | fi 14 | if [ ! -d /local/etc/rc.conf.d ]; then 15 | mkdir /local/etc/rc.conf.d 16 | fi 17 | 18 | if [ ! -f /local/etc/passwd ]; then 19 | cp /etc/passwd /local/etc/passwd 20 | fi 21 | 22 | # Custom (per-project, per-customer initialization) 23 | if [ -f /etc/rc.local ]; then 24 | /etc/rc.local 25 | fi 26 | -------------------------------------------------------------------------------- /_targets/aarch64a53/zynqmp/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map kddr 0x000000 0x1fffff rwx # 0 ~ 2 MB 6 | - map ddr 0x200000 0x1fffffff rwx # 2 ~ 512 MB 7 | - map ocram 0xfffc0000 0xffffffff rwx 8 | - phfs uart0 0.0 phoenixd 9 | - phfs uart1 0.1 raw 10 | - phfs flash0 2.0 raw 11 | - phfs ramdisk 4.0 raw 12 | - console 0.1 13 | 14 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 15 | action: call 16 | set_base: True 17 | device: '{{ env.BOOT_DEVICE }}' 18 | filename: user.plo 19 | offset: '{{ nvm.flash0.kernel.offs }}' 20 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 21 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zturn/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 500 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 12 | - name: app 13 | device: '{{ env.BOOT_DEVICE }}' 14 | flags: EXEC 15 | filename: zynq-flash 16 | args: '-r;/dev/mtd0:{{ nvm.flash0.rootfs.offs }}:{{ nvm.flash0.rootfs.size }}:jffs2' 17 | text_map: ddr 18 | data_maps: ddr 19 | - go! 20 | -------------------------------------------------------------------------------- /scripts/armv8r52-mps3an536-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on armv8r52-mps3an536-qemu 4 | # 5 | # Copyright 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | IMG_PLO_ARMv8r52="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv8r52-mps3an536-qemu/plo.elf" 10 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv8r52-mps3an536-qemu/phoenix.disk" 11 | 12 | # uses UART2 for output 13 | exec qemu-system-arm \ 14 | -smp 1 \ 15 | -M mps3-an536 \ 16 | -serial null \ 17 | -serial null \ 18 | -serial mon:stdio \ 19 | -kernel "$IMG_PLO_ARMv8r52" \ 20 | -device loader,file="$IMG_FLASH_QEMU",addr=0x08000000,force-raw=on 21 | -------------------------------------------------------------------------------- /_projects/armv7a7-imx6ull-evk/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 2000 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x imx6ull-uart ddr ddr 11 | - name: app 12 | device: '{{ env.BOOT_DEVICE }}' 13 | flags: EXEC 14 | filename: imx6ull-flashnor 15 | args: 16 | - '-q;1' 17 | - '-r;0;{{ nvm.flash0.rootfs.offs }};{{ nvm.flash0.rootfs.size }};jffs2' 18 | text_map: ddr 19 | data_maps: ddr 20 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 21 | - go! 22 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/inittab: -------------------------------------------------------------------------------- 1 | # /etc/inittab 2 | # 3 | # Copyright (C) 2001 Erik Andersen 4 | # 5 | # Note: BusyBox init doesn't support runlevels. The runlevels field is 6 | # completely ignored by BusyBox init. If you want runlevels, use 7 | # sysvinit. 8 | # 9 | # Format for each entry: ::: 10 | # 11 | # id == tty to run on, or empty for /dev/console 12 | # runlevels == ignored 13 | # action == one of sysinit, respawn, askfirst, wait, and once 14 | # process == program to run 15 | 16 | # Start system 17 | ::sysinit:/bin/ash /etc/rc 18 | ::respawn:/sbin/syslogd -n -b 3 19 | 20 | # Login as root, no password 21 | ::respawn:-/bin/ash 22 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt117x/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - app {{ env.BOOT_DEVICE }} -x dummyfs xip1 ocram2 9 | - app {{ env.BOOT_DEVICE }} -x imxrt-multi xip1 ocram2;aips14;aips5 10 | - app {{ env.BOOT_DEVICE }} -x psh xip1 ocram2 11 | # lwip in itcm memory because dtcm is too small on imxrt117x 12 | - app {{ env.BOOT_DEVICE }} -xn lwip;enet:0x40424000:153:PHY:rtl8201fi-vc-cg:0.3:reset:-12:/dev/gpio12:irq:-11:/dev/gpio9;enet:0x40420000:157:PHY:rtl8211fdi-cg:1.1:reset:-14:/dev/gpio11:irq:-13:/dev/gpio11 xip1 itcm;aips14 13 | - wait 2000 14 | - go! 15 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-qemu project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=y 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | # 17 | # Ports configuration - additional to the one from _targets 18 | # 19 | if [ "$LONG_TEST" = "y" ]; then 20 | export PORTS_COREMARK_PRO=y 21 | fi 22 | 23 | b_image_project () { 24 | b_log "The images have been built for the ${TARGET} platform" 25 | } 26 | -------------------------------------------------------------------------------- /_user/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for user app 3 | # 4 | # Copyright 2021 Phoenix Systems 5 | # 6 | # %LICENSE% 7 | # 8 | 9 | include ../phoenix-rtos-build/Makefile.common 10 | 11 | .DEFAULT_GOAL := all 12 | 13 | # default path for the programs to be installed in rootfs 14 | DEFAULT_INSTALL_PATH := /usr/bin 15 | 16 | # read out all components 17 | ALL_MAKES := $(shell find . -mindepth 2 -name Makefile -not -path '*/.*') 18 | include $(ALL_MAKES) 19 | 20 | # create generic targets 21 | DEFAULT_COMPONENTS := $(ALL_COMPONENTS) 22 | 23 | .PHONY: all install clean 24 | all: $(DEFAULT_COMPONENTS) 25 | install: $(patsubst %,%-install,$(DEFAULT_COMPONENTS)) 26 | clean: $(patsubst %,%-clean,$(ALL_COMPONENTS)) 27 | -------------------------------------------------------------------------------- /scripts/sparcv8leon-generic-qemu-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on sparcv8leon-generic-qemu for test purposes. 4 | # 5 | # Copyright 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski, Damian Modzelewski 7 | # 8 | 9 | IMG_PLO_LEON3="$(dirname "${BASH_SOURCE[0]}")/../_boot/sparcv8leon-generic-qemu/plo.elf" 10 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/sparcv8leon-generic-qemu/phoenix.disk" 11 | 12 | exec qemu-system-sparc \ 13 | -smp 1 \ 14 | -m 128M \ 15 | -M leon3_generic \ 16 | -serial stdio \ 17 | -nographic \ 18 | -monitor none \ 19 | -kernel "$IMG_PLO_LEON3" \ 20 | -device loader,file="$IMG_FLASH_QEMU",addr=0x47e00000,force-raw=on 21 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-qemu/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - blob {{ env.BOOT_DEVICE }} /etc/system.dtb ddr 9 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 12 | - if: True 13 | name: app 14 | device: '{{ env.BOOT_DEVICE }}' 15 | flags: EXEC 16 | filename: zynq-flash 17 | args: '-r;/dev/mtd0:{{ nvm.flash0.rootfs.offs }}:{{ nvm.flash0.rootfs.size }}:jffs2' 18 | text_map: ddr 19 | data_maps: ddr 20 | - wait 500 21 | - go! 22 | -------------------------------------------------------------------------------- /_projects/riscv64-grfpga-artya7/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building riscv64-grfpga-artya7 project 4 | # 5 | # Copyright 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export PLO_DEVICES="uart-grlib flash-spimctrl" 12 | export RISCV_ISA_STRING="rv64gc_zba_zbb_zbs_zbc_zcb_sscofpmf_zicbom_zicond_zfh_zfhmin_zfa" 13 | 14 | b_image_project () { 15 | cp -a "${PREFIX_PROG_STRIPPED}sbi-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 16 | cp -a "${PREFIX_PROG_STRIPPED}sbi-ram-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 17 | b_log "The images have been built for the ${TARGET} platform" 18 | } 19 | -------------------------------------------------------------------------------- /scripts/run-armv7a7-imx6ull-evk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for plo setup without flashing the image 4 | # 5 | # Copyright 2021, 2023 Phoenix Systems 6 | # Author: Aleksander Kaminski, Gerard Swiderski, Hubert Badocha 7 | # 8 | set -e 9 | 10 | cd "$(dirname "$0")" 11 | 12 | TARGET=armv7a7-imx6ull-evk 13 | 14 | . flashing-common.bash 15 | 16 | check_arguments "$@" 17 | 18 | pushd "${boot_path}/${TARGET}" 19 | ./psu plo-ram.sdp 20 | run_phoenixd "${prog_path}" 21 | sleep 1 22 | popd 23 | 24 | echo "Sending plo commands:" 25 | 26 | plo_command "kernel usb0" 27 | plo_command "app usb0 -x dummyfs ddr ddr" 28 | plo_command "app usb0 -x imx6ull-uart ddr ddr" 29 | plo_command "app usb0 -x psh ddr ddr" 30 | plo_command "go!" 31 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt105x/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | - map itcm 0x0 0x28000 rwxcb 7 | - map dtcm 0x20000000 0x20048000 rwcb 8 | - map ocram 0x20200000 0x20220000 rwxcb 9 | - map xip1 0x60000000 0x60800000 rxcb 10 | - map io 0x40000000 0x50000000 rw 11 | - phfs usb0 1.2 phoenixd 12 | - phfs flash0 2.0 raw 13 | - console 0.0 14 | 15 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 16 | action: call 17 | set_base: True 18 | device: '{{ env.BOOT_DEVICE }}' 19 | filename: user.plo 20 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 21 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 22 | 23 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - blob {{ env.BOOT_DEVICE }} /etc/system.dtb ddr 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x zynq-i2c;0 ddr ddr 12 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 13 | - if: True 14 | name: app 15 | device: '{{ env.BOOT_DEVICE }}' 16 | flags: EXEC 17 | filename: zynq-flash 18 | args: '-r;/dev/mtd0:{{ nvm.flash0.rootfs.offs }}:{{ nvm.flash0.rootfs.size }}:jffs2' 19 | text_map: ddr 20 | data_maps: ddr 21 | - wait 500 22 | - go! 23 | -------------------------------------------------------------------------------- /docker-devel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running the devel docker with arguments passed to the script 4 | # 5 | # Copyright 2021, 2023 Phoenix Systems 6 | # Author: Hubert Buczynski, Hubert Badocha 7 | # 8 | 9 | DOCKER_IMG_NAME=phoenixrtos/devel 10 | PATH_TO_PROJECT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/" 11 | 12 | if [ "$#" -eq 0 ]; then 13 | exec docker run -it --privileged --rm -h "$(hostname)-docker" --env-file .docker_env -v /dev/bus/usb/:/dev/bus/usb -v "${PATH_TO_PROJECT}:/project" -w /project "$DOCKER_IMG_NAME" bash 14 | else 15 | exec docker run -it --privileged --rm -h "$(hostname)-docker" --env-file .docker_env -v /dev/bus/usb/:/dev/bus/usb -v "${PATH_TO_PROJECT}:/project:delegated" -w /project "$DOCKER_IMG_NAME" "$(printf "%q " "$@")" 16 | fi 17 | -------------------------------------------------------------------------------- /_targets/riscv64/generic/nvm.yaml: -------------------------------------------------------------------------------- 1 | loader: 2 | size: 0x400000 # 4 MB 3 | block_size: 512 4 | partitions: 5 | # WARN: the plo embedded in SBI is being run, not the one in loader.disk 6 | - name: plo 7 | offs: 0x0 8 | size: 0x10000 9 | - name: kernel 10 | # offs/size will be set based on the offset of the prev/next partition 11 | 12 | # separate block device for rootfs 13 | vblk0: 14 | size: 0x4000000 # 64 MB 15 | block_size: 512 16 | partitions: 17 | - name: mbr 18 | offs: 0x1be 19 | size: 66 # bytes - until the end of the sector 20 | virtual: True # don't expect to be aligned to the sector 21 | - name: rootfs 22 | offs: 0x1400 23 | # size will be extended to the end of the disk 24 | # TODO: add type: ext2 25 | 26 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-zcu104/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - kernel {{ env.BOOT_DEVICE }} 8 | - blob {{ env.BOOT_DEVICE }} /etc/system.dtb ddr 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x zynqmp-can;-n;1;-b;1000 ddr ddr 12 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 13 | - if: True 14 | name: app 15 | device: '{{ env.BOOT_DEVICE }}' 16 | flags: EXEC 17 | filename: zynq-flash 18 | args: '-r;/dev/mtd0:{{ nvm.flash0.rootfs.offs }}:{{ nvm.flash0.rootfs.size }}:jffs2' 19 | text_map: ddr 20 | data_maps: ddr 21 | - wait 1500 22 | - go! 23 | -------------------------------------------------------------------------------- /_projects/armv7m7-imxrt106x-evk/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt106x-evk project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # 15 | # lwIP configuration 16 | # 17 | LWIPOPTS_DIR="$(pwd)/_projects/$TARGET/lwip" 18 | export LWIPOPTS_DIR 19 | export LWIP_IPSEC_BUILD=no 20 | export LWIP_WIFI_BUILD=no 21 | 22 | # 23 | # Ports configuration - additional to the one from _targets 24 | # 25 | if [ "$LONG_TEST" = "y" ]; then 26 | export PORTS_COREMARK_PRO=y 27 | fi 28 | 29 | b_image_project () { 30 | b_log "The images have been built for the ${TARGET} platform" 31 | } 32 | -------------------------------------------------------------------------------- /_projects/armv7m7-imxrt117x-evk/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt117x-evk project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # 15 | # lwIP configuration 16 | # 17 | LWIPOPTS_DIR="$(pwd)/_projects/$TARGET/lwip" 18 | export LWIPOPTS_DIR 19 | export LWIP_IPSEC_BUILD=no 20 | export LWIP_WIFI_BUILD=no 21 | 22 | # 23 | # Ports configuration - additional to the one from _targets 24 | # 25 | if [ "$LONG_TEST" = "y" ]; then 26 | export PORTS_COREMARK_PRO=y 27 | fi 28 | 29 | b_image_project () { 30 | b_log "The images have been built for the ${TARGET} platform" 31 | } 32 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt117x/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | - map itcm 0x0 0x40000 rwxcb 7 | - map dtcm 0x20000000 0x20040000 rwcb 8 | - map ocram2 0x202c0000 0x20340000 rwxcb 9 | - map aips14 0x40000000 0x41000000 rws 10 | - map aips5 0x42000000 0x42100000 rws 11 | - map xip1 0x30000000 0x30400000 rxcb 12 | - phfs usb0 1.2 phoenixd 13 | - phfs flash0 2.0 raw 14 | - console 0.0 15 | 16 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 17 | action: call 18 | set_base: True 19 | device: '{{ env.BOOT_DEVICE }}' 20 | filename: user.plo 21 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 22 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 23 | 24 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zedboard/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-zedboard project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | # TODO: why? because we're always erasing partition in PLO beforehand (it writes eraseblocks automatically) 13 | export FS_WRITE_CLEANMARKERS=n 14 | 15 | # No networking 16 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 17 | 18 | # 19 | # Ports configuration - additional to the one from _targets 20 | # 21 | if [ "$LONG_TEST" = "y" ]; then 22 | export PORTS_COREMARK_PRO=y 23 | fi 24 | 25 | b_image_project () { 26 | b_log "The images have been built for the ${TARGET} platform" 27 | } 28 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-spike/build.project: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for building riscv64-generic-spike project 4 | # 5 | # Copyright 2022, 2024 Phoenix Systems 6 | # Author: Lukasz Kosinski, Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | export PLO_DEVICES="ram-storage tty-spike" 13 | export RISCV_ISA_STRING="rv64gch_zicbom_zicboz_zicntr_zihintntl_zihintpause_zihpm_zawrs_zfa_zca_zcd_zba_zbb_zbc_zbs_sstc" 14 | 15 | b_image_project () { 16 | b_log "Adding PLO to Phoenix SBI" 17 | make -C plo/riscv-sbi all PAYLOAD_PATH="$PREFIX_BOOT/loader.disk" PAYLOAD_ADDR=0x80200000 18 | cp -a "${PREFIX_PROG}sbi-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 19 | 20 | b_log "The images have been built for the ${TARGET} platform" 21 | } 22 | -------------------------------------------------------------------------------- /_targets/armv7r5f/zynqmp/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | - map atcm 0x00000 0x20000 rxcb # 0 ~ 128 KB 6 | - map btcm 0x20000 0x40000 rwxcb # 128 ~ 256 KB 7 | - map kddr 0x100000 0x400000 rwcb # 1 ~ 4 MB 8 | - map ddr 0x400000 0x2000000 rwxcb # 4 ~ 32 MB 9 | - map devs 0x80000000 0xfffc0000 rwbs # 2 GB ~ -256 KB 10 | - map ocram 0xfffc0000 0x00000000 rcb # -256 KB ~ top of memory 11 | - phfs uart0 0.0 phoenixd 12 | - phfs uart1 0.1 raw 13 | - phfs flash0 2.0 raw 14 | - phfs ramdisk 4.0 raw 15 | - console 0.1 16 | 17 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 18 | action: call 19 | set_base: True 20 | device: '{{ env.BOOT_DEVICE }}' 21 | filename: user.plo 22 | offset: '{{ nvm.flash0.kernel.offs }}' 23 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 24 | -------------------------------------------------------------------------------- /_targets/armv7m4/stm32l4x6/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x200 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | # env.BOOT_DEVICE should correspond to one of the map names 7 | - map flash0 0x08000000 0x08080000 rxcb 8 | - map flash1 0x08080000 0x08100000 rxcb 9 | - map ram 0x20000000 0x20050000 rwxcb 10 | - map io 0x40000000 0x60000000 rw 11 | - map otp 0x1fff0000 0x20000000 rw 12 | - phfs flash0 2.0 raw 13 | - phfs flash1 2.1 raw 14 | - phfs ramdev 4.0 raw 15 | - console 0.1 16 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 17 | action: call 18 | set_base: True 19 | device: '{{ env.BOOT_DEVICE }}' 20 | filename: user.plo 21 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 22 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 23 | 24 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-som/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-qemu project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=y 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | # Use PCI Express PS GTR PHY init code 17 | export PCI_EXPRESS_INIT_TEBF0808_PHY=y 18 | # Use Xilinx NWL PCI Express driver (PCI Express located in processing subsystem) 19 | export PCI_EXPRESS_XILINX_NWL=y 20 | # Use Xilinx AXI PCI Express driver (PCI Express located in programmable logic) 21 | export PCI_EXPRESS_XILINX_AXI=n 22 | 23 | b_image_project () { 24 | b_log "The images have been built for the ${TARGET} platform" 25 | } 26 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building ia32-generic-qemu project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Kosinski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | # 12 | # lwIP configuration 13 | # 14 | export LWIPOPTS_DIR="$(pwd)/_projects/ia32-generic-qemu/lwip" 15 | 16 | # 17 | # Busybox configuration 18 | # 19 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 20 | 21 | # 22 | # Ports configuration - additional to the one from _targets 23 | # 24 | export PORTS_MBEDTLS=y 25 | export PORTS_AZURE_SDK=n # FIXME: requires port to macos 26 | if [ "$LONG_TEST" = "y" ]; then 27 | export PORTS_COREMARK_PRO=y 28 | fi 29 | 30 | b_image_project () { 31 | b_log "The images have been built for the ${TARGET} platform" 32 | } 33 | -------------------------------------------------------------------------------- /_targets/armv8m33/mcxn94x/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x200 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | # env.BOOT_DEVICE should correspond to one of the map names 7 | - map flash0 0x00000000 0x00100000 rxcb 8 | - map flash1 0x00100000 0x00200000 rxcb 9 | - map ramx 0x14000000 0x14020000 rxcb 10 | - map ram 0x20000000 0x20068000 rwxcb # RAM A ... RAM H 11 | - map io 0x40000000 0x80000000 rw 12 | - phfs flash0 2.0 raw 13 | - phfs flash1 2.1 raw 14 | - phfs ramdev 4.0 raw 15 | - console 0.4 16 | 17 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 18 | action: call 19 | set_base: True 20 | device: '{{ env.BOOT_DEVICE }}' 21 | filename: user.plo 22 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 23 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 24 | 25 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-zcu104/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-qemu project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=y 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | # Use PCI Express PS GTR PHY init code 17 | export PCI_EXPRESS_INIT_TEBF0808_PHY=n 18 | # Use Xilinx NWL PCI Express driver (PCI Express located in processing subsystem) 19 | export PCI_EXPRESS_XILINX_NWL=n 20 | # Use Xilinx AXI PCI Express driver (PCI Express located in programmable logic) 21 | export PCI_EXPRESS_XILINX_AXI=n 22 | 23 | b_image_project () { 24 | b_log "The images have been built for the ${TARGET} platform" 25 | } 26 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt106x/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x1000 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | - map itcm 0x0 0x28000 rwxcb 7 | - map dtcm 0x20000000 0x20058000 rwcb 8 | - map ocram2 0x20200000 0x20280000 rwxcb 9 | - map aips14 0x40000000 0x40400000 rws 10 | - map aips5 0x42000000 0x42100000 rws 11 | - map xip2 0x60000000 0x64000000 rxcb 12 | - map xip1 0x70000000 0x70400000 rxcb 13 | - phfs usb0 1.2 phoenixd 14 | - phfs flash0 2.0 raw 15 | - phfs flash1 2.1 raw 16 | - console 0.0 17 | 18 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 19 | action: call 20 | set_base: True 21 | device: '{{ env.BOOT_DEVICE }}' 22 | filename: user.plo 23 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 24 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 25 | 26 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zedboard/nvm.yaml: -------------------------------------------------------------------------------- 1 | flash0: 2 | size: 0x2000000 # 32 MB 3 | block_size: 0x1000 4 | padding_byte: 0xff 5 | partitions: 6 | - name: plo 7 | offs: 0x0 8 | - name: kernel 9 | offs: 0x10000 10 | - name: bitstr 11 | offs: 0x400000 12 | - name: rootfs 13 | offs: 0x800000 14 | size: 0x1000000 15 | type: jffs2 16 | - name: data 17 | size: 0x4e0000 18 | empty: True # TODO: remove when it will be actually used 19 | 20 | 21 | # Spansion s25fl256s1 has 2 regions with 4kB / 64kB erase blocks 22 | # currently zynq-flash creates separate device for every region 23 | - name: mtd0 24 | virtual: True 25 | offs: 0x0 26 | size: 0x20000 27 | # eraseblock_size: 4 kB 28 | - name: mtd1 29 | virtual: True 30 | offs: 0x20000 31 | size: 0x1FE0000 32 | # eraseblock_size: 64 kB 33 | -------------------------------------------------------------------------------- /mtd-utils/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ "$(uname)" = "Darwin" ]; then 6 | b_log "Building mtd-utils" 7 | 8 | PREFIX_MTD_UTILS="${PREFIX_PROJECT}/mtd-utils" 9 | PREFIX_MTD_UTILS_BUILD="${PREFIX_BUILD_HOST}/mtd-utils" 10 | 11 | mkdir -p "$PREFIX_MTD_UTILS_BUILD" 12 | 13 | pushd "$PREFIX_MTD_UTILS_BUILD" 14 | if [ ! -f "${PREFIX_BUILD_HOST}/prog.stripped/mkfs.jffs2" ]; then 15 | tar xzvf "$PREFIX_MTD_UTILS/mtd-utils-patched.tar.gz" 16 | 17 | if [ -f Makefile ]; then 18 | make distclean 19 | fi 20 | 21 | ./autogen.sh 22 | CFLAGS="" LDFLAGS="" CC=gcc ./configure --without-ubifs --without-lzo --without-xattr 23 | fi 24 | 25 | make mkfs.jffs2 26 | 27 | mkdir -p "${PREFIX_BUILD_HOST}/prog" 28 | mkdir -p "${PREFIX_BUILD_HOST}/prog.stripped" 29 | cp -a mkfs.jffs2 "${PREFIX_BUILD_HOST}/prog/" 30 | cp -a mkfs.jffs2 "${PREFIX_BUILD_HOST}/prog.stripped" 31 | popd 32 | fi 33 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: WebKit 3 | 4 | ColumnLimit: 0 5 | AlignAfterOpenBracket: DontAlign 6 | UseTab: ForContinuationAndIndentation 7 | IndentWidth: 4 8 | ContinuationIndentWidth: 8 9 | BracedInitializerIndentWidth: 4 10 | TabWidth: 4 11 | 12 | PointerAlignment: Right 13 | SpaceAfterCStyleCast: false 14 | BreakBeforeBraces: Stroustrup 15 | 16 | AlignConsecutiveMacros: 17 | Enabled: true 18 | AlignEscapedNewlines: DontAlign 19 | AlignTrailingComments: 20 | Kind: Always 21 | OverEmptyLines: 0 22 | AllowShortBlocksOnASingleLine: true 23 | AllowShortCaseLabelsOnASingleLine: true 24 | AllowShortLoopsOnASingleLine: false 25 | IndentCaseLabels: true 26 | MaxEmptyLinesToKeep: 2 27 | SortIncludes: false 28 | SpacesBeforeTrailingComments: 2 29 | 30 | BreakBeforeBinaryOperators: None 31 | BreakBeforeTernaryOperators: false 32 | BreakConstructorInitializers: AfterColon 33 | 34 | InsertNewlineAtEOF: true 35 | ... 36 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-zedboard/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 500 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 12 | # WARN: for mounting partitions in mtd1 region we need to subtract mtd1 base offset 13 | - name: app 14 | device: '{{ env.BOOT_DEVICE }}' 15 | flags: EXEC 16 | filename: zynq-flash 17 | args: 18 | - '-r;/dev/mtd1:{{ "%#x" % (nvm.flash0.rootfs.offs - nvm.flash0.mtd1.offs) }}:{{ "%#x" % nvm.flash0.rootfs.size }}:jffs2' 19 | - '-p;/dev/mtd1:{{ "%#x" % (nvm.flash0.data.offs - nvm.flash0.mtd1.offs) }}:{{ "%#x" % nvm.flash0.data.size }}' 20 | text_map: ddr 21 | data_maps: ddr 22 | - go! 23 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-qemu/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for riscv64-generic-qemu 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* UART16550 configuration */ 18 | #define UART16550_CONSOLE_USER 0 19 | #define UART16550_BAUDRATE 115200 20 | #define UART16550_IRQ 10 21 | #define UART16550_BASE 0x10000000 22 | 23 | /* SPIKE-TTY configuration */ 24 | #define SPIKETTY_CONSOLE_USER 0 25 | 26 | #define TIMER_FREQ (10 * 1000 * 1000) 27 | 28 | #define RAM_ADDR 0x20000000u 29 | #define RAM_BANK_SIZE 0x10000000u 30 | 31 | #define PLIC_BASE 0xc000000 32 | #define PLIC_IRQ_SIZE 54 33 | 34 | #define SBI_AREA_START 0x80000000UL 35 | #define SBI_AREA_END 0x80200000UL 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building riscv64-gr765-fpga project 4 | # 5 | # Copyright 2025 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | 12 | export PLO_DEVICES="uart-grlib ram-storage" 13 | export BOOT_DEVICE="ram0" 14 | export RISCV_ISA_STRING="rv64gch_zba_zbb_zbs_zbc_zbkc_zbkb_zbkx_zcb_zkn_zkr_sscofpmf_sstc_ssstateen_smepmp_smaia_ssaia_zicbom_zicond_zfh_zfhmin" 15 | 16 | b_image_project () { 17 | rm -f "$PREFIX_BOOT/sbi-${TARGET_SUBFAMILY}.elf" 18 | rm -f "$PREFIX_BOOT/sbi-ram-${TARGET_SUBFAMILY}.elf" 19 | cp -a "${PREFIX_PROG_STRIPPED}sbi-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 20 | cp -a "${PREFIX_PROG_STRIPPED}sbi-ram-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 21 | b_log "The images have been built for the ${TARGET} platform" 22 | } 23 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-spike/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for riscv64-generic-spike 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Kosinski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* UART16550 configuration */ 18 | #define UART16550_CONSOLE_USER 0 19 | #define UART16550_BAUDRATE 115200 20 | #define UART16550_IRQ 1 21 | #define UART16550_BASE 0x10000000 22 | 23 | /* SPIKE-TTY configuration */ 24 | #define SPIKETTY_CONSOLE_USER 0 25 | 26 | #define TIMER_FREQ (10 * 1000 * 1000) 27 | 28 | #define RAM_ADDR 0x80200000u 29 | #define RAM_BANK_SIZE 0x10000000u 30 | 31 | #define PLIC_BASE 0xc000000 32 | #define PLIC_IRQ_SIZE 32 33 | 34 | #define SBI_AREA_START 0x80000000UL 35 | #define SBI_AREA_END 0x80200000UL 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /scripts/armv7a9-zynq7000-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running phoenix-rtos loader on Qemu fork from Xilinx (zynq-7000) 4 | # 5 | # Copyright 2021 Phoenix Systems 6 | # Author: Hubert Buczynski 7 | # 8 | 9 | IMG_PLO_ZYNQ7000="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7a9-zynq7000-qemu/plo.img" 10 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7a9-zynq7000-qemu/flash0.disk" 11 | DTB_ZYNQ7000="$(dirname "${BASH_SOURCE[0]}")/../scripts/zynq7000-zc702-single.dtb" 12 | 13 | for FILE in "$IMG_PLO_ZYNQ7000" "$IMG_FLASH_QEMU" "$DTB_ZYNQ7000"; do 14 | if [ ! -f "$FILE" ]; then 15 | echo "Missing required file: $FILE" 16 | exit 1 17 | fi 18 | done 19 | 20 | exec qemu-system-aarch64 \ 21 | -M arm-generic-fdt-7series \ 22 | -dtb "$DTB_ZYNQ7000" \ 23 | -serial null \ 24 | -serial mon:stdio \ 25 | -device loader,file="$IMG_PLO_ZYNQ7000" \ 26 | -drive file="$IMG_FLASH_QEMU",if=mtd,format=raw,index=0 27 | -------------------------------------------------------------------------------- /_projects/armv7a9-zynq7000-qemu/user.plo.yaml: -------------------------------------------------------------------------------- 1 | # kernel + initrd 2 | magic: '{{ env.MAGIC_USER_SCRIPT }}' 3 | size: 0x1000 4 | is_relative: True 5 | 6 | contents: 7 | - wait 500 8 | - kernel {{ env.BOOT_DEVICE }} 9 | - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D ddr ddr 10 | - app {{ env.BOOT_DEVICE }} -x zynq-uart ddr ddr 11 | - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh ddr ddr 12 | - if: True 13 | name: app 14 | device: '{{ env.BOOT_DEVICE }}' 15 | flags: EXEC 16 | filename: zynq-flash 17 | args: '-r;/dev/mtd0:{{ nvm.flash0.rootfs.offs }}:{{ nvm.flash0.rootfs.size }}:jffs2' 18 | text_map: ddr 19 | data_maps: ddr 20 | 21 | # NOTE: these blob objects are not needed, just serve as an example/image_builder test 22 | - name: blob 23 | device: '{{ env.BOOT_DEVICE }}' 24 | filename: /etc/logo 25 | data_maps: ddr 26 | - blob {{ env.BOOT_DEVICE }} /etc/hostid ddr 27 | - go! 28 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.d/sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /etc/rc.subr 4 | 5 | DROPBEAR="/usr/sbin/dropbear" 6 | PIDFILE=/var/run/dropbear.pid 7 | 8 | 9 | start() { 10 | rc_msg "Starting SSH server" -n 11 | if ! $DROPBEAR -R -B -P $PIDFILE; then 12 | rc_msg " [FAILED]" " " err 13 | exit 1 14 | fi 15 | echo "" 16 | } 17 | 18 | 19 | stop() { 20 | if [ -f "$PIDFILE" ]; then 21 | PID=$(cat $PIDFILE) 22 | 23 | echo "Stopping SSH server" 24 | #FIXME: the only way to kill dropbear for now until we fix read/write interruption 25 | kill $PID 26 | /bin/scp localhost:drop . 2&> /dev/null 27 | else 28 | rc_msg "SSH server is not running" " " err 29 | fi; 30 | } 31 | 32 | 33 | case "$1" in 34 | start) 35 | start 36 | ;; 37 | stop) 38 | stop 39 | ;; 40 | restart) 41 | stop 42 | sleep 1 43 | start 44 | ;; 45 | *) 46 | echo "Unknown command, only start/stop are supported" " " err 47 | ;; 48 | esac 49 | 50 | exit $? 51 | -------------------------------------------------------------------------------- /scripts/armv7a9-zynq7000-qemu-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for running phoenix-rtos loader on Qemu fork from Xilinx (zynq-7000) 4 | # 5 | # Copyright 2021 Phoenix Systems 6 | # Author: Hubert Buczynski, Damian Modzelewski 7 | # 8 | 9 | IMG_PLO_ZYNQ7000="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7a9-zynq7000-qemu/plo.img" 10 | DTB_ZYNQ7000="$(dirname "${BASH_SOURCE[0]}")/../scripts/zynq7000-zc702-single.dtb" 11 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7a9-zynq7000-qemu/flash0.disk" 12 | 13 | for FILE in "$IMG_PLO_ZYNQ7000" "$IMG_FLASH_QEMU" "$DTB_ZYNQ7000"; do 14 | if [ ! -f "$FILE" ]; then 15 | echo "Missing required file: $FILE" 16 | exit 1 17 | fi 18 | done 19 | 20 | exec qemu-system-aarch64 \ 21 | -M arm-generic-fdt-7series \ 22 | -dtb "$DTB_ZYNQ7000" \ 23 | -serial null \ 24 | -serial stdio \ 25 | -device loader,file="$IMG_PLO_ZYNQ7000" \ 26 | -drive file="$IMG_FLASH_QEMU",if=mtd,format=raw,index=0 27 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.d/telnetd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /etc/rc.subr 4 | 5 | TELNETD=/usr/sbin/telnetd 6 | PIDFILE=/var/run/telnetd.pid 7 | 8 | 9 | start() { 10 | if [ -f $PIDFILE ]; then 11 | echo "Telnet server is already running" 12 | exit 1 13 | fi 14 | 15 | echo "Starting Telnet server" 16 | 17 | $TELNETD -l /bin/login & echo $! > $PIDFILE 18 | } 19 | 20 | 21 | stop() { 22 | if [ -f "$PIDFILE" ]; then 23 | echo "Stopping Telnet server" 24 | PID=$(cat $PIDFILE) 25 | kill $PID > /dev/null 26 | 27 | #hack alert - we need to poke telnet to exit 28 | nc localhost 23 > /dev/null 29 | 30 | rm $PIDFILE 31 | else 32 | rc_msg "Telnet server is not running" " " err 33 | fi; 34 | } 35 | 36 | 37 | case "$1" in 38 | start) 39 | start 40 | ;; 41 | stop) 42 | stop 43 | ;; 44 | restart) 45 | stop 46 | sleep 1 47 | start 48 | ;; 49 | *) 50 | echo "Unknown command, only start/stop are supported" 51 | ;; 52 | esac 53 | 54 | exit $? 55 | -------------------------------------------------------------------------------- /scripts/armv7r5f-zynqmp-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on armv7r5f-zynqmp-qemu 4 | # 5 | # Copyright 2025 Phoenix Systems 6 | # Author: Jacek Maksymowicz 7 | # 8 | 9 | IMG_PLO_ZYNQMP="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7r5f-zynqmp-qemu/plo.elf" 10 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/armv7r5f-zynqmp-qemu/flash0.disk" 11 | DTB_ZYNQMP="$(dirname "${BASH_SOURCE[0]}")/../scripts/zynqmp-zcu104.dtb" 12 | 13 | for FILE in "$IMG_PLO_ZYNQMP" "$IMG_FLASH_QEMU" "$DTB_ZYNQMP"; do 14 | if [ ! -f "$FILE" ]; then 15 | echo "Missing required file: $FILE" 16 | exit 1 17 | fi 18 | done 19 | 20 | exec qemu-system-aarch64 \ 21 | -M arm-generic-fdt \ 22 | -serial null \ 23 | -serial mon:stdio \ 24 | -hw-dtb "$DTB_ZYNQMP" \ 25 | -device loader,file="$IMG_PLO_ZYNQMP",cpu-num=4 \ 26 | -drive file="$IMG_FLASH_QEMU",if=mtd,format=raw,index=0 \ 27 | -device loader,addr=0xff5e023c,data=0x80008fde,data-len=4 \ 28 | -m 2G \ 29 | -display none 30 | -------------------------------------------------------------------------------- /_projects/aarch64a53-zynqmp-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a9-zynq7000-qemu project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Damian Loewnau 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export FS_WRITE_CLEANMARKERS=y 12 | 13 | # No networking 14 | export BUSYBOX_CONFIG="${PROJECT_PATH}/busybox_config" 15 | 16 | # 17 | # Ports configuration - additional to the one from _targets 18 | # 19 | if [ "$LONG_TEST" = "y" ]; then 20 | export PORTS_COREMARK_PRO=y 21 | fi 22 | 23 | # Use PCI Express PS GTR PHY init code 24 | export PCI_EXPRESS_INIT_TEBF0808_PHY=n 25 | # Use Xilinx NWL PCI Express driver (PCI Express located in processing subsystem) 26 | export PCI_EXPRESS_XILINX_NWL=y 27 | # Use Xilinx AXI PCI Express driver (PCI Express located in programmable logic) 28 | export PCI_EXPRESS_XILINX_AXI=n 29 | 30 | b_image_project () { 31 | b_log "The images have been built for the ${TARGET} platform" 32 | } 33 | -------------------------------------------------------------------------------- /_projects/riscv64-generic-qemu/build.project: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for building riscv64-generic-qemu project 4 | # 5 | # Copyright 2022, 2024 Phoenix Systems 6 | # Author: Lukasz Kosinski, Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export PLO_DEVICES="ram-storage uart-16550" 12 | export RISCV_ISA_STRING="rv64gch_zicbom_zicboz_zicntr_zihintntl_zihintpause_zihpm_zawrs_zfa_zca_zcd_zba_zbb_zbc_zbs_sstc" 13 | 14 | # 15 | # Ports configuration - additional to the one from _targets 16 | # 17 | if [ "$LONG_TEST" = "y" ]; then 18 | export PORTS_COREMARK_PRO=y 19 | fi 20 | 21 | b_image_project () { 22 | b_log "Adding PLO to Phoenix SBI" 23 | # WARN: the plo embedded in SBI is being run, not the one in loader.disk 24 | make -C plo/riscv-sbi all PAYLOAD_PATH="$PREFIX_BOOT/plo.img" PAYLOAD_ADDR=0x80200000 25 | cp "${PREFIX_PROG}sbi-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 26 | 27 | b_log "The images have been built for the ${TARGET} platform" 28 | } 29 | -------------------------------------------------------------------------------- /scripts/riscv64-generic-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on QEMU (riscv64-generic-qemu) 4 | # 5 | # Copyright 2021, 2024 Phoenix Systems 6 | # Author: Lukasz Kosinski, Lukasz Leczkowski 7 | # 8 | 9 | REGEX="version ([0-9]+)\.([0-9]+)" 10 | OPTIMG="" 11 | 12 | # Determine QEMU version 13 | [[ $(qemu-system-riscv64 --version) =~ $REGEX ]] 14 | MAJOR="${BASH_REMATCH[1]}" 15 | MINOR="${BASH_REMATCH[2]}" 16 | 17 | # Select QEMU option for passing kernel image 18 | if [[ "$MAJOR" -gt 4 || ( "$MAJOR" -eq 4 && "$MINOR" -ge 1 ) ]]; then 19 | OPTIMG="-bios" 20 | else 21 | OPTIMG="-kernel" 22 | fi 23 | 24 | exec qemu-system-riscv64 \ 25 | -smp 1 \ 26 | -machine virt \ 27 | "$OPTIMG" "$(dirname "${BASH_SOURCE[0]}")/../_boot/riscv64-generic-qemu/sbi-generic.elf" \ 28 | -serial stdio \ 29 | -drive file="$(dirname "${BASH_SOURCE[0]}")/../_boot/riscv64-generic-qemu/vblk0.disk",format=raw,cache=unsafe,if=none,id=vblk0 \ 30 | -device virtio-blk-device,drive=vblk0 \ 31 | -device loader,file="$(dirname "${BASH_SOURCE[0]}")/../_boot/riscv64-generic-qemu/loader.disk",addr=0x20000000 32 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/etc/rc: -------------------------------------------------------------------------------- 1 | #!/bin/busybox sh 2 | 3 | . /etc/rc.subr 4 | 5 | export PATH=/bin:/usr/bin 6 | 7 | # Mount RAM disks 8 | mkdir -p /var/log /var/run /var/cfg /var/cfg-req /var/tmp /var/login /var/users-req 9 | 10 | # Create directories if local is empty 11 | if [ ! -d /local/etc ]; then 12 | mkdir /local/etc 13 | fi 14 | if [ ! -d /local/etc/rc.conf.d ]; then 15 | mkdir /local/etc/rc.conf.d 16 | fi 17 | 18 | # RTC has failed, set last "build" date 19 | # sleep 1 20 | # TIMESTAMP_FILE="/bin/ash" 21 | # if [ "$(date +%s)" -lt 1446055000 ] && [ -f "$TIMESTAMP_FILE" ]; then 22 | # date -s "@$(date -r $TIMESTAMP_FILE +%s)" > /dev/null 23 | # #hwclock -w 24 | # fi 25 | 26 | if [ ! -f /local/etc/passwd ]; then 27 | cp /etc/passwd /local/etc/passwd 28 | fi 29 | 30 | # Configure network 31 | /etc/rc.d/network.sh start 32 | # Start NTP 33 | /etc/rc.d/ntpd.sh start 34 | # Start Telnet server 35 | /etc/rc.d/telnetd.sh start 36 | # Start SSH server 37 | /etc/rc.d/sshd.sh start 38 | 39 | openssl rehash /etc/ssl/certs 40 | 41 | # Custom (per-project, per-customer initialization) 42 | if [ -f /etc/rc.local ]; then 43 | /etc/rc.local 44 | fi 45 | -------------------------------------------------------------------------------- /scripts/aarch64a53-zynqmp-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for running Phoenix-RTOS on aarch64a53-zynqmp-qemu 4 | # 5 | # ZynqMP platform requires the forked Qemu version 6 | # This script was tested with https://github.com/Xilinx/qemu tag xilinx_v2024.2 7 | # 8 | # Copyright 2024 Phoenix Systems 9 | # Author: Jacek Maksymowicz 10 | # 11 | 12 | IMG_PLO_ZYNQMP="$(dirname "${BASH_SOURCE[0]}")/../_boot/aarch64a53-zynqmp-qemu/plo.elf" 13 | IMG_FLASH_QEMU="$(dirname "${BASH_SOURCE[0]}")/../_boot/aarch64a53-zynqmp-qemu/flash0.disk" 14 | DTB_ZYNQMP="$(dirname "${BASH_SOURCE[0]}")/../scripts/zynqmp-zcu104.dtb" 15 | 16 | for FILE in "$IMG_PLO_ZYNQMP" "$IMG_FLASH_QEMU" "$DTB_ZYNQMP"; do 17 | if [ ! -f "$FILE" ]; then 18 | echo "Missing required file: $FILE" 19 | exit 1 20 | fi 21 | done 22 | 23 | exec qemu-system-aarch64 \ 24 | -M arm-generic-fdt \ 25 | -serial null \ 26 | -serial mon:stdio \ 27 | -hw-dtb "$DTB_ZYNQMP" \ 28 | -kernel "$IMG_PLO_ZYNQMP" \ 29 | -drive file="$IMG_FLASH_QEMU",if=mtd,format=raw,index=0 \ 30 | -device loader,addr=0xfd1a0104,data=0x80000e0e,data-len=4 \ 31 | -m 2G \ 32 | -display none \ 33 | -accel tcg,thread=single,tb-size=1024 34 | -------------------------------------------------------------------------------- /.github/workflows/ci-release.yml: -------------------------------------------------------------------------------- 1 | # vim:sw=2:ts=2 2 | name: ci-release 3 | # every commit/PR on release branch should pass FULL CI check 4 | 5 | on: 6 | push: 7 | branches: 8 | - 'release/*' 9 | pull_request: 10 | branches: 11 | - 'release/*' 12 | 13 | jobs: 14 | # extract release tag to be used as docker image tag 15 | get-image-tag: 16 | runs-on: ubuntu-latest 17 | outputs: 18 | tag: ${{ steps.set_tag.outputs.image_tag }} 19 | 20 | steps: 21 | - name: Set image tag based on branch 22 | shell: bash 23 | id: set_tag 24 | run: | 25 | if [[ "${GITHUB_BASE_REF:-$GITHUB_REF_NAME}" =~ ^release/([0-9]+\.[0-9]+)$ ]]; then 26 | IMAGE_TAG="v${BASH_REMATCH[1]}" 27 | echo "IMAGE_TAG: $IMAGE_TAG" 28 | echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT 29 | else 30 | echo "image_tag=latest" >> $GITHUB_OUTPUT 31 | fi 32 | 33 | call-ci: 34 | needs: get-image-tag 35 | uses: ./.github/workflows/ci-project.yml 36 | with: 37 | image-tag: ${{ needs.get-image-tag.outputs.tag }} 38 | build_params: all tests 39 | nightly: true 40 | secrets: inherit 41 | -------------------------------------------------------------------------------- /_targets/armv8m55/stm32n6/preinit.plo.yaml: -------------------------------------------------------------------------------- 1 | size: 0x200 2 | is_relative: False 3 | 4 | contents: 5 | # NOTE: All data/code maps need to be cacheable to allow unaligned accesses 6 | # env.BOOT_DEVICE should correspond to one of the map names 7 | - map itcm 0x10000000 0x10020000 rxcb # ITCM 8 | - map dtcm 0x30000000 0x30020000 rwcb # DTCM 9 | - map axi_kernel 0x34014000 0x34100000 cb # Kernel data 10 | # Note: PLO is loaded by BootROM at 0x34180000, inside axi_app 11 | - map axi_app 0x34100000 0x343c0000 rwxcb # Applications code/data 12 | - map dmamem 0x38000000 0x38008000 rwb # Uncached DMA memory 13 | - map per 0x50000000 0x60000000 rw # Shared peripherals 14 | - map flash0 0x70000000 0x74000000 rwxcb # External Flash 15 | - map cpu_per 0xe0000000 0xe0100000 rw # CPU internal peripherals 16 | - phfs flash0 2.0 17 | - phfs ramdisk 4.0 18 | - console 0.0 19 | 20 | - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' 21 | action: call 22 | set_base: True 23 | device: '{{ env.BOOT_DEVICE }}' 24 | filename: user.plo 25 | offset: '{{ nvm[env.BOOT_DEVICE].user.offs }}' 26 | target_magic: '{{ env.MAGIC_USER_SCRIPT }}' 27 | -------------------------------------------------------------------------------- /_projects/armv8m55-stm32n6-nucleo/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for armv8m55-stm32n6-nucleo 5 | * 6 | * Copyright 2024, 2025 Phoenix Systems 7 | * Author: Aleksander Kaminski, Jacek Maksymowicz 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | 18 | #define UART_IO_PORT gpioe 19 | #define UART_IO_AF 7 20 | #define UART_PIN_TX 5 21 | #define UART_PIN_RX 6 22 | 23 | #define XSPI2 1 24 | #define XSPI2_CLOCK_DIV 1 /* 200 MHz */ 25 | 26 | #define VDDIO3_RANGE_MV 1800 /* XSPI port 2 - Flash */ 27 | 28 | #define I2C1 1 29 | 30 | #define SPI5 1 31 | 32 | #define TTY1 1 33 | #define UART_CONSOLE_PLO 1 34 | #define UART_CONSOLE_KERNEL 1 35 | #define UART_CONSOLE_USER 1 36 | 37 | /* 38 | * libpseudodev and libposixsrv shall be used exclusively, libpseudodev uses 39 | * less resources, but libposixsrv provides POSIX support and may be resource 40 | * hungry, by default libposixsrv is enabled. 41 | */ 42 | 43 | /* #define PSEUDODEV 1 */ 44 | #define BUILTIN_POSIXSRV 1 45 | #define BUILTIN_DUMMYFS 1 46 | 47 | /* plo params */ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /docker-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOCKER_IMG_NAME=phoenixrtos/build 4 | if [ -e .docker_build_img ]; then 5 | DOCKER_IMG_NAME="$(cat .docker_build_img)" 6 | fi 7 | PATH_TO_PROJECT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/" 8 | DOCKER_USER="$(id -u):$(id -g)" 9 | 10 | TMPFS_OVERLAY=() 11 | if [ "$(uname)" = "Darwin" ]; then 12 | # I/O operations on bind mounts in Darwin are painfully slow - use tmpfs for intermediate build artifacts 13 | chmod 777 "_build" # fix against invalid tmpfs permissions 14 | TMPFS_OVERLAY=("--tmpfs" "/src/_build:exec,size=2g") 15 | fi 16 | 17 | if [ "$#" -eq 1 ] && [ "$1" = "bash" ]; then 18 | # run interactive shell - using ROOT user 19 | exec docker run -it --rm -h "$(hostname)-docker" --env-file .docker_env -v "${PATH_TO_PROJECT}:/src" -w /src --entrypoint bash "$DOCKER_IMG_NAME" 20 | elif [ "$#" -eq 1 ] && [ "$1" = "pull" ]; then 21 | # explicitly pull (update local image) 22 | exec docker pull "$DOCKER_IMG_NAME" 23 | else 24 | # run build - use our own UID/GID to create files with correct owner 25 | exec docker run -it --rm -h "$(hostname)-docker" --env-file .docker_env --user "$DOCKER_USER" -v "${PATH_TO_PROJECT}:/src:delegated" -w /src "${TMPFS_OVERLAY[@]}" "$DOCKER_IMG_NAME" "$@" 26 | fi 27 | 28 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mini/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-gr716-mini project 4 | # 5 | # Copyright 2022 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | export PLO_DEVICES="gpio-gr716 uart-grlib flash-gr716" 12 | 13 | prepare_plo_img() { 14 | #FIXME: img file already produced by the plo make, change the output filename 15 | FLASH_SIZE=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0._meta.size }}') 16 | gr716-convert.py "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" -o "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" 17 | gr716-bch.py -s "$FLASH_SIZE" "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo.bch" 18 | } 19 | 20 | 21 | b_image_project () { 22 | prepare_plo_img; 23 | 24 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" 25 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 26 | 27 | b_log "The images have been built for the ${TARGET} platform" 28 | } 29 | -------------------------------------------------------------------------------- /_projects/armv7a7-imx6ull-evk/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7a7-imx6ull-evk project 4 | # 5 | # Copyright 2022-2023 Phoenix Systems 6 | # Author: Lukasz Kosinski, Hubert Badocha 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | : "${WATCHDOG:=0}" 12 | export WATCHDOG 13 | 14 | # 15 | # lwIP configuration 16 | # 17 | export LWIPOPTS_DIR="$(pwd)/_projects/armv7a7-imx6ull-evk/lwip" 18 | export LWIP_IPSEC_BUILD=no 19 | export LWIP_WIFI_BUILD=no 20 | 21 | # 22 | # Boot configuration 23 | # 24 | export KERNEL_PLO_BOOT=y 25 | export PLO_NOR_BOOT=y 26 | 27 | # 28 | # PLO configuration 29 | # 30 | export PLO_DEVICES="flash-imx6ull uart-imx6ull usbc-cdc" 31 | 32 | # 33 | # Ports configuration - additional to the one from _targets 34 | # 35 | if [ "$LONG_TEST" = "y" ]; then 36 | export PORTS_COREMARK_PRO=y 37 | fi 38 | 39 | # 40 | # Project specific build 41 | # 42 | export BOOT_DEVICE="nor0" # Default boot device 43 | ERASE_SIZE=$((16 * 4096)) # Rootfs disk erase block size (in bytes) 44 | CLEANMARKER_SIZE=$((0x10)) # JFFS2 cleanmarker size (in bytes) 45 | 46 | 47 | b_image_project () { 48 | b_log "The images have been built for the ${TARGET} platform" 49 | } 50 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/etc/ssl/certs/Baltimore_CyberTrust_Root.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ 3 | RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD 4 | VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX 5 | DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y 6 | ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy 7 | VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr 8 | mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr 9 | IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK 10 | mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu 11 | XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy 12 | dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye 13 | jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 14 | BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 15 | DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 16 | 9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx 17 | jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 18 | Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz 19 | ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS 20 | R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/etc/ssl/certs/DigiCert_Global_Root_G2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH 5 | MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT 6 | MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j 7 | b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG 8 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI 9 | 2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx 10 | 1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ 11 | q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz 12 | tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ 13 | vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP 14 | BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV 15 | 5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY 16 | 1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 17 | NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG 18 | Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 19 | 8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe 20 | pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl 21 | MrY= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/logo: -------------------------------------------------------------------------------- 1 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 2 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 3 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 4 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 5 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 6 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 7 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 8 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 9 | :{}::{}::{}::{}::{}: Welcome to Phoenix-RTOS :{}::{}::{}::{}::{}: 10 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 11 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 12 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 13 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 14 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 15 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 16 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 17 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 18 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 19 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 20 | :{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}::{}: 21 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mimas/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-gr716-mimas project 4 | # 5 | # Copyright 2023 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | 9 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 10 | 11 | # no NVM storage, all programs are being loaded via UART 12 | export BOOT_DEVICE="uart0" 13 | 14 | export PLO_DEVICES="gpio-gr716 uart-grlib" 15 | 16 | prepare_plo_img() { 17 | #TODO: consider using nvm.yaml for merging header with plo 18 | local f 19 | f="${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" 20 | 21 | local sz 22 | sz=$(stat -c%s "$f") 23 | #TODO: why "- 4" ? 24 | sz=$(((sz - 4)/4)) 25 | 26 | { 27 | printf "\xde\xad\xbe\xef" 28 | printf "%08X" $sz | xxd -r -p 29 | printf "\x40\x10\x00\x00" 30 | cat "$f" 31 | } > "$PREFIX_BOOT/plo.img" 32 | } 33 | 34 | 35 | b_image_project () { 36 | prepare_plo_img; 37 | 38 | # no NVM storage, all programs are being loaded via UART - prepare user.plo and all binaries in "PREFIX_BOOT" 39 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_USER" --out "${PREFIX_BOOT}/user.plo" 40 | 41 | cp -a "${PREFIX_PROG_STRIPPED}phoenix-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" 42 | cp -a "${PREFIX_PROG_STRIPPED}dummyfs" "$PREFIX_BOOT/" 43 | cp -a "${PREFIX_PROG_STRIPPED}grlib-multi" "$PREFIX_BOOT/" 44 | cp -a "${PREFIX_PROG_STRIPPED}psh" "$PREFIX_BOOT/" 45 | 46 | b_log "The images have been built for the ${TARGET} platform" 47 | } 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Phoenix-RTOS 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /.github/problem-matchers/sanitizer-errors.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "sanitizer-runtime-errors", 5 | "pattern": [ 6 | { 7 | "regexp": "^(.*):(\\d+):(\\d+):\\s+runtime (error):\\s+(.*)$", 8 | "file": 1, 9 | "line": 2, 10 | "column": 3, 11 | "severity": 4, 12 | "message": 5 13 | } 14 | ] 15 | }, 16 | { 17 | "owner": "sanitizer-runtime-errors-ansi-colored", 18 | "pattern": [ 19 | { 20 | "__comment": "GH doesn't strip ANSI colors correctly (actions/runner#2341), strip them manually", 21 | "regexp": "^(?:\\x1b\\[[\\d;]+m)*(.*):(\\d+):(\\d+):(?:\\x1b\\[[\\d;]+m)*\\s+runtime (error):\\s+(?:\\x1b\\[[\\d;]+m)*(.*)(?:\\x1b\\[[\\d;]+m)*$", 22 | "file": 1, 23 | "line": 2, 24 | "column": 3, 25 | "severity": 4, 26 | "message": 5 27 | } 28 | ] 29 | }, 30 | { 31 | "owner": "sanitizer-errors", 32 | "pattern": [ 33 | { 34 | "__comment": "GH doesn't strip ANSI colors correctly (actions/runner#2341), strip them manually", 35 | "regexp": "^(?:\\x1b\\[[\\d;]+m)*=+\\d+=+([^:]*): (.*)$", 36 | "severity": 1, 37 | "message": 2 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "phoenix-rtos-kernel"] 2 | path = phoenix-rtos-kernel 3 | url = https://github.com/phoenix-rtos/phoenix-rtos-kernel.git 4 | [submodule "libphoenix"] 5 | path = libphoenix 6 | url = https://github.com/phoenix-rtos/libphoenix 7 | [submodule "phoenix-rtos-build"] 8 | path = phoenix-rtos-build 9 | url = https://github.com/phoenix-rtos/phoenix-rtos-build 10 | [submodule "phoenix-rtos-ports"] 11 | path = phoenix-rtos-ports 12 | url = https://github.com/phoenix-rtos/phoenix-rtos-ports 13 | [submodule "phoenix-rtos-devices"] 14 | path = phoenix-rtos-devices 15 | url = https://github.com/phoenix-rtos/phoenix-rtos-devices 16 | [submodule "phoenix-rtos-filesystems"] 17 | path = phoenix-rtos-filesystems 18 | url = https://github.com/phoenix-rtos/phoenix-rtos-filesystems 19 | [submodule "phoenix-rtos-usb"] 20 | path = phoenix-rtos-usb 21 | url = https://github.com/phoenix-rtos/phoenix-rtos-usb 22 | [submodule "phoenix-rtos-lwip"] 23 | path = phoenix-rtos-lwip 24 | url = https://github.com/phoenix-rtos/phoenix-rtos-lwip 25 | [submodule "phoenix-rtos-posixsrv"] 26 | path = phoenix-rtos-posixsrv 27 | url = https://github.com/phoenix-rtos/phoenix-rtos-posixsrv 28 | [submodule "phoenix-rtos-tests"] 29 | path = phoenix-rtos-tests 30 | url = https://github.com/phoenix-rtos/phoenix-rtos-tests 31 | [submodule "phoenix-rtos-corelibs"] 32 | path = phoenix-rtos-corelibs 33 | url = https://github.com/phoenix-rtos/phoenix-rtos-corelibs/ 34 | [submodule "phoenix-rtos-hostutils"] 35 | path = phoenix-rtos-hostutils 36 | url = https://github.com/phoenix-rtos/phoenix-rtos-hostutils/ 37 | [submodule "phoenix-rtos-utils"] 38 | path = phoenix-rtos-utils 39 | url = https://github.com/phoenix-rtos/phoenix-rtos-utils/ 40 | [submodule "plo"] 41 | path = plo 42 | url = https://github.com/phoenix-rtos/plo.git 43 | [submodule "phoenix-rtos-doc"] 44 | path = phoenix-rtos-doc 45 | url = https://github.com/phoenix-rtos/phoenix-rtos-doc 46 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | ## Motivation and Context 7 | 8 | 9 | 10 | ## Types of changes 11 | 12 | - [ ] Bug fix (non-breaking change which fixes an issue) 13 | - [ ] New feature (non-breaking change which adds functionality) 14 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 15 | - [ ] Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes) 16 | 17 | 18 | 19 | ## How Has This Been Tested? 20 | 21 | 22 | - [ ] Already covered by automatic testing. 23 | - [ ] New test added: (add PR link here). 24 | - [ ] Tested by hand on: (list targets here). 25 | 26 | ## Checklist: 27 | 28 | 29 | - [ ] My change requires a change to the documentation. 30 | - [ ] I have updated the documentation accordingly. 31 | - [ ] I have added tests to cover my changes. 32 | - [ ] All new and existing linter checks and tests passed. 33 | - [ ] My changes generate no new compilation warnings for any of the targets. 34 | 35 | ## Special treatment 36 | 37 | - [ ] This PR needs additional PRs to work (list the PRs, preferably in merge-order). 38 | - [ ] I will merge this PR by myself when appropriate. 39 | -------------------------------------------------------------------------------- /_projects/riscv64-grfpga-artya7/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for riscv64-grfpga-artya7 5 | * 6 | * Copyright 2024 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* GRLIB UART configuration */ 18 | #define UART_BAUDRATE 115200 19 | 20 | #define UART0_BASE ((void *)0xfc001000U) 21 | #define UART1_BASE ((void *)0xfc0d0000U) 22 | #define UART2_BASE ((void *)-1) 23 | #define UART3_BASE ((void *)-1) 24 | #define UART4_BASE ((void *)-1) 25 | #define UART5_BASE ((void *)-1) 26 | 27 | #define UART0_IRQ 1 28 | #define UART1_IRQ 9 29 | #define UART2_IRQ -1 30 | #define UART3_IRQ -1 31 | #define UART4_IRQ -1 32 | #define UART5_IRQ -1 33 | 34 | #define UART0_TX -1 35 | #define UART0_RX -1 36 | 37 | #define UART1_TX -1 38 | #define UART1_RX -1 39 | 40 | #define UART2_TX -1 41 | #define UART2_RX -1 42 | 43 | #define UART3_TX -1 44 | #define UART3_RX -1 45 | 46 | #define UART4_TX -1 47 | #define UART4_RX -1 48 | 49 | #define UART5_TX -1 50 | #define UART5_RX -1 51 | 52 | #define UART0_ACTIVE 1 53 | #define UART1_ACTIVE 1 54 | #define UART2_ACTIVE 0 55 | #define UART3_ACTIVE 0 56 | #define UART4_ACTIVE 0 57 | #define UART5_ACTIVE 0 58 | 59 | #define UART_CONSOLE_PLO 0 60 | #define UART_CONSOLE_KERNEL 0 61 | #define UART_CONSOLE_USER 0 62 | #define SPIKETTY_CONSOLE_USER 0 63 | 64 | #define UART_MAX_CNT 2 65 | 66 | #define TIMER_FREQ (20 * 1000 * 1000) 67 | 68 | #define PLIC_BASE 0xf8000000UL 69 | #define PLIC_IRQ_SIZE 32 70 | 71 | #define SYSCLK_FREQ (40 * 1000 * 1000) 72 | 73 | #define SBI_AREA_START 0x0UL 74 | #define SBI_AREA_END 0x10000UL 75 | 76 | #define DCACHE_BLOCK_SIZE 0x1000U 77 | 78 | 79 | /* Flash */ 80 | 81 | #define FLASH_CNT 1 82 | 83 | #define SPIMCTRL0_BASE ((void *)0xffff0000U) 84 | #define FLASH0_ADDR 0x90000000U 85 | 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.d/ntpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /etc/rc.subr 4 | 5 | NTPD_DEF_CONF="/etc/rc.conf.d/ntpd" 6 | NTPD_CONF="/local/etc/rc.conf.d/ntpd" 7 | 8 | NTP_DEF_CONF="/etc/rc.conf.d/ntp" 9 | NTP_CONF="/local/etc/rc.conf.d/ntp" 10 | 11 | NTPD=/usr/sbin/ntpd 12 | SYNCFILE="/var/run/ntpsync" 13 | 14 | PIDFILE=/var/run/ntpd.pid 15 | 16 | SLEEPTIME=660 17 | MAX_UNSYNC_TIME=$((24*60)) # in minutes 18 | 19 | 20 | start() { 21 | if [ ! -f $NTPD_CONF ]; then 22 | rc_log "$NTPD_CONF not found! Switching to default configuration." 23 | cp $NTPD_DEF_CONF $NTPD_CONF 24 | fi 25 | . $NTPD_CONF 26 | 27 | if [ ! -f $NTP_CONF ]; then 28 | rc_log "$NTP_CONF not found! Switching to default configuration." 29 | cp $NTP_DEF_CONF $NTP_CONF 30 | fi 31 | . $NTP_CONF 32 | 33 | PARAMS="" 34 | if [ ! -z "$PEERS" ]; then 35 | for server in $PEERS; do 36 | PARAMS="$PARAMS -p $server" 37 | done 38 | else 39 | rc_msg "NTP peer list is empty. Exiting..." 40 | exit 1 41 | fi 42 | 43 | if [ "$ENABLED" = "1" ]; then 44 | rc_msg "Starting NTP (peers $PEERS)" 45 | 46 | ( 47 | while :; do 48 | if $NTPD $PARAMS -n -q 2>&1; then 49 | touch $SYNCFILE 50 | 51 | else 52 | find "$SYNCFILE" -type f -mmin +$MAX_UNSYNC_TIME -exec rm "{}" \; >/dev/null 2>&1 53 | fi 54 | 55 | sleep $SLEEPTIME 56 | 57 | # pipe output to syslog 58 | done | logger -p daemon.info -t ntpd 59 | 60 | ) & echo $! > $PIDFILE 61 | 62 | else 63 | rc_msg "NTP disabled. Exiting..." 64 | exit 1 65 | fi 66 | } 67 | 68 | 69 | stop() { 70 | if [ -f $PIDFILE ]; then 71 | PID=$(cat $PIDFILE) 72 | rm $PIDFILE > /dev/null 73 | kill $PID 74 | rm -f $SYNCFILE 75 | else 76 | rc_msg "ntpd is not running" " " err 77 | fi 78 | } 79 | 80 | 81 | case "$1" in 82 | start) 83 | start 84 | ;; 85 | stop) 86 | stop 87 | ;; 88 | restart) 89 | stop 90 | start 91 | ;; 92 | *) 93 | rc_msg "Unknown command, only start/stop/restart are supported" " " err 94 | ;; 95 | esac 96 | 97 | exit $? 98 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc: -------------------------------------------------------------------------------- 1 | #!/bin/busybox sh 2 | 3 | . /etc/rc.subr 4 | 5 | export PATH=/bin:/usr/bin 6 | 7 | RED="\033[31m" 8 | GREEN="\033[32m" 9 | YELLOW="\033[33m" 10 | RESET="\033[0m" 11 | 12 | # Mount RAM disks 13 | mkdir -p /var/log /var/run /var/cfg /var/cfg-req /var/tmp /var/login /var/users-req 14 | 15 | # Create directories if local is empty 16 | if [ ! -d /local/etc ]; then 17 | mkdir /local/etc 18 | fi 19 | if [ ! -d /local/etc/rc.conf.d ]; then 20 | mkdir /local/etc/rc.conf.d 21 | fi 22 | 23 | # RTC has failed, set last "build" date 24 | # sleep 1 25 | # TIMESTAMP_FILE="/bin/ash" 26 | # if [ "$(date +%s)" -lt 1446055000 ] && [ -f "$TIMESTAMP_FILE" ]; then 27 | # date -s "@$(date -r $TIMESTAMP_FILE +%s)" > /dev/null 28 | # #hwclock -w 29 | # fi 30 | 31 | if [ ! -f /local/etc/passwd ]; then 32 | cp /etc/passwd /local/etc/passwd 33 | fi 34 | 35 | # Configure network 36 | /etc/rc.d/network.sh start 37 | # Start NTP 38 | /etc/rc.d/ntpd.sh start 39 | # Start Telnet server 40 | /etc/rc.d/telnetd.sh start 41 | # Start SSH server 42 | /etc/rc.d/sshd.sh start 43 | 44 | # Custom (per-project, per-customer initialization) 45 | if [ -f /etc/rc.local ]; then 46 | /etc/rc.local 47 | fi 48 | 49 | run_scripts () { 50 | for file in /etc/rc.d/* ; do 51 | feedback_message="SUCCESS" ; color=$GREEN 52 | exec_time="0.00" 53 | printf "%-63s [ $YELLOW%8s$RESET ]\n" "$(basename "$file")" "starting" 54 | 55 | # we test if the script has execution right 56 | if [ ! -x "$file" ]; then 57 | feedback_message="not exec" ; color=$RED 58 | else 59 | # run the script 60 | start=$(date +%s.%N) 61 | if ! "$file"; then 62 | feedback_message="FAIL" ; color=$RED 63 | fi 64 | end=$(date +%s.%N) 65 | exec_time=$(echo "$start" "$end" | awk '{print $2-$1}') 66 | fi 67 | 68 | printf "%-63s [ $color%8s$RESET ] ( %6.3fs )\n" "$(basename "$file")" "$feedback_message" "$exec_time" 69 | done 70 | } 71 | 72 | run_scripts; 73 | -------------------------------------------------------------------------------- /_targets/sparcv8leon/generic/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building sparcv8leon-generic project 4 | # 5 | # Copyright 2023, 2024 Phoenix Systems 6 | # Author: Lukasz Leczkowski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=sparc-phoenix- 13 | 14 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 15 | 16 | # 17 | # Ports configuration 18 | # 19 | export PORTS_BUSYBOX=n 20 | export PORTS_PCRE=n 21 | export PORTS_OPENSSL=n 22 | export PORTS_LIGHTTPD=n 23 | export PORTS_DROPBEAR=n 24 | export PORTS_LUA=n 25 | export PORTS_LZO=n 26 | export PORTS_OPENVPN=n 27 | export PORTS_JANSSON=n 28 | export PORTS_CURL=n 29 | export PORTS_COREMARK=n 30 | export PORTS_COREMARK_PRO=n 31 | 32 | # 33 | # Platform dependent parameters 34 | # 35 | export SIZE_PAGE=$((0x1000)) 36 | 37 | # 38 | # Project specific build 39 | # 40 | export BOOT_DEVICE="ram0" 41 | export MAGIC_USER_SCRIPT=dabaabad 42 | 43 | 44 | b_build_project() { 45 | b_log "Building user applications" 46 | make -C "_user" all install 47 | } 48 | 49 | 50 | b_build_target() { 51 | b_log "Building $TARGET project" 52 | b_log "Building phoenix-rtos-loader" 53 | 54 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 55 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 56 | make -C plo base 57 | 58 | cp -a "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "${PREFIX_BOOT}/plo.elf" 59 | } 60 | 61 | 62 | b_image_target() { 63 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" 64 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 65 | } 66 | 67 | 68 | b_test_target() { 69 | b_log "Build and install tests in the phoenix-rtos filesystem" 70 | make -C "phoenix-rtos-tests" all install 71 | } 72 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/slowcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * slowcat.c - slow down the display of a file 3 | * copyright (c) 2001,2002,2007 dave w capella All Rights Reserved 4 | * 5 | * distributed under the terms of the GNU Public license 6 | * 7 | * There is NO WARRANTY, and NO SUPPORT WHATSOEVER. 8 | * 9 | * building: make slowcat && mv slowcat $HOME/bin 10 | * (assuming that you have a personal bin directory) 11 | * 12 | * usage: slowcat [-d usecs] filename 13 | * where usecs is the number of micro-seconds to delay. 14 | * 15 | * feedback welcome. enjoy! 16 | * ...dave 17 | * 18 | * 19 | * 09/24/07 - modifications to include nanosleep, brian at landsberger.com 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | int debug = 0; 27 | 28 | int main(int argc, char **argv) { 29 | int c; 30 | unsigned long usecs,s; 31 | FILE *fp; 32 | char *fnam; 33 | struct timespec ts; 34 | 35 | if(argc != 2 && argc != 4) { 36 | fprintf(stderr,"usage: %s [-d usecs] filename\n",argv[0]); 37 | exit(1); 38 | } 39 | 40 | if(argc == 4 ) { 41 | if( !strncmp(argv[1],"-d",2) ) { 42 | usecs = strtoul(argv[2],NULL,10); 43 | if(usecs<=0 || usecs>500000L) { 44 | usecs = 1; 45 | } 46 | } 47 | if(debug) { 48 | fprintf(stderr,"usecs: %lu\nAny key to continue.\n",usecs); 49 | c = getchar(); 50 | } 51 | fnam = argv[3]; 52 | } 53 | /* set timespec */ 54 | ts.tv_sec=0; 55 | ts.tv_nsec=usecs; 56 | 57 | if(argc == 2 ) { 58 | fnam = argv[1]; 59 | } 60 | fp = fopen(fnam,"r"); 61 | if(fp == NULL) { 62 | fprintf(stderr,"usage: %s [-d usecs] filename\n",argv[0]); 63 | exit(2); 64 | } 65 | 66 | while( (c = fgetc(fp)) != EOF) { 67 | putchar(c); 68 | #ifdef _POSIX_C_SOURCE // assuming >= 199309L 69 | if (debug) { 70 | fprintf(stderr,"sleeping using nanosleep\n"); 71 | } 72 | nanosleep(&ts,NULL); 73 | #else 74 | if (debug) { 75 | fprintf(stderr,"sleeping using for\n"); 76 | } 77 | for(s=0;s 2 | 3 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | '\ 17 | _\______ 18 | / \======== FORD TOYOTA G.M. 19 | ____|__________\_____ 20 | / ___Dodge Ram 50____ \ 21 | \/ _===============_ \/ 22 | "-===============-" 23 | 24 | 25 | 26 | 27 | #3 RAM 50 BLOWS THEM ALL AWAY! 28 | #4 RAM 50 BLOWS THEM ALL AWAY! 29 | 30 | 31 | 32 | 33 | 34 | \ | / 35 | BOOOM 36 | / | \ 37 | 38 | 39 | 40 |  |>> 41 |  |>> 42 |  |>> 43 |  |>> 44 |  |>> 45 |  |>> 46 |  |>> 47 |  |>> 48 |  |>> 49 |  |>> 50 |  |>> 51 |  |>> 52 |  |>> 53 |  |>> 54 |  |>> 55 |  |>> 56 |  |>> 57 |  |>> 58 |  |>> 59 |  |>> 60 |  |>> 61 |  |>> 62 |  |>> 63 |  |>> 64 |  |>> 65 |  |>> 66 |  |>> 67 |  |>> 68 |  |>> 69 |  |>> 70 |  |>> 71 |  |>> 72 |  |>> 73 |  |>> 74 |  |>> 75 |  |>> 76 |  |>> 77 |  |>> 78 |  |>> 79 |  |>> 80 |  |>> 81 |  |>> 82 |  |>> 83 |  |>> 84 |  |>> 85 |  |>> 86 |  |>> 87 |  |>> 88 |  |>> 89 |  |>> 90 |  |>> 91 |  |>> 92 |  |>> 93 |  |>> 94 |  |>> 95 |  96 | 97 | 98 | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 99 |  ...oooooooooooo.... 100 |  ######## 101 |  ######## 102 |  ######## 103 |  ######## 104 |  \@@@@@@@@@@@@@@@@@@@@@@/ 105 |  (@@@@@@@@@@@@@@@@@@@@@@@@@@) 106 |  /@@@@@@@@@@@@@@@@@@@@@@@@\ 107 |  /@@@@@@@@@@@@@@@@@@@@\ 108 | 109 |  <> 110 |  111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phoenix-rtos-project 2 | 3 | [![ci](https://github.com/phoenix-rtos/phoenix-rtos-project/actions/workflows/ci.yml/badge.svg)](https://github.com/phoenix-rtos/phoenix-rtos-project/actions/workflows/ci.yml) 4 | [![nightly](https://github.com/phoenix-rtos/phoenix-rtos-project/actions/workflows/nightly.yml/badge.svg)](https://github.com/phoenix-rtos/phoenix-rtos-project/actions/workflows/nightly.yml) 5 | 6 | Phoenix-RTOS is a scalable real-time operating system for IoT. It is based on its own microkernel and can be used either on small devices based on microcontrollers and on advanced computer systems based on multiple processors and equipped with gigabytes of RAM. 7 | 8 | The POSIX application environment can be emulated to enable the execution of regular UN*X applications. The ARINC653 execution environment (APEX), advanced partitioning and DO-178C certification package for aerospace applications are under development. 9 | 10 | Phoenix-RTOS supports multiple architectures, including ARM Cortex-M, ARM Cortex-A, Intel x86, RISC-V and some popular microcontrollers and reference boards. The system is still under development but it was implemented in numerous Smart Utility appliances e.g. in smart gas meters, smart energy meters and data concentrators (DCU). 11 | 12 | This repository contains sample Phoenix-RTOS project. It aggregates all system components - kernel, standard library, device drivers, filesystems, loader, building tools. After building for target platform the final image is created and can be run on hardware or on emulators. The project was built and tested on minimal clean installation of Ubuntu 22.04.2 LTS for desktops. 13 | 14 | ## Building 15 | 16 | The building process was described in [docs.phoenix-rtos.com/building](https://docs.phoenix-rtos.com/latest/building/index.html). 17 | 18 | ## Running 19 | 20 | To launch the created image on target architecture please see [docs.phoenix-rtos.com/quickstart](https://docs.phoenix-rtos.com/latest/quickstart/index.html). 21 | 22 | ## Documentation 23 | 24 | Phoenix-RTOS philosophy, architecture and internals are described in [docs.phoenix-rtos.com](https://docs.phoenix-rtos.com). 25 | 26 | ## Product website 27 | 28 | Phoenix-RTOS website: [phoenix-rtos.com](https://phoenix-rtos.com). 29 | -------------------------------------------------------------------------------- /.github/actions/phoenix-runner/action.yml: -------------------------------------------------------------------------------- 1 | # vim:sw=2:ts=2 2 | # action name 3 | name: 'phoenix-runner' 4 | 5 | # action description 6 | description: 'Runs Phoenix-RTOS tests' 7 | 8 | inputs: 9 | image-tag: 10 | description: 'Docker image tag version' 11 | default: 'latest' 12 | required: false 13 | target: 14 | description: 'Specifies target to run tests' 15 | default: 'ia32-generic-qemu' 16 | required: false 17 | 18 | nightly: 19 | description: 'Run nightly mode' 20 | default: 'false' 21 | required: false 22 | 23 | # we're using a composite action as `docker` action type doesn't allow non-static image specification 24 | runs: 25 | using: 'composite' 26 | steps: 27 | - name: Run phoenix-build container 28 | shell: bash 29 | run: | 30 | IMAGE="ghcr.io/phoenix-rtos/devel:${{ inputs.image-tag }}" 31 | echo "Using Docker image: $IMAGE" 32 | 33 | # Collect all GITHUB_* env vars and format as -e KEY - omit value to avoid secret leakage 34 | GH_ENV_ARGS=$(env | grep ^GITHUB_ | cut -d= -f1 | sed 's/^/-e /') 35 | 36 | # Build the nightly flag logic 37 | NIGHTLY_ARG="" 38 | if [ "${{ inputs.nightly }}" = "true" ]; then 39 | NIGHTLY_ARG="--nightly" 40 | fi 41 | 42 | # runner args: 43 | # -v # output SKIP subresults at a top level 44 | # -Oresults.csv # creates also junit xml 45 | # when running docker manually - we need to reflect the host paths (no Path translation is done in the runner) 46 | docker run --rm --privileged \ 47 | -v "${{ github.workspace }}:${{ github.workspace }}" \ 48 | -w "${{ github.workspace }}" \ 49 | -v "${HOME}:${HOME}" \ 50 | -v "${RUNNER_TEMP}:${RUNNER_TEMP}" \ 51 | -v "${GITHUB_ENV}:${GITHUB_ENV}" \ 52 | -v "${GITHUB_OUTPUT}:${GITHUB_OUTPUT}" \ 53 | -e CI=true \ 54 | -e HOME \ 55 | -e RUNNER_TEMP \ 56 | -e TARGET="${{ inputs.target }}" \ 57 | $GH_ENV_ARGS \ 58 | --entrypoint="./phoenix-rtos-tests/runner.py" \ 59 | "$IMAGE" \ 60 | -v \ 61 | -T${{ inputs.target }} \ 62 | $NIGHTLY_ARG \ 63 | -Oresults.csv 64 | 65 | # branding 66 | branding: 67 | icon: terminal 68 | color: green 69 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/sun.vt: -------------------------------------------------------------------------------- 1 | < 2 | (0 3 |  4 | aaaaaaaaaaa 5 | aaaaaaaaaaaaaaaaa 6 | aaaaaaaaaaaaaaaaaaaaa 7 | aaaaaaaaaaaaaaaaaaaaaaa 8 | aaaaaaaaaaaaaaaaaaaaaaaaa 9 | aaaaaaaaaaaaaaaaaaaaaaaaaaa 10 | aaaaaaaaaaaaaaaaaaaaaaaaaaa 11 | aaaaaaaaaaaaaaaaaaaaaaaaaaa 12 | aaaaaaaaaaaaaaaaaaaaaaaaa 13 | aaaaaaaaaaaaaaaaaaaaaaa 14 | aaaaaaaaaaaaaaaaaaaaa 15 | aaaaaaaaaaaaaaaaa 16 | aaaaaaaaaaa 17 |  18 |  19 |  20 |  21 |  22 |  23 |  24 |  25 |  26 | aa 27 | aaaaaaaa 28 | aaaaaaaaaaaaaaa 29 | aaaaaaaaaaaaaaaaaaaaaa 30 | aaaaaaaaaaaaaaaaaaaaaaaaa 31 | aaaaaaaaaaaaaaaaaaaaaaaaaaa 32 | aaaaaaaaaaaaaaaaaaaaaaaaa 33 | aaaaaaaaaaaaaaaaaaaaaaa 34 | aaaaaaaaaaaaaaaaaaaaa 35 | aa 36 | aaaaaa 37 | aaaaaaaaaaaaaaa 38 | aaaaaaaaaaaaaaaaa 39 | aaaaaaaaaaaaaaaaaaa 40 | aaaaaaaaaaaaaaaaaaaaa 41 |  42 |  43 |  44 | aaaaaaaaaaaaaaaaaaaaaaaa 45 | aaaaaaaaaaaaaaaaaaaaaaaa 46 | aaaaaaaaaaaaaaaaaaaaaaaaa 47 | aaaaaaaaaaaaaaaaaaaaaaaaaa 48 | aaaaaaaaaaaaaaaaaaaaaa 49 | aaaaaaaaaaaaaaaaa 50 | aaaaaaaaaaaa 51 | aaaaaaa 52 | aa 53 | aaaaaaaaaaaaaaaaaaaaaaaa 54 | aaaaaaaaaaaaaaaaaaaaaaaa 55 | aaaaaaaaaaaaaaaaaaaaaaaaa 56 | aaaaaaaaaaaaaaaaaaaaaaaaaa 57 | aaaaaaaaaaaaaaaaaaaaaa 58 | aaaaaaaaaaaaaaaaa 59 | aaaaaaaaaaaa 60 | aaaaaaa 61 | aa 62 |  63 |  64 |  65 |  66 | aa 67 | aaaaaa 68 | aaaaaaaaaaaaaaa 69 | aaaaaaaaaaaaaaaaa 70 | aaaaaaaaaaaaaaaaaaa 71 | aaaaaaaaaaaaaaaaaaaaa 72 | aa 73 | aaaaaaaa 74 | aaaaaaaaaaaaaaa 75 | aaaaaaaaaaaaaaaaaaaaaa 76 | aaaaaaaaaaaaaaaaaaaaaaaaa 77 | aaaaaaaaaaaaaaaaaaaaaaaaaaa 78 | aaaaaaaaaaaaaaaaaaaaaaaaa 79 | aaaaaaaaaaaaaaaaaaaaaaa 80 | aaaaaaaaaaaaaaaaaaaaa 81 |  82 |  83 |  84 |  85 |  86 |  87 |  88 |  89 | (B 90 |  91 | -------------------------------------------------------------------------------- /.github/actions/phoenix-build/action.yml: -------------------------------------------------------------------------------- 1 | # vim:sw=2:ts=2 2 | # action name 3 | name: 'phoenix-build' 4 | 5 | # action author 6 | author: 'Marek Białowąs ' 7 | 8 | # action description 9 | description: 'Builds Phoenix-RTOS based projects' 10 | 11 | # action input values 12 | inputs: 13 | image-tag: 14 | description: 'Docker image tag version' 15 | default: 'latest' 16 | required: false 17 | target: 18 | description: 'Target env variable' 19 | default: 'ia32-generic-qemu' 20 | required: false 21 | params: 22 | description: 'All parameters to the main build script - as string' 23 | required: true 24 | buildroot: 25 | description: 'Custom phoenix-rtos-project buildroot (relative path)' 26 | default: '' 27 | required: false 28 | nightly: 29 | description: 'Build additional tests' 30 | default: 'false' 31 | required: false 32 | 33 | # we're using a composite action as `docker` action type doesn't allow non-static image specification 34 | runs: 35 | using: 'composite' 36 | steps: 37 | - name: Run phoenix-build container 38 | shell: bash 39 | run: | 40 | IMAGE="ghcr.io/phoenix-rtos/build:${{ inputs.image-tag }}" 41 | echo "Using Docker image: $IMAGE" 42 | 43 | # Collect all GITHUB_* env vars and format as -e KEY - omit value to avoid secret leakage 44 | GH_ENV_ARGS=$(env | grep ^GITHUB_ | cut -d= -f1 | sed 's/^/-e /') 45 | 46 | # when running docker manually - we need to reflect the host paths (no Path translation is done in the runner) 47 | docker run --rm --privileged \ 48 | -v "${{ github.workspace }}:${{ github.workspace }}" \ 49 | -w "${{ github.workspace }}" \ 50 | -v "${HOME}:${HOME}" \ 51 | -v "${RUNNER_TEMP}:${RUNNER_TEMP}" \ 52 | -v "${GITHUB_ENV}:${GITHUB_ENV}" \ 53 | -v "${GITHUB_OUTPUT}:${GITHUB_OUTPUT}" \ 54 | -e CI=true \ 55 | -e HOME \ 56 | -e RUNNER_TEMP \ 57 | -e CONSOLE=serial \ 58 | -e DEBUG=1 \ 59 | -e TARGET="${{ inputs.target }}" \ 60 | -e CI_CUSTOM_BUILDROOT="${{ inputs.buildroot }}" \ 61 | -e LONG_TEST="${{ inputs.nightly == 'true' && 'y' || 'n' }}" \ 62 | $GH_ENV_ARGS \ 63 | "$IMAGE" \ 64 | "${{ inputs.params }}" 65 | 66 | # branding 67 | branding: 68 | icon: terminal 69 | color: green 70 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/nifty.vt: -------------------------------------------------------------------------------- 1 | 2 |   3 |  nifty.. 4 |   5 |   nifty.. 6 |  nif 7 |   nifty.. 8 |  nifty. 9 |   nifty.. 10 |  nifty... 11 |   nifty.. 12 |  nifty... 13 |   nifty.. 14 |  nifty... 15 |   nifty.. 16 |  nifty... 17 |   nifty.. 18 |  nifty... 19 |   nifty.. 20 |  nifty... 21 |   nifty... 22 |  nifty... 23 |   nifty... 24 |  nifty... 25 |   nifty... 26 |  nifty... 27 |   nifty... 28 |  nifty... 29 |   nifty... 30 |  nifty... 31 |   nifty... 32 |  nifty... 33 |   nifty... 34 |  nifty... 35 |   nifty... 36 |  nifty... 37 |   nifty... 38 |  nifty... 39 |   nifty... 40 |  nifty... 41 |   nifty... 42 |  nifty... 43 |   44 |  45 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/duckpaint.vt: -------------------------------------------------------------------------------- 1 | < 2 |  3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 | ~~~~~~~~~~~~~~~~~~~ 8 | ~~~~~~~~~~~~~~~~~~~~~ 9 | \ 10 | \\ 11 | \ 12 | \\\\\\ 13 | \\\\\\\ 14 | \\\\\\\\ 15 | \\\\\\\ 16 | \\\\\ 17 | \\\ 18 | \ 19 | UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 20 | UUUUUUUUUUUUUUU 21 | UUUUUUUUUUUUUUUU 22 | UUUUUUUUUUUUUU 23 | UU 24 | UUUUUUUUU 25 | UUUUUUUUUUUUUUU 26 | UUUUUUUUUUUUU 27 | UU 28 | UU 29 | UUUUUUUUUU 30 | UUUUUUUUUUUUU 31 | UUUUUUUUUU 32 | UU 33 | UU 34 | UU 35 | UUUUUUUUUU 36 | UUUUUUUUUUUU 37 | UUUUUUU 38 | UU 39 | UU 40 | UU 41 | UU 42 | UUUUUUUUU 43 | UUUUUUUUUUUU 44 | UUUU 45 | UU 46 | UU 47 | UU 48 | UU 49 | UU 50 | UUUUUUU 51 | UUUUUUUUUUUU 52 | UU 53 | UU 54 | UU 55 | UU 56 | UU 57 | UU 58 | UU 59 | UUUUU 60 | UUUUUUUU 61 | UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 62 | UUUUUUUUUU 63 | UUUU 64 | U 65 | ///// 66 | ///////// 67 | //////////// 68 | ////////////// 69 | /////////////// 70 | /////// 71 | //// 72 | // 73 | ........ 74 | ............. 75 | ............... 76 | UUUUUUUUU 77 | ............ 78 | UUUUUUUUUUUUUU 79 | .............. 80 | UUUUUU 81 | ........ 82 | OO 83 | .... 84 | UU 85 | ............. 86 | ......... 87 |  88 | UUUUUUUUU 89 | quack 90 |  91 |  92 | UUUUUUUUU 93 |  94 | UUUUUUUUU 95 | quack 96 |  97 |  98 | UUUUUUUUU 99 |  100 | -------------------------------------------------------------------------------- /_fs/root-skel/etc/rc.d/network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /etc/rc.subr 4 | 5 | DEFCONF=/etc/rc.conf.d/network 6 | CONF=/etc/rc.conf.d/network 7 | 8 | ROUTES=/var/routes 9 | RET=0 10 | 11 | # Function evaluates network variable 12 | network_var() { 13 | iface=$1 14 | var=$2 15 | eval echo "\$network_${iface}_${var}" 16 | } 17 | 18 | 19 | network_ifconfig() { 20 | iface=$1 21 | status="down" 22 | mode="dhcp" 23 | modefl="dynamic" 24 | ip="" 25 | mask="" 26 | 27 | rc_msg " $iface" -n 28 | 29 | if [ "X$(network_var $iface enabled)" == "X1" ]; then 30 | status="up" 31 | mode="$(network_var $iface mode)" 32 | 33 | if [ "X$mode" == "Xstatic" ]; then 34 | modefl="-dynamic" 35 | ip="$(network_var $iface ip)" 36 | mask="$(network_var $iface mask)" 37 | 38 | rc_msg " $status $mode $ip netmask $mask" -n 39 | ifconfig_args="$status $modefl $ip netmask $mask" 40 | else 41 | modefl="dynamic" 42 | rc_msg " $status $mode" -n 43 | ifconfig_args="$status $modefl" 44 | fi 45 | else 46 | rc_msg " $status" -n 47 | ifconfig_args="$status" 48 | fi 49 | 50 | if ! ifconfig $iface $ifconfig_args >/dev/null 2>&1; then 51 | rc_msg " [FAILED]" " " err 52 | RET=1 53 | else 54 | gw=$(network_var $iface gateway) 55 | metric=$(network_var $iface metric) 56 | 57 | if [ "X$status" == "Xup" ] && ( [ "X$gw" != "X" ] || [ "X$metric" != "X" ] ); then 58 | 59 | if [ "X$metric" == "X" ]; then 60 | metric="64" 61 | fi 62 | 63 | if [ "X$gw" == "X" ] || [ "X$mode" = "Xdhcp" ]; then 64 | route_args="metric $metric" 65 | gw="default" 66 | else 67 | route_args="gw $gw metric $metric" 68 | fi 69 | 70 | rc_msg " gw $gw metric $metric" -n 71 | if ! route add default $route_args $iface >/dev/null 2>&1; then 72 | rc_msg " [FAILED]" " " err 73 | RET=1 74 | else 75 | echo "default $route_args $iface" >> $ROUTES 76 | echo "" 77 | fi 78 | else 79 | echo "" 80 | fi 81 | fi 82 | } 83 | 84 | 85 | if [ ! -f $CONF ]; then 86 | rc_log "Network configuration not found! Switching to default configuration." 87 | cp $DEFCONF $CONF 88 | fi 89 | . $CONF 90 | 91 | rc_msg "Configuring network" 92 | 93 | touch $ROUTES 94 | 95 | while read route; do 96 | route del $route 97 | done < $ROUTES 98 | 99 | rm -f $ROUTES 100 | 101 | for i in $network_interfaces; do 102 | network_ifconfig $i 103 | done 104 | 105 | exit $RET 106 | -------------------------------------------------------------------------------- /_targets/armv8r52/mps3an536/build.project: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Shell script for building armv8r52-mps3an536 project 4 | # 5 | # Copyright 2018-2020, 2024 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski, Lukasz Leczkowski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_COREMARK=n 32 | export PORTS_COREMARK_PRO=n 33 | 34 | 35 | # 36 | # Platform dependent parameters 37 | # 38 | export SIZE_PAGE=$((0x1000)) 39 | 40 | # 41 | # Project specific build 42 | # 43 | 44 | export BOOT_DEVICE="flash0" 45 | export MAGIC_USER_SCRIPT=dabaabad 46 | 47 | # Physical kernel address 48 | KERNEL_PHBASE=$((0x10000000)) # bram start address 49 | KERNEL_PHOFFS=$((0x0)) 50 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 51 | export KERNEL_PHADDR 52 | 53 | 54 | b_build_project() { 55 | b_log "Building user applications" 56 | make -C "_user" all install 57 | } 58 | 59 | 60 | b_build_target() { 61 | b_log "Building $TARGET project" 62 | b_log "Building phoenix-rtos-loader" 63 | 64 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 65 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 66 | 67 | make -C plo all 68 | 69 | cp -a "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "${PREFIX_BOOT}/plo.elf" 70 | } 71 | 72 | 73 | b_image_target() { 74 | b_log "Building image of $TARGET" 75 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 76 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 77 | } 78 | 79 | 80 | b_test_target() { 81 | b_log "Build and install tests in the phoenix-rtos filesystem" 82 | make -C "phoenix-rtos-tests" all install 83 | } 84 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt117x/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt117x project 4 | # 5 | # Copyright 2018, 2019, 2020, 2021 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski, Hubert Buczynski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_COREMARK=n 32 | export PORTS_COREMARK_PRO=n 33 | 34 | 35 | # 36 | # Platform dependent parameters 37 | # 38 | export SIZE_PAGE=$((0x200)) 39 | 40 | 41 | # 42 | # Project specific build 43 | # 44 | 45 | export BOOT_DEVICE="flash0" 46 | export MAGIC_USER_SCRIPT=dabaabad 47 | BOOT_DEVICE="flash0" 48 | 49 | 50 | # Physical kernel address 51 | KERNEL_PHBASE=$((0x0)) # itcm start address 52 | KERNEL_PHOFFS=$((0x0)) 53 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 54 | export KERNEL_PHADDR 55 | 56 | 57 | b_build_project() { 58 | b_log "Building user applications" 59 | make -C "_user" all install 60 | } 61 | 62 | 63 | b_build_target() { 64 | b_log "Building $TARGET project" 65 | b_log "Building phoenix-rtos-loader" 66 | 67 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 68 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 69 | 70 | make -C plo all 71 | 72 | cp -a "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" 73 | cp -a "phoenix-rtos-hostutils/psu/plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.sdp" "$PREFIX_BOOT/plo-ram.sdp" 74 | } 75 | 76 | 77 | b_image_target() { 78 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 79 | image_builder.py -v disk --nvm "$NVM_CONFIG" --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 80 | } 81 | 82 | 83 | b_test_target() { 84 | b_log "Build and install tests in the phoenix-rtos filesystem" 85 | make -C "phoenix-rtos-tests" all install 86 | } 87 | -------------------------------------------------------------------------------- /_projects/riscv64-grfpga-artya7/riscv64-grfpga-artya7.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | #size-cells = <1>; 6 | model = "RISC-V NOEL-V 64 bit"; 7 | compatible = "gaisler,noelv"; 8 | 9 | chosen { 10 | bootargs = "earlycon=sbi console=ttyGR0,115200"; 11 | }; 12 | 13 | aliases { 14 | serial0 = &uart0; 15 | }; 16 | 17 | cpus { 18 | #address-cells = <1>; 19 | #size-cells = <0>; 20 | timebase-frequency = <20000000>; 21 | 22 | cpu0: cpu@0 { 23 | device_type = "cpu"; 24 | reg = <0>; 25 | status = "okay"; 26 | compatible = "riscv"; 27 | riscv,isa = "rv64imafd_zicbom"; 28 | mmu-type = "riscv,sv39"; 29 | 30 | cpu0_intc: interrupt-controller { 31 | #interrupt-cells = <1>; 32 | interrupt-controller; 33 | compatible = "riscv,cpu-intc"; 34 | }; 35 | }; 36 | }; 37 | 38 | memory@0 { 39 | device_type = "memory"; 40 | reg = <0x00 0x00 0x00 0x10000000>; 41 | }; 42 | 43 | sysclock: sysclock { 44 | #clock-cells = <0>; 45 | compatible = "fixed-clock"; 46 | clock-frequency = <40000000>; 47 | }; 48 | 49 | soc { 50 | #address-cells = <1>; 51 | #size-cells = <1>; 52 | compatible = "simple-bus"; 53 | ranges; 54 | 55 | clint@e0000000 { 56 | compatible = "riscv,clint0"; 57 | interrupts-extended = < 58 | &cpu0_intc 3 59 | &cpu0_intc 7 60 | >; 61 | reg = <0xe0000000 0x100000>; 62 | reg-names = "control"; 63 | }; 64 | 65 | plic0: interrupt-controller@f8000000 { 66 | #address-cells = <0>; 67 | #interrupt-cells = <1>; 68 | compatible = "riscv,plic0"; 69 | reg = <0xf8000000 0x4000000>; 70 | interrupt-controller; 71 | interrupts-extended = < 72 | &cpu0_intc 11 73 | &cpu0_intc 9 74 | &cpu0_intc 8 75 | &cpu0_intc 10 76 | >; 77 | riscv,max-priority = <7>; 78 | riscv,ndev = <31>; 79 | }; 80 | 81 | greth@fc084000 { 82 | compatible = "gaisler,greth"; 83 | reg = <0xfc084000 0x100>; 84 | interrupt-parent = <&plic0>; 85 | interrupts = <5>; 86 | preserve-link = <1>; 87 | local-mac-address = [00 50 c2 75 a3 52]; 88 | }; 89 | 90 | uart0: uart@fc001000 { 91 | compatible = "gaisler,apbuart"; 92 | reg = <0xfc001000 0x100>; 93 | clocks = <&sysclock>; 94 | current-speed = <115200>; 95 | interrupt-parent = <&plic0>; 96 | interrupts = <1>; 97 | }; 98 | }; 99 | }; 100 | -------------------------------------------------------------------------------- /_targets/armv8m33/mcxn94x/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv8m33-mcxn94x project 4 | # 5 | # Copyright 2018, 2019, 2020, 2024 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_COREMARK=n 32 | export PORTS_COREMARK_PRO=n 33 | 34 | 35 | # 36 | # Platform dependent parameters 37 | # 38 | export SIZE_PAGE=$((0x200)) 39 | 40 | 41 | # 42 | # Project specific build 43 | # 44 | 45 | export BOOT_DEVICE="flash0" 46 | export MAGIC_USER_SCRIPT=dabaabad 47 | 48 | 49 | # Physical kernel address 50 | KERNEL_PHBASE=$((0)) # flash0 start address 51 | KERNEL_PHOFFS=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0.kernel.offs }}') 52 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 53 | export KERNEL_PHADDR 54 | 55 | 56 | b_build_project() { 57 | b_log "Building user applications" 58 | make -C "_user" all install 59 | } 60 | 61 | 62 | b_build_target() { 63 | b_log "Building $TARGET project" 64 | b_log "Building phoenix-rtos-loader" 65 | 66 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 67 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 68 | 69 | make -C plo all 70 | 71 | b_log "Creating kernel binary image" 72 | KERNEL_ELF="phoenix-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" 73 | ${CROSS}objcopy "${PREFIX_PROG_STRIPPED}${KERNEL_ELF}" -O binary "${PREFIX_PROG_STRIPPED}${KERNEL_ELF/.elf/.bin}" 74 | } 75 | 76 | 77 | b_image_target() { 78 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 79 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 80 | } 81 | 82 | b_test_target() { 83 | b_log "Build and install tests in the phoenix-rtos filesystem" 84 | make -C "phoenix-rtos-tests" all install 85 | } 86 | -------------------------------------------------------------------------------- /_targets/armv7m4/stm32l4x6/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m4-stm32l4x6 project 4 | # 5 | # Copyright 2018, 2019, 2020 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_COREMARK=n 32 | export PORTS_COREMARK_PRO=n 33 | 34 | 35 | # 36 | # Platform dependent parameters 37 | # 38 | export SIZE_PAGE=$((0x200)) 39 | 40 | 41 | # 42 | # Project specific build 43 | # 44 | 45 | export BOOT_DEVICE="flash0" 46 | export MAGIC_USER_SCRIPT=dabaabad 47 | 48 | 49 | # Physical kernel address 50 | KERNEL_PHBASE=$((0x08000000)) # flash0 start address 51 | KERNEL_PHOFFS=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0.kernel.offs }}') 52 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 53 | export KERNEL_PHADDR 54 | 55 | 56 | b_build_project() { 57 | b_log "Building user applications" 58 | make -C "_user" all install 59 | } 60 | 61 | 62 | b_build_target() { 63 | b_log "Building $TARGET project" 64 | b_log "Building phoenix-rtos-loader" 65 | 66 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 67 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 68 | 69 | make -C plo all 70 | 71 | b_log "Creating kernel binary image" 72 | KERNEL_ELF="phoenix-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" 73 | ${CROSS}objcopy "${PREFIX_PROG_STRIPPED}${KERNEL_ELF}" -O binary "${PREFIX_PROG_STRIPPED}${KERNEL_ELF/.elf/.bin}" 74 | } 75 | 76 | 77 | b_image_target() { 78 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 79 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 80 | } 81 | 82 | b_test_target() { 83 | b_log "Build and install tests in the phoenix-rtos filesystem" 84 | make -C "phoenix-rtos-tests" all install 85 | } 86 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt105x/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt105x project 4 | # 5 | # Copyright 2018, 2019, 2020 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski, Hubert Buczynski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_MICROPYTHON=n 32 | export PORTS_MBEDTLS=n 33 | export PORTS_AZURE_SDK=n 34 | export PORTS_COREMARK=n 35 | export PORTS_COREMARK_PRO=n 36 | 37 | 38 | # 39 | # Platform dependent parameters 40 | # 41 | export SIZE_PAGE=$((0x200)) 42 | 43 | # 44 | # Project specific build 45 | # 46 | 47 | export BOOT_DEVICE="flash0" 48 | export MAGIC_USER_SCRIPT=dabaabad 49 | 50 | 51 | # Physical kernel address 52 | KERNEL_PHBASE=$((0x0)) # itcm start address 53 | KERNEL_PHOFFS=$((0x0)) 54 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 55 | export KERNEL_PHADDR 56 | 57 | 58 | 59 | b_build_project() { 60 | b_log "Building user applications" 61 | make -C "_user" all install 62 | } 63 | 64 | 65 | b_build_target() { 66 | b_log "Building $TARGET project" 67 | b_log "Building phoenix-rtos-loader" 68 | 69 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 70 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 71 | 72 | make -C plo all 73 | 74 | cp -a "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" 75 | cp -a "phoenix-rtos-hostutils/psu/plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.sdp" "$PREFIX_BOOT/plo-ram.sdp" 76 | } 77 | 78 | 79 | b_image_target() { 80 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 81 | image_builder.py -v disk --nvm "$NVM_CONFIG" --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 82 | } 83 | 84 | 85 | b_test_target() { 86 | b_log "Build and install tests in the phoenix-rtos filesystem" 87 | make -C "phoenix-rtos-tests" all install 88 | } 89 | -------------------------------------------------------------------------------- /_targets/armv7m7/imxrt106x/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building armv7m7-imxrt105x, armv7m7-imxrt106x project 4 | # 5 | # Copyright 2018, 2019, 2020 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski, Hubert Buczynski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=arm-phoenix- 13 | 14 | export BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 16 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 17 | 18 | # 19 | # Ports configuration 20 | # 21 | export PORTS_BUSYBOX=n 22 | export PORTS_PCRE=n 23 | export PORTS_OPENSSL=n 24 | export PORTS_LIGHTTPD=n 25 | export PORTS_DROPBEAR=n 26 | export PORTS_LUA=n 27 | export PORTS_LZO=n 28 | export PORTS_OPENVPN=n 29 | export PORTS_JANSSON=n 30 | export PORTS_CURL=n 31 | export PORTS_MICROPYTHON=n 32 | export PORTS_MBEDTLS=n 33 | export PORTS_AZURE_SDK=n 34 | export PORTS_COREMARK=n 35 | export PORTS_COREMARK_PRO=n 36 | 37 | 38 | # 39 | # Platform dependent parameters 40 | # 41 | export SIZE_PAGE=$((0x200)) 42 | 43 | # 44 | # Project specific build 45 | # 46 | 47 | export BOOT_DEVICE="flash1" 48 | export MAGIC_USER_SCRIPT=dabaabad 49 | 50 | 51 | # Physical kernel address 52 | KERNEL_PHBASE=$((0x0)) # itcm start address 53 | KERNEL_PHOFFS=$((0x0)) 54 | KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) 55 | export KERNEL_PHADDR 56 | 57 | 58 | b_build_project() { 59 | b_log "Building user applications" 60 | make -C "_user" all install 61 | } 62 | 63 | 64 | b_build_target() { 65 | b_log "Building $TARGET project" 66 | b_log "Building phoenix-rtos-loader" 67 | 68 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 69 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 70 | 71 | make -C plo all 72 | 73 | cp -a "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" 74 | cp -a "phoenix-rtos-hostutils/psu/plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.sdp" "$PREFIX_BOOT/plo-ram.sdp" 75 | } 76 | 77 | 78 | b_image_target() { 79 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name user --script "$PLO_SCRIPT_USER" 80 | image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash1 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 81 | } 82 | 83 | 84 | b_test_target() { 85 | b_log "Build and install tests in the phoenix-rtos filesystem" 86 | make -C "phoenix-rtos-tests" all install 87 | } 88 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for riscv64-gr765-fpga 5 | * 6 | * Copyright 2025 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | /* GRLIB UART configuration */ 18 | #define UART_BAUDRATE 115200 19 | 20 | #define UART0_BASE ((void *)0xff900000U) 21 | #define UART1_BASE ((void *)-1) 22 | #define UART2_BASE ((void *)-1) 23 | #define UART3_BASE ((void *)-1) 24 | #define UART4_BASE ((void *)-1) 25 | #define UART5_BASE ((void *)-1) 26 | 27 | #define UART0_IRQ 1 28 | #define UART1_IRQ -1 29 | #define UART2_IRQ -1 30 | #define UART3_IRQ -1 31 | #define UART4_IRQ -1 32 | #define UART5_IRQ -1 33 | 34 | #define UART0_TX -1 35 | #define UART0_RX -1 36 | 37 | #define UART1_TX -1 38 | #define UART1_RX -1 39 | 40 | #define UART2_TX -1 41 | #define UART2_RX -1 42 | 43 | #define UART3_TX -1 44 | #define UART3_RX -1 45 | 46 | #define UART4_TX -1 47 | #define UART4_RX -1 48 | 49 | #define UART5_TX -1 50 | #define UART5_RX -1 51 | 52 | #define UART0_ACTIVE 1 53 | #define UART1_ACTIVE 0 54 | #define UART2_ACTIVE 0 55 | #define UART3_ACTIVE 0 56 | #define UART4_ACTIVE 0 57 | #define UART5_ACTIVE 0 58 | 59 | #define UART_CONSOLE_PLO 0 60 | #define UART_CONSOLE_KERNEL 0 61 | #define UART_CONSOLE_USER 0 62 | #define SPIKETTY_CONSOLE_USER 0 63 | 64 | #define UART_MAX_CNT 1 65 | 66 | #define TIMER_FREQ (50 * 1000 * 1000) 67 | 68 | #define PLIC_BASE 0xf8000000UL 69 | #define PLIC_IRQ_SIZE 32 70 | 71 | #define SYSCLK_FREQ (100 * 1000 * 1000) 72 | 73 | #define SBI_AREA_START 0x0UL 74 | #define SBI_AREA_END 0x10000UL 75 | 76 | #define DCACHE_BLOCK_SIZE 32U 77 | 78 | /* RAM storage config */ 79 | #define RAM_ADDR (0x10000000) 80 | #define RAM_BANK_SIZE (0x10000000) 81 | 82 | /* SpaceWire GRSPW2 */ 83 | 84 | #define SPW_CNT 2 85 | 86 | #define SPW0_ACTIVE 1 87 | #define SPW1_ACTIVE 1 88 | #define SPW2_ACTIVE 0 89 | #define SPW3_ACTIVE 0 90 | #define SPW4_ACTIVE 0 91 | #define SPW5_ACTIVE 0 92 | 93 | #define SPW_MAX_PACKET_LEN 1024 94 | 95 | #define TEST_SPW_ADDR0 0x3 96 | #define TEST_SPW_ADDR1 0x4 97 | 98 | /* if ports are connected via loopback */ 99 | #define TEST_SPW_LOOPBACK 0 100 | 101 | /* SpaceWire SPWRTR */ 102 | 103 | #define SPWRTR_CNT 1 104 | 105 | #define SPWRTR0_ACTIVE 1 106 | #define SPWRTR1_ACTIVE 0 107 | #define SPWRTR2_ACTIVE 0 108 | #define SPWRTR3_ACTIVE 0 109 | #define SPWRTR4_ACTIVE 0 110 | #define SPWRTR5_ACTIVE 0 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /_projects/riscv64-gr765-vcu118/riscv64-gr765-vcu118.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | #address-cells = <1>; 5 | #size-cells = <1>; 6 | model = "RISC-V GR765"; 7 | compatible = "gaisler,noelv"; 8 | 9 | chosen { 10 | bootargs = "earlycon=sbi console=ttyGR0,115200"; 11 | }; 12 | 13 | aliases { 14 | serial0 = &uart0; 15 | }; 16 | 17 | cpus { 18 | #address-cells = <1>; 19 | #size-cells = <0>; 20 | timebase-frequency = <50000000>; 21 | 22 | cpu0: cpu@0 { 23 | device_type = "cpu"; 24 | reg = <0>; 25 | status = "okay"; 26 | compatible = "gaisler,noelv", "riscv"; 27 | riscv,isa = "rv64imafd"; 28 | mmu-type = "riscv,sv39"; 29 | cpu0_intc: interrupt-controller { 30 | #interrupt-cells = <1>; 31 | interrupt-controller; 32 | compatible = "riscv,cpu-intc"; 33 | }; 34 | }; 35 | }; 36 | 37 | memory@0 { 38 | device_type = "memory"; 39 | reg = <0x00 0x00 0x00000000 0x20000000>; 40 | }; 41 | 42 | sysclock: sysclock { 43 | #clock-cells = <0>; 44 | compatible = "fixed-clock"; 45 | clock-frequency = <100000000>; 46 | }; 47 | 48 | soc { 49 | #address-cells = <1>; 50 | #size-cells = <1>; 51 | compatible = "simple-bus"; 52 | ranges; 53 | 54 | clint@e0000000 { 55 | compatible = "riscv,clint0"; 56 | interrupts-extended = < 57 | &cpu0_intc 3 58 | &cpu0_intc 7 59 | >; 60 | reg = <0xe0000000 0x100000>; 61 | reg-names = "control"; 62 | }; 63 | 64 | plic0: interrupt-controller@f8000000 { 65 | #address-cells = <0>; 66 | #interrupt-cells = <1>; 67 | compatible = "riscv,plic0"; 68 | reg = <0xf8000000 0x4000000>; 69 | interrupt-controller; 70 | interrupts-extended = < 71 | &cpu0_intc 11 72 | &cpu0_intc 9 73 | &cpu0_intc 8 74 | &cpu0_intc 10 75 | >; 76 | riscv,max-priority = <7>; 77 | riscv,ndev = <31>; 78 | }; 79 | 80 | greth0: greth@fc084000 { 81 | compatible = "gaisler,greth"; 82 | reg = <0xfc084000 0x100>; 83 | interrupt-parent = <&plic0>; 84 | interrupts = <5>; 85 | preserve-link = <1>; 86 | local-mac-address = [00 50 C2 75 a3 52]; 87 | }; 88 | 89 | uart0: uart@ff900000 { 90 | #address-cells = <2>; 91 | #size-cells = <2>; 92 | compatible = "gaisler,apbuart"; 93 | reg = <0xff900000 0x100>; 94 | clocks = <&sysclock>; 95 | current-speed = <115200>; 96 | interrupt-parent = <&plic0>; 97 | interrupts = <1>; 98 | }; 99 | }; 100 | }; 101 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/lwip/lwipopts.h: -------------------------------------------------------------------------------- 1 | #define LWIP_TCPIP_CORE_LOCKING 1 2 | #define LWIP_SUPPORT_CUSTOM_PBUF 1 3 | #define LWIP_NETIF_LOOPBACK 1 4 | #define LWIP_HAVE_SLIPIF 0 5 | #define LWIP_NETIF_API 1 6 | #define LWIP_SOCKET 1 7 | #define LWIP_COMPAT_SOCKETS 0 8 | #define LWIP_ARP 1 9 | #define LWIP_ICMP 1 10 | #define LWIP_RAW 1 11 | #define LWIP_DHCP 1 12 | #define LWIP_DNS 1 13 | #define LWIP_AUTOIP 1 14 | #define LWIP_UDP 1 15 | #define LWIP_TCP 1 16 | #define LWIP_TCP_KEEPALIVE 1 17 | #define MEM_LIBC_MALLOC 1 18 | #define MEMP_MEM_MALLOC 1 19 | #define LWIP_ERRNO_INCLUDE "errno.h" 20 | #define LWIP_DNS_API_DEFINE_ERRORS 0 21 | #define LWIP_DNS_API_DEFINE_FLAGS 0 22 | #define LWIP_DNS_API_DECLARE_STRUCTS 0 23 | #define LWIP_DNS_API_DECLARE_H_ERRNO 0 24 | #define MEMP_NUM_NETCONN 1024 25 | #define PPP_SUPPORT 1 26 | #define PPPOS_SUPPORT 1 27 | #define PAP_SUPPORT 1 28 | #define CHAP_SUPPORT 1 29 | #define MSCHAP_SUPPORT 1 30 | #define LWIP_TIMEVAL_PRIVATE 0 31 | 32 | #define LWIP_IPV6 1 33 | #define LWIP_IPV6_AUTOCONFIG 1 34 | #define LWIP_IFSTATUS_DEV_BUFFER_SIZE 1024 35 | 36 | 37 | #if 0 // debugging LWiP PPPoS 38 | #define LWIP_DEBUG 1 39 | #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 40 | #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 41 | #define PPP_DEBUG LWIP_DBG_ON 42 | #endif 43 | 44 | #if 0 45 | #define LWIP_DEBUG 1 46 | #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL 47 | #define LWIP_DBG_TYPES_ON LWIP_DBG_ON 48 | #define PBUF_DEBUG LWIP_DBG_OFF 49 | #define SOCKETS_DEBUG LWIP_DBG_ON 50 | #endif 51 | 52 | #ifndef LWIP_STATS 53 | #define LWIP_STATS 0 54 | #endif 55 | 56 | #if LWIP_STATS 57 | #define LWIP_STATS_DISPLAY 1 58 | #define LINK_STATS 1 59 | #define IP_STATS 1 60 | #define ICMP_STATS 1 61 | #define IGMP_STATS 1 62 | #define IPFRAG_STATS 1 63 | #define UDP_STATS 1 64 | #define TCP_STATS 1 65 | #define MEM_STATS 1 66 | #define MEMP_STATS 1 67 | #define PBUF_STATS 1 68 | #define SYS_STATS 1 69 | #endif /* LWIP_STATS */ 70 | 71 | #define TCP_MSS 1460 72 | #define TCP_WND (32 * TCP_MSS) 73 | #define TCP_SND_BUF TCP_WND 74 | #define ETH_PAD_SIZE 2 75 | #define ETHARP_TABLE_MATCH_NETIF 1 76 | #define IP_REASSEMBLY 1 77 | #define IP_FRAG 1 78 | #define SO_REUSE 1 79 | #define DEFAULT_THREAD_STACKSIZE (4 * 4096) 80 | #define TCPIP_THREAD_STACKSIZE (4 * 4096) 81 | #define TCPIP_THREAD_PRIO 3 82 | #define TCPIP_MBOX_SIZE 256 83 | #define DEFAULT_RAW_RECVMBOX_SIZE 32 84 | #define DEFAULT_UDP_RECVMBOX_SIZE 32 85 | #define DEFAULT_TCP_RECVMBOX_SIZE 32 86 | #define DEFAULT_ACCEPTMBOX_SIZE 32 87 | #define LWIP_HOOK_FILENAME "phoenix-hooks.h" 88 | #define LWIP_EXT_PF 1 89 | #define LWIP_NETIF_STATUS_CALLBACK 1 90 | #define LWIP_DHCP_AUTOIP_COOP 1 91 | #define LWIP_DHCP_AUTOIP_COOP_TRIES 3 92 | #define LWIP_SO_RCVTIMEO 1 93 | #define ifreq lwip_ifreq 94 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/vt_files.nfo: -------------------------------------------------------------------------------- 1 | vt_files.zip contain 101 VT100 ASCII art animation files. 2 | All but eight of these vt files are from http://artscene.textfiles.com 3 | The other eight are from http://grox.net/misc/vt/ 4 | 5 | SIZE NAME 6 | 206414 aquarium.vt 7 | 4510 arrow.vt 8 | 11122 bambi_godzila.vt 9 | 12818 bambi.vt 10 | 9150 barney.vt 11 | 14415 beer.vt 12 | 14726 bevis.butthead.vt 13 | 2687 blinkeyes.vt 14 | 2649 bomb.vt 15 | 4096 bugsbunny.vt 16 | 17418 cartwhee.vt 17 | 124032 castle.vt 18 | 85697 cert18.vt 19 | 8102 coke.vt 20 | 42517 cowboom.vt 21 | 43515 cow.vt 22 | 14116 crash.vt 23 | 26284 cursor.vt 24 | 8512 delay.vt 25 | 14055 demo.vt 26 | 1446 dodgeram.vt 27 | 15297 dontworry.vt 28 | 15305 dont-wor.vt 29 | 1875 duckpaint.vt 30 | 6727 fireworks.vt 31 | 34801 firework.vt 32 | 211945 fishy2.vt 33 | 6542 fishy-fishy.vt 34 | 8473 fishy.vt 35 | 33029 flatmap.vt 36 | 19490 frogs.vt 37 | 11620 glass.vt 38 | 29696 globe.vt 39 | 13460 hallow.vt 40 | 3500 hello.vt 41 | 59568 iluvu.vt 42 | 41773 juanspla.vt 43 | 3173 july.4.vt 44 | 28816 jumble.vt 45 | 57344 maingate.vt 46 | 107136 mark_twain.vt 47 | 51041 monkey.vt 48 | 22016 monorail.vt 49 | 6845 moon_animation.vt 50 | 250452 movglobe.vt 51 | 11274 mr_pumpkin.vt 52 | 19159 nasa.vt 53 | 40186 newbeer.vt 54 | 10777 new_year.vt 55 | 2248 nifty.vt 56 | 62341 olimits.vt 57 | 63832 outerlimits.vt 58 | 17248 pac3d.vt 59 | 24788 paradise.vt 60 | 79456 peace.vt 61 | 28794 prey_col.vt 62 | 9010 prey.vt 63 | 51387 shuttle.vt 64 | 229 sig.vt 65 | 12544 skyway.vt 66 | 191745 snails.vt 67 | 10610 snowing.vt 68 | 3016 spinweb.vt 69 | 130234 sship.vt 70 | 100342 startrek.vt 71 | 6515 strike.vt 72 | 1888 sun.vt 73 | 21929 surf.vt 74 | 9176 tetris.vt 75 | 39808 tomorrw.vt 76 | 3189 torturetest.vt 77 | 49089 treadmill.vt 78 | 100341 trekvid.vt 79 | 21075 trek.vt 80 | 13114 turkey.vt 81 | 63909 tv.vt 82 | 64272 twilight.vt 83 | 62341 twilightzone.vt 84 | 3702 valentine.vt 85 | 3702 valentin.vt 86 | 80554 van_halen.vt 87 | 23493 vicki.vt 88 | 9749 wineglas.vt 89 | 8233 xmas-00.vt 90 | 8861 xmas-01.vt 91 | 36625 xmas-02.vt 92 | 16129 xmas-03.vt 93 | 29934 xmas-04.vt 94 | 28369 xmas-05.vt 95 | 2813 xmas-06.vt 96 | 1799 xmas-07.vt 97 | 2897 xmas-08.vt 98 | 29519 xmas-09.vt 99 | 78759 xmas2.vt 100 | 130278 xmas_large.vt 101 | 16384 xmasshort.vt 102 | 46046 xmas.vt 103 | 15602 zorro.vt 104 | /x_rated/ 105 | 25081 dirty.vt 106 | 8904 dogs.vt 107 | 110650 safesex.vt 108 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-generic-qemu/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for sparcv8leon-generic-qemu 5 | * 6 | * Copyright 2024 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #define SYSCLK_FREQ (40 * 1000 * 1000) /* MHz */ 18 | 19 | #define UART_MAX_CNT 1 20 | 21 | #define UART_BAUDRATE 115200 22 | 23 | #define UART0_BASE ((void *)0x80000100U) 24 | #define UART1_BASE ((void *)-1) 25 | #define UART2_BASE ((void *)-1) 26 | #define UART3_BASE ((void *)-1) 27 | #define UART4_BASE ((void *)-1) 28 | #define UART5_BASE ((void *)-1) 29 | 30 | #define UART0_IRQ 3 31 | #define UART1_IRQ -1 32 | #define UART2_IRQ -1 33 | #define UART3_IRQ -1 34 | #define UART4_IRQ -1 35 | #define UART5_IRQ -1 36 | 37 | #define UART0_TX -1 38 | #define UART0_RX -1 39 | 40 | #define UART1_TX -1 41 | #define UART1_RX -1 42 | 43 | #define UART2_TX -1 44 | #define UART2_RX -1 45 | 46 | #define UART3_TX -1 47 | #define UART3_RX -1 48 | 49 | #define UART4_TX -1 50 | #define UART4_RX -1 51 | 52 | #define UART5_TX -1 53 | #define UART5_RX -1 54 | 55 | #define UART0_ACTIVE 1 56 | #define UART1_ACTIVE 0 57 | #define UART2_ACTIVE 0 58 | #define UART3_ACTIVE 0 59 | #define UART4_ACTIVE 0 60 | #define UART5_ACTIVE 0 61 | 62 | #define UART0_DMA 0 63 | #define UART1_DMA 0 64 | #define UART2_DMA 0 65 | #define UART3_DMA 0 66 | #define UART4_DMA 0 67 | #define UART5_DMA 0 68 | 69 | #define UART_CONSOLE_PLO 0 70 | #define UART_CONSOLE_KERNEL 0 71 | #define UART_CONSOLE_USER 0 72 | 73 | #define GPIO_DIR_IN 0 74 | #define GPIO_DIR_OUT 1 75 | 76 | /* Interrupts */ 77 | 78 | #define INT_CTRL_BASE ((void *)0x80000200U) 79 | #define EXTENDED_IRQN 12 80 | 81 | /* Timers */ 82 | 83 | #define TIMER0_1_IRQ 6 84 | #define TIMER0_2_IRQ 7 85 | #define GPTIMER0_BASE ((void *)0x80000300U) 86 | #define GPTIMER1_BASE ((void *)0) 87 | 88 | /* ADC */ 89 | 90 | #define ADC_CNT 0 91 | 92 | #define ADC0_ACTIVE 0 93 | #define ADC1_ACTIVE 0 94 | #define ADC2_ACTIVE 0 95 | #define ADC3_ACTIVE 0 96 | #define ADC4_ACTIVE 0 97 | #define ADC5_ACTIVE 0 98 | #define ADC6_ACTIVE 0 99 | #define ADC7_ACTIVE 0 100 | 101 | /* SPI */ 102 | 103 | #define SPI_CNT 0 104 | 105 | /* GPIO */ 106 | 107 | #define GPIO_PORT_CNT 0 108 | 109 | /* SpaceWire */ 110 | 111 | #define SPW_CNT 0 112 | 113 | #define SPW0_ACTIVE 0 114 | #define SPW1_ACTIVE 0 115 | #define SPW2_ACTIVE 0 116 | #define SPW3_ACTIVE 0 117 | #define SPW4_ACTIVE 0 118 | #define SPW5_ACTIVE 0 119 | 120 | /* SMP */ 121 | 122 | #define TLB_IRQ 14 123 | 124 | /* DMA */ 125 | 126 | #define DMA_MAX_CNT 0 127 | 128 | 129 | #define ADDR_FLASH 0x00000000U 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mimas/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for sparcv8leon-gr716-mimas 5 | * 6 | * Copyright 2023 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #define SYSCLK_FREQ (100 * 1000 * 1000) /* MHz */ 18 | 19 | #define UART_MAX_CNT 2 20 | 21 | #define UART_BAUDRATE 115200 22 | 23 | #define UART0_BASE ((void *)0x80302000U) 24 | #define UART1_BASE ((void *)0x80303000U) 25 | #define UART2_BASE ((void *)-1) 26 | #define UART3_BASE ((void *)-1) 27 | #define UART4_BASE ((void *)-1) 28 | #define UART5_BASE ((void *)-1) 29 | 30 | #define UART0_IRQ 10 31 | #define UART1_IRQ 12 32 | #define UART2_IRQ -1 33 | #define UART3_IRQ -1 34 | #define UART4_IRQ -1 35 | #define UART5_IRQ -1 36 | 37 | #define UART0_TX 58 38 | #define UART0_RX 59 39 | 40 | #define UART1_TX 62 41 | #define UART1_RX 61 42 | 43 | #define UART2_TX -1 44 | #define UART2_RX -1 45 | 46 | #define UART3_TX -1 47 | #define UART3_RX -1 48 | 49 | #define UART4_TX -1 50 | #define UART4_RX -1 51 | 52 | #define UART5_TX -1 53 | #define UART5_RX -1 54 | 55 | #define UART0_ACTIVE 1 56 | #define UART1_ACTIVE 1 57 | #define UART2_ACTIVE 0 58 | #define UART3_ACTIVE 0 59 | #define UART4_ACTIVE 0 60 | #define UART5_ACTIVE 0 61 | 62 | #define UART0_DMA 1 63 | #define UART1_DMA 0 64 | #define UART2_DMA 0 65 | #define UART3_DMA 0 66 | #define UART4_DMA 0 67 | #define UART5_DMA 0 68 | 69 | #define UART_CONSOLE_PLO 1 70 | #define UART_CONSOLE_KERNEL 1 71 | #define UART_CONSOLE_USER 1 72 | 73 | #define GPIO_DIR_IN 0 74 | #define GPIO_DIR_OUT 1 75 | 76 | #define PSEUDODEV 1 77 | 78 | /* Interrupts */ 79 | 80 | #define TLB_IRQ 0 81 | #define INT_CTRL_BASE ((void *)0x80002000U) 82 | #define EXTENDED_IRQN 1 83 | 84 | /* Timers */ 85 | 86 | #define TIMER0_1_IRQ 9 87 | #define TIMER0_2_IRQ 10 88 | #define GPTIMER0_BASE ((void *)0x80003000U) 89 | #define GPTIMER1_BASE ((void *)0x80004000U) 90 | 91 | /* ADC */ 92 | 93 | #define ADC_CNT 0 94 | 95 | #define ADC0_ACTIVE 0 96 | #define ADC1_ACTIVE 0 97 | #define ADC2_ACTIVE 0 98 | #define ADC3_ACTIVE 0 99 | #define ADC4_ACTIVE 0 100 | #define ADC5_ACTIVE 0 101 | #define ADC6_ACTIVE 0 102 | #define ADC7_ACTIVE 0 103 | 104 | /* SPI */ 105 | 106 | #define SPI_CNT 1 107 | #define GRLIB_SPI_LOOPBACK 108 | 109 | /* GPIO */ 110 | 111 | #define GPIO_PORT_CNT 0 112 | 113 | /* SpaceWire */ 114 | 115 | #define SPW_CNT 0 116 | 117 | #define SPW0_ACTIVE 0 118 | #define SPW1_ACTIVE 0 119 | #define SPW2_ACTIVE 0 120 | #define SPW3_ACTIVE 0 121 | #define SPW4_ACTIVE 0 122 | #define SPW5_ACTIVE 0 123 | 124 | /* DMA */ 125 | 126 | #define DMA_MAX_CNT 1 127 | 128 | 129 | #endif 130 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/xmas-06.vt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (B)0  \|/  lwk lq lqk lqk k l 5 | --`-- xxx tq xlj xlj mwj 6 |  /|\  mj m mq jmq jmq j 7 | *** lqk k l lqk w lqk lwk lwk lqk lqk 8 | **f** x tqu xlj x mqk x xxx tqu mqk 9 | f*****f mqj j m jmq v mqj m mj m j m mqj 10 | **f***f** 11 | **********f ` ` 12 | **f***f***f** `   ` `   ` 13 | f*************f `       ` `       ` 14 | ******f***f******                     15 | f***f*********f***f lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk 16 | **f*******f*******f** mqqwqwqqqwqqqqqqqqqqqqqqqqqqqqqwqqqwqwqqj 17 | f*****f*********f*****f x x x x qqqqqqqqqOqqqqqqqqq x x x x 18 | ****f*****f***f*****f**** x x x tqqqqqqqqqqqqqqqqqqqqqu x x x 19 | f*f*****f*********f*****f*f x x x x     x x x x 20 | ******f*****f***f*****f****** x x O x  a a  a   x O x x 21 | f***f*****f****f****f*****f***f x x O x a  aaaa aa a  a x O x x 22 | **f***f***f***f***f***f***f***f** x x x x aaa aaaaaaaaaa aa x x x x 23 | f*****f*****f*********f*****f*****f x x x x lqqq qqqqqqqqqq qqk x x x x 24 | ****f*****f*****f***f*****f*****f**** x x x x xl qqqqqq u x x x x 25 | f**f****f*****f****f****f*****f****f**f mqvqqqj mv qqq qqqqqq qqq j mqqqvqj 26 | #6 MIS 27 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr712rc-board/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for sparcv8leon-gr712rc-board 5 | * 6 | * Copyright 2023 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #define SYSCLK_FREQ (48 * 1000 * 1000) /* MHz */ 18 | 19 | #define UART_MAX_CNT 6 20 | 21 | #define UART_BAUDRATE 115200 22 | 23 | #define UART0_BASE ((void *)0x80000100U) 24 | #define UART1_BASE ((void *)0x80100100U) 25 | #define UART2_BASE ((void *)0x80100200U) 26 | #define UART3_BASE ((void *)0x80100300U) 27 | #define UART4_BASE ((void *)0x80100400U) 28 | #define UART5_BASE ((void *)0x80100500U) 29 | 30 | #define UART0_IRQ 2 31 | #define UART1_IRQ 17 32 | #define UART2_IRQ 18 33 | #define UART3_IRQ 19 34 | #define UART4_IRQ 20 35 | #define UART5_IRQ 21 36 | 37 | #define UART0_TX 4 38 | #define UART0_RX 3 39 | 40 | #define UART1_TX 2 41 | #define UART1_RX 1 42 | 43 | #define UART2_TX 240 44 | #define UART2_RX 239 45 | 46 | #define UART3_TX 238 47 | #define UART3_RX 233 48 | 49 | #define UART4_TX 232 50 | #define UART4_RX 231 51 | 52 | #define UART5_TX 230 53 | #define UART5_RX 229 54 | 55 | #define UART0_ACTIVE 1 56 | #define UART1_ACTIVE 1 57 | #define UART2_ACTIVE 0 58 | #define UART3_ACTIVE 0 59 | #define UART4_ACTIVE 0 60 | #define UART5_ACTIVE 0 61 | 62 | #define UART0_DMA 0 63 | #define UART1_DMA 0 64 | #define UART2_DMA 0 65 | #define UART3_DMA 0 66 | #define UART4_DMA 0 67 | #define UART5_DMA 0 68 | 69 | #define UART_CONSOLE_PLO 0 70 | #define UART_CONSOLE_KERNEL 0 71 | #define UART_CONSOLE_USER 0 72 | 73 | #define GPIO_DIR_IN 0 74 | #define GPIO_DIR_OUT 1 75 | 76 | /* Interrupts */ 77 | 78 | #define INT_CTRL_BASE ((void *)0x80000200U) 79 | #define EXTENDED_IRQN 12 80 | 81 | /* Timers */ 82 | 83 | #define TIMER0_1_IRQ 8 84 | #define TIMER0_2_IRQ 9 85 | #define GPTIMER0_BASE ((void *)0x80000300U) 86 | #define GPTIMER1_BASE ((void *)0x80100600U) 87 | 88 | /* ADC */ 89 | 90 | #define ADC_CNT 0 91 | 92 | #define ADC0_ACTIVE 0 93 | #define ADC1_ACTIVE 0 94 | #define ADC2_ACTIVE 0 95 | #define ADC3_ACTIVE 0 96 | #define ADC4_ACTIVE 0 97 | #define ADC5_ACTIVE 0 98 | #define ADC6_ACTIVE 0 99 | #define ADC7_ACTIVE 0 100 | 101 | /* SPI */ 102 | 103 | #define SPI_CNT 1 104 | 105 | /* GPIO */ 106 | 107 | #define GPIO_PORT_CNT 2 108 | 109 | /* SpaceWire */ 110 | 111 | #define SPW_CNT 6 112 | 113 | #define SPW0_ACTIVE 1 114 | #define SPW1_ACTIVE 1 115 | #define SPW2_ACTIVE 0 116 | #define SPW3_ACTIVE 0 117 | #define SPW4_ACTIVE 0 118 | #define SPW5_ACTIVE 0 119 | 120 | /* SMP */ 121 | 122 | #define TLB_IRQ 14 123 | 124 | /* DMA */ 125 | 126 | #define DMA_MAX_CNT 0 127 | 128 | /* Flash */ 129 | 130 | #define ADDR_FLASH 0x00000000U 131 | 132 | #define FTMCTRL_BASE 0x80000000U 133 | 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /_projects/ia32-generic-qemu/rootfs-overlay/usr/share/cow/spinweb.vt: -------------------------------------------------------------------------------- 1 | [=2;7h*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_* * * * * * * * * * * * * * * * * *\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* * * * * * * * * * * *_* * * * * * */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*\*\*\*\*\*\*/*/*/*/*/*/*_*_*_*_*_*_*_*_*_*_*_*_*/*\*\*\*\*\*\*/*/*/*/*/*/\*_*_*_*_*_*_*_*_*_*_*/*\*\*\*\*\*/*/*/*/*/*_*_*_*_*_*_*_*_*_*_*/*\*\*\*\*\*/*/*/*/*/\*_*_*_*_*_*_*_*_*/*\*\*\*\*/*/*/*/*_*_*_*_*_*_*_*_*/*\*\*\*\*/*/*/*/\*_*_*_*_*_*_*/*\*\*\*/*/*/*_*_*_*_*_*_*/*\*\*\*/*/*/\*_*_*_*_*/*\*\*/*/*_*_*_*_*/*\*\*/*/\*_*_*/* */*/*_*_*\*_*\*_*\*_*\*_*\*_*_*|*|*|*|*|* whew !!!SPINWEB.VTby R L Samuellsamuell@cis.uab.eduApril 6, 1994 2 | -------------------------------------------------------------------------------- /_targets/riscv64/gr765/build.project: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Shell script for building riscv64-generic project 4 | # 5 | # Copyright 2018, 2019, 2020 Phoenix Systems 6 | # Author: Kaja Swat, Aleksander Kaminski, Pawel Pisarczyk, Lukasz Kosinski 7 | # 8 | [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 9 | 10 | . "_targets/build.common" 11 | 12 | CROSS=riscv64-phoenix- 13 | 14 | BUSYBOX_CONFIG=$(realpath "busybox_config") 15 | export BUSYBOX_CONFIG 16 | export DROPBEAR_CUSTOM_CFLAGS="-DLTC_NO_BSWAP" 17 | export PSH_DEFUSRPWDHASH="0B1ANiYi45IhxkfmUW155/GBd4IRE=" 18 | 19 | # 20 | # Ports configuration 21 | # 22 | export PORTS_BUSYBOX=n 23 | export PORTS_PCRE=n 24 | export PORTS_OPENSSL=n 25 | export PORTS_LIGHTTPD=n 26 | export PORTS_DROPBEAR=n 27 | export PORTS_LUA=n 28 | export PORTS_LZO=n 29 | export PORTS_OPENVPN=n 30 | export PORTS_JANSSON=n 31 | export PORTS_CURL=n 32 | export PORTS_COREMARK=n 33 | export PORTS_COREMARK_PRO=n 34 | 35 | 36 | # 37 | # Platform dependent parameters 38 | # 39 | export SIZE_PAGE=$((0x1000)) 40 | 41 | # 42 | # Project specific build 43 | # 44 | 45 | export BOOT_DEVICE="flash0" # Default boot device 46 | export MAGIC_USER_SCRIPT="dabaabad" # User script magic value 47 | 48 | 49 | b_build_project() { 50 | b_log "Building user applications" 51 | make -C "_user" all install 52 | } 53 | 54 | 55 | b_build_target() { 56 | b_log "Building $TARGET project" 57 | 58 | # FIXME: add dtc to docker images 59 | # dtc -I dts -O dtb -o "${PREFIX_BUILD}/${TARGET}.dtb" "${PROJECT_PATH}/${TARGET}.dts" 60 | 61 | b_log "Building phoenix-rtos-loader" 62 | 63 | image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo 64 | RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo 65 | make -C plo all 66 | 67 | b_log "Adding PLO to Phoenix SBI" 68 | 69 | make -C plo/riscv-sbi ram FDT_PATH="${PROJECT_PATH}/${TARGET}.dtb" \ 70 | PAYLOAD_PATH="${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" PAYLOAD_ADDR=0x10000 71 | 72 | make -C plo/riscv-sbi base FDT_PATH="${PROJECT_PATH}/${TARGET}.dtb" \ 73 | PAYLOAD_PATH="${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" PAYLOAD_ADDR=0x10000 74 | 75 | cp -a "${PREFIX_PROG_STRIPPED}sbi-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/sbi-${TARGET_SUBFAMILY}.img" 76 | cp -a "${PREFIX_PROG_STRIPPED}sbi-ram-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/sbi-ram-${TARGET_SUBFAMILY}.img" 77 | } 78 | 79 | 80 | b_image_target() { 81 | image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" 82 | 83 | #NOTE: putting SBI with embedded PLO in `plo` partition 84 | image_builder.py -v disk --nvm "$NVM_CONFIG" --part "plo=${PREFIX_PROG_STRIPPED}sbi-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" 85 | } 86 | 87 | 88 | b_test_target() { 89 | b_log "Build and install tests in the phoenix-rtos filesystem" 90 | make -C "phoenix-rtos-tests" all install 91 | } 92 | -------------------------------------------------------------------------------- /_projects/sparcv8leon-gr716-mini/board_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Phoenix-RTOS 3 | * 4 | * Board config for sparcv8leon-gr716-mini 5 | * 6 | * Copyright 2022 Phoenix Systems 7 | * Author: Lukasz Leczkowski 8 | * 9 | * This file is part of Phoenix-RTOS. 10 | * 11 | * %LICENSE% 12 | */ 13 | 14 | #ifndef _BOARD_CONFIG_H_ 15 | #define _BOARD_CONFIG_H_ 16 | 17 | #define SYSCLK_FREQ (50 * 1000 * 1000) /* MHz */ 18 | 19 | #define UART_MAX_CNT 6 20 | 21 | #define UART_BAUDRATE 115200 22 | 23 | #define UART0_BASE ((void *)0x80300000U) 24 | #define UART1_BASE ((void *)0x80301000U) 25 | #define UART2_BASE ((void *)0x80302000U) 26 | #define UART3_BASE ((void *)0x80303000U) 27 | #define UART4_BASE ((void *)0x80304000U) 28 | #define UART5_BASE ((void *)0x80305000U) 29 | 30 | #define UART0_IRQ 24 31 | #define UART1_IRQ 25 32 | #define UART2_IRQ 3 33 | #define UART3_IRQ 5 34 | #define UART4_IRQ 6 35 | #define UART5_IRQ 7 36 | 37 | #define UART0_TX 2 38 | #define UART0_RX 3 39 | 40 | #define UART1_TX 4 41 | #define UART1_RX 5 42 | 43 | #define UART2_TX 58 44 | #define UART2_RX 59 45 | 46 | #define UART3_TX 62 47 | #define UART3_RX 61 48 | 49 | #define UART4_TX 38 50 | #define UART4_RX 39 51 | 52 | #define UART5_TX 43 53 | #define UART5_RX 44 54 | 55 | #define UART0_ACTIVE 0 56 | #define UART1_ACTIVE 0 57 | #define UART2_ACTIVE 1 58 | #define UART3_ACTIVE 1 59 | #define UART4_ACTIVE 0 60 | #define UART5_ACTIVE 0 61 | 62 | #define UART0_DMA 0 63 | #define UART1_DMA 0 64 | #define UART2_DMA 0 65 | #define UART3_DMA 0 66 | #define UART4_DMA 0 67 | #define UART5_DMA 0 68 | 69 | #define UART_CONSOLE_PLO 2 70 | #define UART_CONSOLE_KERNEL 2 71 | #define UART_CONSOLE_USER 2 72 | 73 | #define GPIO_DIR_IN 0 74 | #define GPIO_DIR_OUT 1 75 | 76 | #define PSEUDODEV 1 77 | 78 | /* Interrupts */ 79 | 80 | #define TLB_IRQ 0 81 | #define INT_CTRL_BASE ((void *)0x80002000U) 82 | #define EXTENDED_IRQN 1 83 | 84 | /* Timers */ 85 | 86 | #define TIMER0_1_IRQ 9 87 | #define TIMER0_2_IRQ 10 88 | #define GPTIMER0_BASE ((void *)0x80003000U) 89 | #define GPTIMER1_BASE ((void *)0x80004000U) 90 | 91 | 92 | /* ADC */ 93 | 94 | #define ADC_CNT 8 95 | 96 | #define ADC0_ACTIVE 1 97 | #define ADC1_ACTIVE 0 98 | #define ADC2_ACTIVE 0 99 | #define ADC3_ACTIVE 0 100 | #define ADC4_ACTIVE 0 101 | #define ADC5_ACTIVE 0 102 | #define ADC6_ACTIVE 0 103 | #define ADC7_ACTIVE 0 104 | 105 | /* SPI */ 106 | 107 | #define SPI_CNT 2 108 | 109 | /* GPIO */ 110 | 111 | #define GPIO_PORT_CNT 2 112 | 113 | /* SpaceWire */ 114 | 115 | #define SPW_CNT 1 116 | 117 | #define SPW0_ACTIVE 0 118 | #define SPW1_ACTIVE 0 119 | #define SPW2_ACTIVE 0 120 | #define SPW3_ACTIVE 0 121 | #define SPW4_ACTIVE 0 122 | #define SPW5_ACTIVE 0 123 | 124 | /* DMA */ 125 | 126 | #define DMA_MAX_CNT 0 127 | 128 | 129 | /* Flash */ 130 | 131 | #define FLASH_CNT 1 132 | 133 | #define SPIMCTRL0_BASE ((void *)0xfff00100U) 134 | #define FLASH0_ADDR 0x02000000U 135 | 136 | #endif 137 | --------------------------------------------------------------------------------