Xous SDK (pinned for betrusted transpilation)
Find a file
Sean Cross e3dbf1e9d4 emulation: ticktimer: add msleep support
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-04 13:41:18 +08:00
.cargo xtask: add cargo xtask command 2020-08-17 19:42:39 +08:00
docs ThreadID: rename from CtxID 2020-07-16 11:04:31 +08:00
emulation emulation: ticktimer: add msleep support 2020-11-04 13:41:18 +08:00
kernel kernel: allow making syscalls from an interrupt 2020-11-01 17:59:26 +08:00
loader unify debug.rs and move to UTRA format 2020-10-14 03:40:44 +08:00
macros macros: call xous::init() at init-time 2020-10-29 19:39:34 +08:00
services log-server: remove excess printing from log string 2020-11-01 16:30:07 +08:00
svd2utra update example soc.svd so CI doesn't break 2020-10-14 19:03:00 +08:00
tools create-image: support generating an image from an svd 2020-10-05 11:37:44 +08:00
utralib utralib: fix build dependency on svd file 2020-10-13 14:18:00 +08:00
xous-rs xous: add send() to String 2020-11-01 16:28:47 +08:00
xtask xtask: remove unused CsvFile option 2020-10-15 12:00:09 +08:00
.gitattributes initial commit 2020-03-10 12:13:05 +08:00
.gitignore gitignore: don't ignore utra anymore 2020-10-05 10:35:42 +08:00
buildpush.sh fix more UTRA issues; migrate to dual-UART for kernel/console messages 2020-10-13 05:22:19 +08:00
Cargo.lock cargo: commit latest lockfile 2020-10-30 21:28:33 +08:00
Cargo.toml refactor "examples" -> "services" 2020-10-14 02:04:21 +08:00
CODE_OF_CONDUCT.md initial commit 2020-03-10 12:13:05 +08:00
CONTRIBUTING.md initial commit 2020-03-10 12:13:05 +08:00
README.md README: rewrite to document xtask 2020-11-03 20:41:37 +08:00
start-gdb.sh add a helper script to boot kernel gdb session 2020-09-26 01:41:55 +08:00

Xous Core

Core files for the Xous microkernel operating system.

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

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. Then, build Xous:

rustup target add riscv32imac-unknown-none-elf
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.

An example file may be found under svd2utra/, but this is probably out of date and won't work with your device.

Pass this .svd file to the hw-image xtask command:

cargo xtask hw-image svd2utra/examples/soc.svd

This will compile all runtime packages for riscv32imac-unknown-none-elf, and will generate a release image under the target/ directory, which will be printed on the output.

The image should be written to location 0x2050_0000 (SPI ROM offset 0x50_0000), using the provision-xous.sh script inside betrusted-scripts running on a Betrusted provisioning harness, that is a Raspberry Pi 4 with the appropriate debug hat attached, and the Precursor hardware plugged into the debug hat. You can also check out the dvt-hardware branch for the WIP integration of all the above commands.