xous-core/tools
bunnie ae8fe799bc add a fuzzer for basis lock/unlocking
this commits a script that will repeatedly rerun the `btest`
which creates several Bases, fills them with pseudorandom datat,
and goes through a lock/unlock cycle.

should be run with the disk size set to 4MiB for maximum stress
testing (the larger disk won't trigger an FSCB refill because its
hard to run out free space on the larger disk size)
2022-07-04 17:53:29 +08:00
..
pddb-images make sure the directory is not deleted 2022-03-28 04:09:57 +08:00
src tools: elf: don't get raw_data for no_copy sections 2022-06-10 16:52:57 +08:00
wycheproof-import fix #174 2022-06-10 21:36:53 +08:00
Cargo.toml fix #174 2022-06-10 21:36:53 +08:00
csr_data_0.9.5.bin add functionality to override the CSR data in case it is corrupted 2022-03-19 16:56:03 +08:00
csr_data_0.9.6.bin add functionality to override the CSR data in case it is corrupted 2022-03-19 16:56:03 +08:00
csr_data_0.9.7.bin add functionality to override the CSR data in case it is corrupted 2022-03-19 16:56:03 +08:00
factory_reset.ps1 fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
factory_reset.sh fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
kbd_layout.py add a script to help extract keyboard mappings for unknown keyboards 2022-05-17 16:39:48 +08:00
pddbci-btest.py add a fuzzer for basis lock/unlocking 2022-07-04 17:53:29 +08:00
pddbci.py commit some improvements to the CI framework 2022-03-31 00:28:49 +08:00
pddbdbg.py fix edge case in --dump mode for pddbdb.py 2022-07-04 17:52:59 +08:00
pddbdbg_v1.py add the old version of pddbg for debugging v1.x databases 2022-04-19 04:49:40 +08:00
README.md
README_UPDATE.md update the updater readme 2022-06-29 13:20:52 +08:00
rfc8452.py speed up the analysis tool so it's a bit more practical to use in CI 2022-01-01 14:14:09 +08:00
sign_image.py self-signing working, but the patch to use the SHA hash engine seems to be disregarded... 2021-08-09 03:27:43 +08:00
trng_test.py tighten up the hard-coded locations for the trng test 2021-10-31 02:58:43 +08:00
update_ci.ps1 fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
update_ci.sh fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
update_release.ps1 fix update scripts so updates don't wipe root keys :-O 2022-04-20 17:15:46 +08:00
upload_audiotest.sh Switch to using env to find the path to bash. 2022-03-28 16:43:47 -06:00
usb_update.py add a note for STAGING area as well 2022-04-22 02:48:52 +08:00
usb_update_xous_0.8.py make the filename more obvious for the purpose of the legacy update script 2021-09-07 19:00:34 +08:00
zadig.png update docs for usb updater 2021-06-02 04:04:04 +08:00

Xous Tools

This repository contains build tools for Xous, used to package up the kernel and initial program images and create something that the runtime can use.

It contains a number of programs:

  • copy-object: A reimplementation of objcopy
  • create-image: Tool used to create a boot args struct for Xous
  • make-tags: Test program used to create raw boot arg tags
  • read-tags: Test program to verify the tags were created

Building

To build this repository, you will need Rust.

  1. Build the tools: cargo build --release

Using

The two most useful tools are copy-object and create-image.

To use copy-object, simply run target/release/copy-object and specify the elf file you would like to copy.

To create a tags file with create-image, you will need to specify the path to the kernel, as well as any initial programs you would like to run. You will also need to specify the memory range, or pass a csr.csv file as an argument.

For example:

$ target/release/create-image \
      --kernel ../kernel/target/riscv32i-unknown-none-elf/debug/xous-kernel \
      --csv ../betrusted-soc/test/csr.csv \
      --init ../shell/target/riscv32i-unknown-none-elf/debug/xpr \
      args.bin
Arguments: Xous Arguments with 4 parameters
   Main RAM "SrEx" (78457253): 40000000 - 41000000
   Additional regions:
        Audi (69647541): e0000000 - e0001000
        CSRs (73525343): f0000000 - f000c000
        Disp (70736944): b0000000 - b0006000
        SpFl (6c467053): 20000000 - 28000000
        SrIn (6e497253): 10000000 - 10020000
        VexD (44786556): efff0000 - efff1000
   kernel: 75200 bytes long, loaded from 000000c4 to 00200000 with entrypoint @ 00200004, and 5624 bytes of data @ 00280000
   init: 31464 bytes long, loaded from 00012684 to 20000000 with entrypoint @ 20000004 and 0 bytes of data @ 10000000
   Bflg: -no_copy -absolute +DEBUG

Runtime will require 36916 bytes to track memory allocations
Image created in file ../tools/args.bin
$

You can then verify this file is correct by running read-tags on it:

$ cargo run --bin read-tags -- args.bin
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `target/debug/read-tags args.bin`
Found Xous Args Size at offset 8, setting total_words to 208
67724158 (XArg) (20 bytes, crc: 48b0): 00000034 00000001 40000000 01000000 78457253
7845524d (MREx) (96 bytes, crc: 671a): e0000000 00001000 69647541 00000000 f0000000 0000c000 73525343 00000000 b0000000 00006000 70736944 00000000 20000000 08000000 6c467053 00000000 10000000 00020000 6e497253 00000000 efff0000 00001000 44786556 00000000
6e724b58 (XKrn) (24 bytes, crc: 14e2): 000000c4 000125c0 00200000 00280000 000015f8 00200004
74696e49 (Init) (24 bytes, crc: 9da0): 00012684 00007ae8 20000000 10000000 00000000 20000004
676c6642 (Bflg) (4 bytes, crc: 8e32): 00000004
$

Testing

TBD

Contribution Guidelines

Contributor Covenant

Please see CONTRIBUTING for details on how to make a contribution.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide its terms.

License

Copyright © 2020

Licensed under the Apache License 2.0 LICENSE