Xous SDK (pinned for betrusted transpilation)
Find a file
bunnie 67fc21fbdd harmonize hosted mode selection, but retain an explicit hosted flag
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.

However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
2022-10-25 17:21:02 +08:00
.cargo fixups to fix linux builds 2022-08-21 16:30:37 +08:00
.github/workflows bump minimum toolchain requirement 2022-08-05 16:28:42 +08:00
.vscode add the precursor feature flag to rust-analyzer 2022-10-02 03:00:28 +08:00
api harmonize hosted mode selection, but retain an explicit hosted flag 2022-10-25 17:21:02 +08:00
apps harmonize hosted mode selection, but retain an explicit hosted flag 2022-10-25 17:21:02 +08:00
devkey beginnings of image signing 2021-07-06 17:31:09 +08:00
docs Update flash.md 2022-07-09 15:37:50 +08:00
emulation renode: remove custom LiteX_Timer_32 2022-10-21 08:40:10 +08:00
imports flip back to using remote references 2022-10-20 16:30:06 +08:00
kernel flip back to using remote references 2022-10-20 16:30:06 +08:00
LICENSES
loader flip back to using remote references 2022-10-20 16:30:06 +08:00
locales bump xous-rs to absorb change in language specification 2022-10-10 03:07:44 +08:00
precursors move the precursor binary artifacts out of the package 2022-10-20 17:07:53 +08:00
services harmonize hosted mode selection, but retain an explicit hosted flag 2022-10-25 17:21:02 +08:00
svd2repl renode: remove custom LiteX_Timer_32 2022-10-21 08:40:10 +08:00
svd2utra switch to local paths to see if this helps the build 2022-10-18 00:26:56 +08:00
tools flip back to using remote references 2022-10-20 16:30:06 +08:00
utralib harmonize hosted mode selection, but retain an explicit hosted flag 2022-10-25 17:21:02 +08:00
xous-ipc flip back to using remote references 2022-10-20 16:30:06 +08:00
xous-rs xous-rs: use target_os and target_arch cfgs 2022-10-25 15:50:53 +08:00
xtask add a no-codec feature for DVT builds 2022-10-20 22:35:17 +08:00
.gitattributes
.gitignore Adds mtxcli commands using the PDDB (#246) 2022-10-19 12:50:00 -05:00
analyze-bloat.sh update analysis script to match new package names 2022-10-10 00:32:01 +08:00
API.md xous: remove xous::xous_main macro 2022-05-31 13:41:48 +08:00
Cargo.lock bump verification parameters 2022-10-20 17:23:24 +08:00
Cargo.toml add maintainer notes 2022-10-20 17:08:16 +08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md CONTRIBUTRING: Update license link 2022-04-24 21:48:43 +08:00
publish.py tighten up path filtering so that kernel-test is included 2022-10-17 22:57:27 +08:00
README.md Update README.md 2022-04-03 13:10:56 +08:00
RELEASE-v0.8.md clean up release notes 2021-09-05 20:46:23 +08:00
RELEASE-v0.9.md more release note updates 2022-10-20 17:36:02 +08:00
rustfmt.toml finalize formatting run 2021-08-20 00:26:16 +08:00

Xous Core

Core files for the Xous microkernel operating system.

You might find this wiki handy, as well as the Xous Book.

This repository contains everything necessary to build the Xous kernel from source. It consists of the following projects:

  • kernel: core memory manager, irq manager, and syscallhandler
  • loader: initial loader used to start the kernel
  • tools: programs used to construct a final boot image
  • docs: documentation on various aspects of Xous
  • emulation: Renode scripts used to emulate Xous
  • xous-rs: userspace library

Dependencies

  • Xous requires its own Rust target, riscv32imac-unknown-xous-elf. If you run cargo xtask from the command line, you should be prompted to install the target automatically if it does not already exist.
  • You may need to remove the target/ directory before building, if rustc continues to behave like it can't find the xous target even after it is installed.
  • If you plan on doing USB firmware updates, you'll need progressbar2 (updates) and pyusb (updates). Note that pyusb has name space conflicts with similarly named packages, so if updates aren't working you may need to create a venv or uninstall conflicting packages.
  • If you are doing development on the digital signatures with the Python helper scripts, you will need: pycryptodome (signing - PEM read), cryptography (signing - x509 read), pynacl (signing - ed25519 signatures) (most users won't need this).
  • Some system packages are needed, which can be installed with sudo apt install libssl-dev libxkbcommon-dev or similar
  • If you receive an error about feature resolver is required, try installing a newer version of rustc and cargo via rustup

Quickstart using Hosted Mode

You can try out Xous in a "hosted mode" wherein programs are compiled for your native platform and are run locally as processes within your current operating system. System calls are replaced with network calls to a kernel that simply shuffles messages around.

Xous uses the xtask convention, where various complex build commands are stored under cargo xtask. This allows for us to create arbitrarily complex build sequences without resorting to make (which is platform-dependent), sh (which requires a lot of external tooling), or another build system.

To build a set of sample programs and run them all using the kernel for communication, clone this repository and run:

cargo xtask run

This will build several servers and a "shell" program to control them all. Most notably, a graphics-server will appear and kernel messages will begin scrolling in your terminal.

Quickstart using an emulator

Xous uses Renode as the preferred emulator, because it is easy to extend the hardware peripherals without recompiling the entire emulator.

Download Renode and ensure it is in your path. For now, you need to download the nightly build, until DecodedOperation is included in the release.

Then, build Xous:

cargo xtask renode-image

This will compile everything in release mode for RISC-V, compile the tools require to package it all up, then create an image file.

Finally, run Renode and specify the xous-release.resc REnode SCript:

renode emulation/xous-release.resc

Renode will start emulation automatically, and will run the same set of programs as in "Hosted mode".

Generating a hardware image

To build for real hardware, you must specify an .svd file. This file is generated by the SoC build process and describes a single Betrusted core. These addresses will change as hardware is modified, so if you distribute a modified Betrusted core, you should be sure to distribute the .svd file.

We have included a reference version of the gateware and its SVD file in the precursors directory, so you can compile a gateware for the reference image using this command:

cargo xtask hw-image precursors/soc.svd

The resulting images are in your target directory (typically target/riscv32imac-unknown-xous-elf/release/) with the names xous.img (for the kernel) and loader.bin (for its bootloader). The corresponding gateware is in precursors/soc_csr.bin. These can be written to your device by following the update guide.