Commit graph

559 commits

Author SHA1 Message Date
bunnie
213a011051 apply a clean patch of the changes required to fix ci 2026-05-06 08:45:15 +08:00
Sylvain Bellemare
fa14fa78c6
feat(xtask): add --config flag for cargo config
Problem: there is no way to pass extra cargo config
(e.g. vendored sources) through xtask to the
underlying cargo invocations.

Solution: accept --config flags in cargo xtask and
thread them through all internal cargo invocations.
The cargo() helper now returns a Command with the
config flags already applied.
2026-03-18 11:06:04 +09:00
bunnie
9be2cbf99e remove baobit commit command line argument
the baobit commit will be injected at final file packaging time
2026-02-16 18:07:01 +08:00
Sylvain Bellemare
3ea92d3bad
Add --baobit-commit flag for build provenance
Adds BAOBIT_COMMIT constant to boot0/boot1 version.rs, allowing
the Guix build channel commit to be embedded in firmware for
reproducibility verification.

- Add --baobit-commit CLI flag to xtask
- Generate BAOBIT_COMMIT in boot version files
- Display in audit command output
- Simplify versioning.rs to always write files
2026-02-16 08:24:55 +09:00
Sylvain Bellemare
a052cafb8f
Add --git-describe and --git-rev CLI args
Enable reproducible builds without git state by accepting
version info as CLI arguments:

- --git-describe: version string for signing (e.g., v0.10.0-19-g0d934e1)
- --git-rev: commit hash for swap nonce (last 16 hex chars used)

Renames xtask --gitrev to --git-describe for clarity.
2026-02-13 03:44:37 +09:00
bunnie
32f9ae1631 add --gitrev argument to xtask
this allows build systems that lack git state to build an image.
The effective git revision must be correctly computed by the build
system or substituted for everything to work correctly.

Note that completely faking the entry will lead to subtle problems
down the road; for example, a purpose of the revision is to check
which versions are compatible for upgrades against each other
(some upgrade paths require a hop through an older version). Faking
this can bypass the mechanism and then lead to instability down
the road.

However, some build systems (such as guix) strip out the git state,
but the revision can be safely generated in the calling environment
and passed as a variable.
2026-02-09 15:08:55 +08:00
bunnie
791068e073 fix regression in app location in dabao build script
apps were accidentally getting stuck in the kernel

very confusing

much strange

wow
2026-01-31 15:36:22 +08:00
bunnie
9a008730f6 add the ability to specify regions for apps; eliminate default apps
Default apps for base xous configs are now eliminated - this
allows third party builds to add their apps without having to
delete the default apps used for initial testing (the upshot is
that the CI scripts elsewhere are now all modified to include the
apps I'm using to test the system; which is fine).

So now, `dabao` and `baosec` build what is a baseline set of
services that I think are expected in either platform. In the case
of dabao, apps get stuck in the detached-app area; in the case of baosec,
apps are stick in swap.

So:

`cargo xtask baosec bao-console vault2`

by default sticks the app `bao-console` and `vault2` into swap.
If you want one of these programs to go into RRAM instead, you would
specify the build like this:

`cargo xtask baosec bao-console~flash vault2`

The `~<region>` syntax indicates that the thing to the left of `~`
is the name of the app; and to the right is a region spec, one of:
[swap, flash, ram].

No checking is done that these regions are valid or even good
for placing these things, the image just tries its best to whack 'em
in there. If you blow out the size of the kernel, at least, a
warning will be emitted.

This change enables more flexible out-of-tree options for
developers who don't want to build the whole Xous kernel, but
at the moment, caveat hacker - things are still in flux and under
heavy development. I think in about 2-3 months things will settle
down enough that we'll cut a release and then the APIs should be
cleaner/more stable, but for now anyone developing with a pre-release
dabao board is recommended to either build kernel from scratch or
at least fetch the latest CI image off of the CI server if things
seem squirrelly.
2026-01-31 02:08:45 +08:00
bunnie
0e4f82cb02 cleanup some hard-coded constants 2026-01-30 04:00:40 +08:00
bunnie
b37d58fd59 add baosec-lite targets
baosec-lite strategy is to use the OEM board type, and then diff
off of the baosec target.

The assumption is that if you're building for a baosec-lite target,
you're committing to re-doing the bootloader from the stock bootloader
and pivoting into a full-custom baosec-lite build.

This assumption allows us to "hard code" more of the baosec-lite
differences, instead of having to leave other board options available
for a more portable firmware.
2026-01-24 23:06:14 +08:00
bunnie
284e639453 adjust xtask default features
- dabao now includes debug-proc by default
- gdb-stub now passes to both kernel and user programs, so that
uart switching can be achieved
- print-panics activated in the kernel, so we can see the panic
messages. They had disappeared for a while, and didn't notice.
2026-01-14 03:10:17 +08:00
bunnie
8d8f3f4243 re-enable usb responder in hosted mode 2025-12-24 13:13:50 +08:00
bunnie
bfdea56dff add provisional baosec-lite target
what does it take to fit baosec without swap....
2025-12-22 16:15:34 +08:00
bunnie
5cd165fe8e fix doc comments & safety on std::env manipulation 2025-12-15 18:00:40 +08:00
bunnie
6080667deb
move console into swap
we've run out of space in the main image, so this gives us
some breathing room.
2025-12-06 18:21:14 +08:00
bunnie
7631ad9e20 move bao-video to XIP flash
we've got the space - might as well.

there's about 300k of space left in the xous image after this
modification. This is starting to cut it close, so this is
the last item that makes it into the "fixed" xous image.
2025-11-28 18:43:08 +08:00
bunnie
f502270b60 remove force-dabao default for altboot1 2025-11-22 13:43:20 +08:00
bunnie
4f2d1215bc add deliberately misordered keystore config
for validating keystore hw protection
2025-11-21 00:58:05 +08:00
bunnie
22fce8bae0 add hosted mode target for bao1x 2025-11-17 17:33:04 +08:00
bunnie
22cfaafce4 add force-dabao to alt-boot1 image generation
at least for now, with dabao being the only board in the field,
this makes sense.
2025-11-13 22:18:37 +08:00
bunnie
c44c63a72b add vault2 to the app list default 2025-11-12 15:27:26 +08:00
bunnie
8c421c6050
Merge branch 'main' into vault2 2025-11-11 08:47:10 +08:00
bunnie
82649e683e align hosted environment to current baosec environment
adds a dummy UUID
2025-11-08 04:21:12 +08:00
bunnie
fe136ff820
Merge branch 'main' into vault2 2025-11-02 10:40:47 +08:00
bunnie
26078dcc7d add keystore to dabao configuration
After some contemplation, we should include the keystore in the
core service set featured by the dabao-xous configuration.

The pros are: any compatibility/sharing of resources
that require access to RRAM, one-way counters, UUIDs, etc.
will either require a wholly separate implementation that is
"insecure" or it could just reuse the baosec work. Furthermore,
as cryptographic accelerators are laid into the keystore,
the APIs become available to the dabao environment

The cons are: more space is used in a space-constrained
dabao environment (roughly 140k "deadweight" at the start, but
as cryptographic APIs get layered in this can grow substantially);
the key slots are "used up" in part by the scheme, which leaves
less key slots available for user-defined purposes.

This is mitigated by the fact that there are a couple thousand
key slots, and so even though we use a couple hundred of them
it's still not the whole range.

Also, the baosec/dabao feature flag can be used to feature-out
cryptographic APIs/accelerators that are too obscure or not
useful for the dabao environment, to "lighten up" the
firmware load.
2025-11-01 22:59:07 +08:00
bunnie
0bcd861d9c add app deduplication code
this ensures that a given app is not included more than once

significantly, this allows for an app to be in the default list
and also selectable from the menu and you don't end up with
two copies of it in the binary.
2025-11-01 14:19:58 +08:00
bunnie
dd144b9446 fix feature tree for dabao build
"usb" is now default for dabao-console, should not be passed
as a universal feature to all apps as not all apps have that
feature
2025-10-31 12:13:54 +08:00
bunnie
770c986e72 make dabao-console a default app for the dabao target 2025-10-31 11:17:50 +08:00
bunnie
8b5f27daae change baremetal commands to require a board spec 2025-10-31 09:45:53 +08:00
bunnie
9336bdab6a
Merge branch 'main' into vault2 2025-10-28 23:15:41 +08:00
bunnie
bb801a16ed update docs 2025-10-28 21:40:37 +08:00
bunnie
90c46c65c3
add altboot support to bao1x targets
specify cargo xtask baot1x-alt-boot1 and dragging this UF2
file onto the disk boots into an alternat boot1 loader that
allows updating of boot1.
2025-10-28 21:38:44 +08:00
bunnie
b769e4ada9 don't include any apps by default in dabao image
this allows the environment to specify it fully
2025-10-27 17:32:47 +08:00
bunnie
6a548de693
Merge branch 'main' into vault2 2025-10-27 00:02:26 +08:00
bunnie
012f6f5141 make USB a default feature in dabao builds 2025-10-26 22:56:13 +08:00
bunnie
857c5875fe move the keystore to the appointed slot for access to secure regions 2025-10-24 21:13:18 +08:00
bunnie
8d067e6819 Merge branch 'main' into vault2 2025-10-06 01:23:21 +08:00
bunnie
fd6077a64d add dabao target with detached apps
cargo xtask dabao

will now generate a Xous image that targets dabao

it features 'detached apps' so that user applications can
be rapidly developed without nuking the kernel itelf each time.

the current configuration bakes the console into the app section,
but maybe that's a questionable decision.
2025-10-05 17:10:27 +08:00
bunnie
0437a1263b remove deprecated loader features 2025-10-01 23:38:05 +08:00
bunnie
625e61cbe6 add alternate baremetal naming for consistent target prefixes 2025-10-01 00:42:42 +08:00
bunnie
9336100965 add placeholder for debugging 2025-09-29 22:19:08 +08:00
bunnie
3928240081 re-org of boot sequence to 'draft final' sequence
boot0, boot1 targets added to xtask, image creation setup
to relocate the start points of each image to these locations.
2025-09-29 13:27:11 +08:00
bunnie
5b51da3ec0 add boot0 in help for xtask 2025-09-25 16:13:53 +08:00
bunnie
945ef16e37
Merge branch 'main' into bl0 2025-09-25 14:48:34 +08:00
Nathan Perry
fee06f0a32
xtask: exit after printing help
Causes the xtask build to print an error and exit if it doesn't
recognize the task argument. Just ran into this as a result of the
cramsoc -> bao1x rename in 1255bf1 -- the build wasn't recognizing
`baremetal-cramsoc` anymore but was proceeding with the compile anyway,
without setting the target or loader features.
2025-09-24 21:28:51 -04:00
bunnie
bd7ca4fa32 add signature header to boot/baremetal regions
also make the link.x file update based on changes to that region's
length.
2025-09-24 23:59:12 +08:00
bunnie
c117d8020e add targets for boot0 2025-09-24 01:04:31 +08:00
bunnie
19ebb5196c update xtask to handle new autostatics method 2025-09-21 21:52:10 +08:00
bunnie
f2fe921ff1 fixup bao1x-sim target 2025-09-20 22:10:48 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00