Commit graph

10340 commits

Author SHA1 Message Date
Sean Cross
37cbf2b598 utralib: don't unconditionally regenerate files
Generate files in-memory (which is a cheap operation) and only write the
file to disk if it is different from the existing file.

This prevents rebuilds in the following circumstances:

1. When changing utralibs, an extra rebuild is always generated due to
   the file being updated mid-build. This will no longer happen.
2. When switching targets, there will no longer be an unconditional
   rebuild. This is because the feature flags are mixed in with the
   package hash, and different builds use different feature flags.
3. When one svd file is updated, other variants of that feature flag are
   no longer rebuilt. For example, when updating the Renode SVD,
   Precursor DVT1 will not need to be rebuilt, since that has not
   changed.

Changing a given SVD file will cause that target's version of utralib to
be rebuilt, and only that target's version.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 15:03:38 +08:00
Sean Cross
5624dedfef Merge branch 'main' of github.com:betrusted-io/xous-core into rename-args.bin 2022-10-20 14:21:02 +08:00
Sean Cross
f326d9be07
Merge pull request #248 from betrusted-io/loader-bss-fix
Fix loader when bss ends on a page boundary (and is less than 4096 bytes)
2022-10-20 14:20:30 +08:00
Sean Cross
ff3f307a14 tools: read-tags: call output xous_presign.img
The use of the name `args.bin` is now deprecated.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 14:11:48 +08:00
Sean Cross
13078509e9 xtask: rename args.bin -> xous_presign.img
The `args.bin` file served only to be copied to `xous_presign.img`. Skip
this step and directly generate a file called `xous_presign.img`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 14:10:52 +08:00
bunnie
47a6305264 reduce flush to instruction + fence
remove the nops because maybe the bug is fixed in this core version
2022-10-20 13:45:08 +08:00
Sean Cross
b35d65c3e1 loader: skip zeroing when we hit a page boundary
Previously, we would unconditionally zero out the remainder of a page
when finished copying. We wrapped to PAGE_SIZE in order to avoid
corrupting another process' memory.

However, an issue was discovered under the following circumstances:

    1. There are fewer than 4096 bytes of `.bss`
    2. The `.bss` ends on a page boundary

Under these conditions, the loader would load the section before the
`.bss` into the page, then clear out the `.bss`, and finally clear the
entire page, overwriting the previous section.

Skip the remainder-of-page clearout when the `.bss` ends on a page
boundary, rather than clearing the entire page.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 11:27:48 +08:00
Sean Cross
af501c4303 loader: print process IDs as debug data
Print out the current process ID when looping through values. This will
make it easier to identify which process is getting loaded when reading
through the tea leaves.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 11:27:48 +08:00
bunnie
820f2d6180 ...and commit the artifacts referenced in the previous commit :P 2022-10-20 04:59:17 +08:00
bunnie
dcbf028c5c bump soc rev
minor rev to fix a dangling git reference
2022-10-20 04:58:48 +08:00
bunnie
00eb09eb48 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-10-20 04:46:41 +08:00
bunnie
56471a99e4 bump default ref to newest soc ver for svd hw 2022-10-20 04:24:46 +08:00
bunnie
77e1379fc0 add SoC with new Vex core
updated codebase, hopefully pulls in fixes for cache clear
2022-10-20 04:24:00 +08:00
bunnie
9c4a39066d rollback the cache clear instruction in the asm entry
this causes instability when present with the older vex core.
2022-10-20 04:20:59 +08:00
bunnie
320097a29d toggle out core assembly when soft flush is used 2022-10-20 04:20:03 +08:00
Tom Marble
8d810dcc51
Adds mtxcli commands using the PDDB (#246)
* Adds mtxcli commands using the PDDB

/get key -- shows value of key (from the PDDB)
/set key value -- sets value of key (in the PDDB)
/unset key -- removes key (from the PDDB)
/status -- shows status of the connection

Updates .gitignore for PDDB in hosted mode
2022-10-19 12:50:00 -05:00
bunnie
7b0f30c318 add Charles' flush command + recommended nops
the Vex has a custom flush instruction, after contacting
charles he recommends maybe adding some nops to make sure it
completes (maybe hardware bug? unclear. we're about to find out.)
2022-10-19 23:42:43 +08:00
bunnie
c90bbb6276 make the extra buffer flush a feature, so we can experiment more easily 2022-10-19 23:42:19 +08:00
bunnie
4263bfd6b4 clean up the cache flushing, routine; don't use the custom vex instruction
suspect maybe the custom vex routine for cache flush has a subtle
issue, so fall back to first-principles read-region flush.

remove excess calls to flushing as well, turns out we effectively
duplicated the call because it was both in the core patch routine
and outside of it too.
2022-10-19 21:41:59 +08:00
bunnie
14384e31b4 revert debug/strip flags, this did not affect the outcome 2022-10-19 21:41:44 +08:00
bunnie
1df6865c7d
Merge pull request #247 from gsora/fix/macos-hosted-mode
fix: make hosted mode work on macos again
2022-10-19 21:10:48 +08:00
Gianguido Sorà
8eab76de33 fix: make hosted mode work on macos again
When ditherpunk flag is enabled, graphics-server cannot start.
I suspect macOS doesn't tranfer thread-local variables when a new one
is spawned, and this makes xous-names, logs crash.

This commit adds a compile setting that will bypass ditherpunk thread
settings on macOS as well, allowing developers who happen to run this OS
to develop and prototype for betrusted again.
2022-10-19 14:20:12 +02:00
bunnie
df17ed0f21
add debugging into builds
this will increase binary size but may help to trace down some instability issues we have seen crop up. probably root cause is something to do with loader init of bss, but other candidates include regression in rust 1.64 and possibly version/crate mismatch issues between api and service crates that were recently split.
2022-10-19 16:01:49 +08:00
bunnie
3e35fde660 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-10-19 04:48:44 +08:00
bunnie
0a361cac20 bump version to 0.0.8 to asborb factory reset change 2022-10-19 04:47:55 +08:00
bunnie
76ed23010d erase staged gateware as part of --factory-reset 2022-10-19 04:44:04 +08:00
bunnie
ad22383642
Merge pull request #245 from betrusted-io/mtxcli
meant to merge it oops
2022-10-19 02:40:12 +08:00
Tom Marble
90bcd989f7
Reverts quit operation 2022-10-18 13:31:31 -05:00
Tom Marble
a6021bb0a1
Remove empty DefaultApp struct 2022-10-18 12:44:51 -05:00
bunnie
e9b1e25ca4
Update main.rs
This is how I'd do the app switch. It's a special case going to the shellchat. shellchat is aliased to `INITIAL_APP_FOCUS`, so you can refer to that constant directly in this call, instead of using a more generic app-lookup mechanism. 

Also, because the idea is that we can allow *anyone* to call this method, there are no authorization tokens to check, unlike the SwitchToApp call, which can allow arbitrary apps to be foregrounded.

The security assumption is that "no harm" can be done if a malicious process can bring shellchat to the foreground. This might not be a good assumption, but, I can't think of a scenario where this helps someone trying to get control of a device.
2022-10-19 01:38:58 +08:00
bunnie
371d058941
Update lib.rs
use a scalar message, instead of a null-body memory message
2022-10-19 01:29:27 +08:00
Tom Marble
cf02c3c3b6
Adds GAM DefaultApp opcode
NOTE: action on DefaultApp is not yet implemented: this
should allow the GAM to choose which application is safe
as a default (for other applications to "quit" by switching to it).
Proposed default application is "shellchat".

Updates mtxcli commands
- removes audio command
- adds help and quit commands
2022-10-18 11:54:27 -05:00
bunnie
74fe8c989c add dvt target
resurrecting some old hardware as an efuse testing target;
new hardware is too precious at the moment given the ridiculous
shortage of FPGAs on the market.
2022-10-18 21:47:16 +08:00
Gianguido Sorà
75e3ed603d prefsgenerator: don't generate mutable methods
no need to!
2022-10-18 11:54:18 +02:00
Gianguido Sorà
bc2cdd739b userprefs: allow dead code on UserPrefs struct
Remove lock-related variables, not needed anymore, also added autobacklight timeout
2022-10-18 11:52:48 +02:00
Gianguido Sorà
59c4fbd5e9 status: preference-based backlight timeout
Also rename some variables for clarity.
2022-10-18 11:52:04 +02:00
Gianguido Sorà
412b8bdd5e status: enable/disable autobacklight on boot, depending on prefs 2022-10-18 11:51:31 +02:00
Gianguido Sorà
2a8ac69120 status: proper format specifier for prefs errors 2022-10-18 11:50:11 +02:00
Gianguido Sorà
d9c706a40e status: store wlan networks in .System basis 2022-10-18 11:44:41 +02:00
bunnie
8e05925cfa somehow the transition to local paths got missed in the merge 2022-10-18 00:39:01 +08:00
bunnie
557d74a33f bump cargo lock 2022-10-18 00:29:51 +08:00
bunnie
0584ad2f2c switch to local paths to see if this helps the build 2022-10-18 00:26:56 +08:00
bunnie
12dc1e6b70 more patches for local build 2022-10-17 23:34:47 +08:00
bunnie
74f96260ed normalize test crate path 2022-10-17 23:00:56 +08:00
bunnie
579bd61166 tighten up path filtering so that kernel-test is included 2022-10-17 22:57:27 +08:00
bunnie
e2fcc42d99 normalize version numbers 2022-10-17 22:47:04 +08:00
bunnie
0d09162722 fix whitespace transformation issues 2022-10-17 22:46:46 +08:00
bunnie
cd305a44b5 add commands to swap between local and remote builds 2022-10-17 18:58:38 +08:00
bunnie
11eadf8ea8 change from dictionary to list-based for patching script
this guarantees that publication happens in order.
2022-10-17 17:35:22 +08:00
bunnie
fc14af1de1 fix an out of date crate ref 2022-10-17 16:24:39 +08:00