mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
reconfigure toml files for pddb target testing
OK, i think this gets us to the starting point of shaving down the PDDB crate from the restored baseline
This commit is contained in:
parent
8e52d4ca5d
commit
22433fa25c
3 changed files with 78 additions and 13 deletions
|
|
@ -13,7 +13,7 @@ xous-ipc = "0.10.4"
|
||||||
log-server = { package = "xous-api-log", version = "0.1.63" }
|
log-server = { package = "xous-api-log", version = "0.1.63" }
|
||||||
ticktimer-server = { package = "xous-api-ticktimer", version = "0.9.63" }
|
ticktimer-server = { package = "xous-api-ticktimer", version = "0.9.63" }
|
||||||
xous-names = { package = "xous-api-names", version = "0.9.65" }
|
xous-names = { package = "xous-api-names", version = "0.9.65" }
|
||||||
susres = { package = "xous-api-susres", version = "0.9.63" }
|
susres = { package = "xous-api-susres", version = "0.9.63", optional = true }
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
num-derive = { version = "0.4.2", default-features = false }
|
num-derive = { version = "0.4.2", default-features = false }
|
||||||
num-traits = { version = "0.2.14", default-features = false }
|
num-traits = { version = "0.2.14", default-features = false }
|
||||||
|
|
@ -21,10 +21,10 @@ rkyv = { version = "0.8.8", default-features = false, features = [
|
||||||
"std",
|
"std",
|
||||||
"alloc",
|
"alloc",
|
||||||
] }
|
] }
|
||||||
trng = { path = "../trng" }
|
trng = { path = "../trng", optional = true }
|
||||||
spinor = { path = "../spinor" }
|
spinor = { path = "../spinor", optional = true }
|
||||||
aes = { path = "../aes" }
|
aes = { path = "../aes" }
|
||||||
root-keys = { path = "../root-keys" }
|
root-keys = { path = "../root-keys", optional = true }
|
||||||
cipher = "0.4.2"
|
cipher = "0.4.2"
|
||||||
bitfield = "0.13.2"
|
bitfield = "0.13.2"
|
||||||
aes-gcm-siv = { version = "0.11.1", default-features = false, features = [
|
aes-gcm-siv = { version = "0.11.1", default-features = false, features = [
|
||||||
|
|
@ -32,9 +32,9 @@ aes-gcm-siv = { version = "0.11.1", default-features = false, features = [
|
||||||
"aes",
|
"aes",
|
||||||
] }
|
] }
|
||||||
# aes-gcm-siv = {git="https://github.com/RustCrypto/AEADs.git", branch="master"}
|
# aes-gcm-siv = {git="https://github.com/RustCrypto/AEADs.git", branch="master"}
|
||||||
llio = { path = "../llio" }
|
llio = { path = "../llio", optional = true }
|
||||||
subtle = { version = "2.4.1", default-features = false }
|
subtle = { version = "2.4.1", default-features = false }
|
||||||
tts-frontend = { path = "../tts" }
|
tts-frontend = { path = "../tts", optional = true }
|
||||||
rand_core = "0.6.4"
|
rand_core = "0.6.4"
|
||||||
|
|
||||||
# passwords
|
# passwords
|
||||||
|
|
@ -48,9 +48,9 @@ zeroize_derive = "1.4.2"
|
||||||
blowfish = { version = "0.9.1", features = ["bcrypt"] }
|
blowfish = { version = "0.9.1", features = ["bcrypt"] }
|
||||||
|
|
||||||
# UX (for password entry and notifications)
|
# UX (for password entry and notifications)
|
||||||
gam = { path = "../gam" }
|
gam = { path = "../gam", optional = true }
|
||||||
locales = { path = "../../locales" }
|
locales = { path = "../../locales", optional = true }
|
||||||
modals = { path = "../modals" }
|
modals = { path = "../modals", optional = true }
|
||||||
|
|
||||||
utralib = { version = "0.1.25", optional = true, default-features = false }
|
utralib = { version = "0.1.25", optional = true, default-features = false }
|
||||||
|
|
||||||
|
|
@ -65,10 +65,34 @@ hex = { version = "0.4.3", default-features = false, features = [
|
||||||
"alloc",
|
"alloc",
|
||||||
], optional = true }
|
], optional = true }
|
||||||
|
|
||||||
|
# Gen-2 dependencies
|
||||||
|
keystore = { path = "../keystore", optional = true } # contains all key handlers
|
||||||
|
xous-swapper = { path = "../xous-swapper", optional = true } # contains spinor
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
precursor = ["utralib/precursor", "sha2/precursor"]
|
gen1 = [
|
||||||
hosted = ["utralib/hosted", "sha2/hosted"]
|
"susres",
|
||||||
renode = ["utralib/renode", "sha2/renode"]
|
"trng",
|
||||||
|
"spinor",
|
||||||
|
"root-keys",
|
||||||
|
"llio",
|
||||||
|
"tts-frontend",
|
||||||
|
"gam",
|
||||||
|
"locales",
|
||||||
|
"modals",
|
||||||
|
]
|
||||||
|
gen2 = ["keystore"]
|
||||||
|
# gen 1 targets
|
||||||
|
precursor = ["utralib/precursor", "sha2/precursor", "gen1"]
|
||||||
|
hosted = ["utralib/hosted", "sha2/hosted", "gen1"]
|
||||||
|
renode = ["utralib/renode", "sha2/renode", "gen1"]
|
||||||
|
|
||||||
|
# gen 2 targets
|
||||||
|
board-baosec = ["gen2", "xous-swapper/board-baosec"] # USB form factor token
|
||||||
|
hosted-baosec = ["gen2"] # emulated hardware on x86 platform
|
||||||
|
board-baosor = ["gen2", "xous-swapper/board-baosor"] # Precursor form factor
|
||||||
|
# board-dabao is not a valid target as it lacks external SPI flash
|
||||||
|
|
||||||
# when selected, physical disk addresses are set to 64 bits, otherwise, they are 32 bits.
|
# when selected, physical disk addresses are set to 64 bits, otherwise, they are 32 bits.
|
||||||
# 32 bit addressing is recommended for Precursor, as its disk is only 128MiB and it has limited RAM for bookkeeping.
|
# 32 bit addressing is recommended for Precursor, as its disk is only 128MiB and it has limited RAM for bookkeeping.
|
||||||
u64_pa = []
|
u64_pa = []
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,45 @@ extern crate bitfield;
|
||||||
/// ```
|
/// ```
|
||||||
// historical note: 389 hours, 11 mins elapsed since the start of the PDDB coding, and the first attempt at a
|
// historical note: 389 hours, 11 mins elapsed since the start of the PDDB coding, and the first attempt at a
|
||||||
// hardware test -- as evidenced by the uptime of the hardware validation unit.
|
// hardware test -- as evidenced by the uptime of the hardware validation unit.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Gen2 porting notes:
|
||||||
|
|
||||||
|
Todo list:
|
||||||
|
-[ ] Rewrite xous-swapper/swap layer to understand virtual pages mapped to SPI flash (see notes below)
|
||||||
|
-[ ] Rewrite pddb to use 'keystore' server instead of rootkeys/modals/ux integrations.
|
||||||
|
|
||||||
|
Xous-swapper refactor notes:
|
||||||
|
|
||||||
|
SPINOR shares the same interface as the swap SRAM, and therefore, the Spinor interface
|
||||||
|
has to live inside xous-swapper.
|
||||||
|
|
||||||
|
Xous also needs to be extended to implement Virtual Addresses that are not backed by
|
||||||
|
physical addresses, but are on-demand allocated by copying SPINOR contents into pages that
|
||||||
|
are allocated in SRAM. The general idea is something like this:
|
||||||
|
- A new flag is added that can be passed to xous::MapMemory(). This flag is the `Swapped` flag,
|
||||||
|
and it indicates to the kernel that the physical address should be `null` and marked as `swapped`
|
||||||
|
for the mapping in its initial page table map in the given process.
|
||||||
|
- A "special" range of virtual addresses needs to be carved out which is where the memory-mapped
|
||||||
|
FLASH memory would go to. Thus, a process would gain access to FLASH by simply calling MapMemory
|
||||||
|
with the FLASH memory VA range as the virtual address, `None` as the PA, and the Swapped flag
|
||||||
|
as one of the args in Memory Arguments
|
||||||
|
- When the virtual address is referenced, it will page fault; the page fault handler will pass
|
||||||
|
this to Xous-Swapper in the userspace, which will then add a check for the virtual address.
|
||||||
|
If the virtual address is in the magic range for SPINOR, the contents are fetched using the
|
||||||
|
SPINOR interface based on the linear mapping of the lower bits of the address onto the SPINOR
|
||||||
|
memory space.
|
||||||
|
- WHnever a write happens inside Xous-Swapper to a location in FLASH, the page table entry for
|
||||||
|
the mapped FLASH location needs to be marked as invalid and returned to the free pool. This
|
||||||
|
uses the swap system to keep the read-view of FLASH in sync with hte write-view. This also
|
||||||
|
means that Xous-Swapper's SPINOR map has to keep a scoreboard of what pages are mapped to
|
||||||
|
what processes, so that we can search for the mapping and clear it whenever a write comes in.
|
||||||
|
- Development of this can probably happen separately from the emu-layer version. The basic thing
|
||||||
|
would be to drill down into the kernel with the kernel and a simple test server that just
|
||||||
|
tries to map the SPINOR and read some contents out, and perhaps update a sector. This will
|
||||||
|
exercise the path in isolation and allow us to test this routine as a separate primitive
|
||||||
|
from the PDDB.
|
||||||
|
*/
|
||||||
extern crate bitflags;
|
extern crate bitflags;
|
||||||
|
|
||||||
mod api;
|
mod api;
|
||||||
|
|
|
||||||
|
|
@ -607,13 +607,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// - [planned] pddb server
|
// - [planned] pddb server
|
||||||
// - [planned] vault application
|
// - [planned] vault application
|
||||||
let bao_rram_pkgs = ["xous-ticktimer", "xous-log", "xous-names" /* "usb-cramium" */].to_vec(); /* "usb-cramium" */
|
let bao_rram_pkgs = ["xous-ticktimer", "xous-log", "xous-names" /* "usb-cramium" */].to_vec(); /* "usb-cramium" */
|
||||||
let bao_swap_pkgs = ["cram-hal-service", "bao-console", "bao-video", "modals", "pddb"].to_vec(); /* "bao-video" */
|
let bao_swap_pkgs =
|
||||||
|
["cram-hal-service", "bao-console", "bao-video", "modals" /* "pddb" */].to_vec(); /* "bao-video" */
|
||||||
if !builder.is_swap_set() {
|
if !builder.is_swap_set() {
|
||||||
builder.set_swap(0, 8 * 1024 * 1024);
|
builder.set_swap(0, 8 * 1024 * 1024);
|
||||||
}
|
}
|
||||||
builder.add_loader_feature("swap");
|
builder.add_loader_feature("swap");
|
||||||
builder.add_kernel_feature("swap");
|
builder.add_kernel_feature("swap");
|
||||||
builder.add_feature("swap");
|
builder.add_feature("swap");
|
||||||
|
builder.add_feature("spinor"); // required for PDDB builds - affects xous-swapper
|
||||||
|
|
||||||
builder.add_loader_feature("debug-print");
|
builder.add_loader_feature("debug-print");
|
||||||
// the following feature needs to be uncommented if we also enable
|
// the following feature needs to be uncommented if we also enable
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue