diff --git a/RELEASE-v0.9.md b/RELEASE-v0.9.md index 76fb24c7e..c3cf78c12 100644 --- a/RELEASE-v0.9.md +++ b/RELEASE-v0.9.md @@ -371,6 +371,10 @@ perform the Xous firmware upgrade. This requires running manual update commands, - @xobs has added the feature `--gdb-stub` to the build. When selected, the kernel is built with GDB support over serial port. This works well in Renode. To try it in hardware, one must first run `console app` inside `shellchat` to activate the GDB UART (otherwise the sole serial port is connected to the console log). - @xobs added graphical panic output to the kernel. This is different from a guru meditation in that it only happens when the kernel itself panics. - Pulled in `ebreak` fix for VexRiscv CPU +- In `vault`, deleting a password and saving the record with the blank password triggers a password generation dialog box (useful for re-doing passwords) +- Add USB serial support + - console logs can now be viewed via USB serial with the shellchat command `usb console` (`usb noconsole` to turn off). You will need a terminal client that is capable of CRLF translations. + - TRNG can be set to emit raw binary data over USB serial with `usb trng` (`usb notrng` to turn off). This should be compatible with existing methods to extract randomness from USB dongles such as the OneRNG (looking for an existing HW RNG dongle user to test and confirm compatibility with their existing system!). ## Roadmap - Lots of testing and bug fixes diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 94b64987b..be8d107a5 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -411,7 +411,7 @@ pub extern "C" fn trap_handler( ex ); #[cfg(any(feature = "precursor", feature = "renode"))] - panic!( + println!( "{}: CPU Exception on PID {}: {}", if is_kernel_failure { "!!! KERNEL FAILURE !!!" diff --git a/kernel/src/debug/gdb.rs b/kernel/src/debug/gdb.rs index 55fd0e2ca..1c0bf89c7 100644 --- a/kernel/src/debug/gdb.rs +++ b/kernel/src/debug/gdb.rs @@ -295,7 +295,7 @@ pub fn report_stop(_pid: xous_kernel::PID, tid: xous_kernel::TID, _pc: usize) { }; } -pub fn report_terminated(_pid: xous_kernel::PID) { +pub fn report_terminated(pid: xous_kernel::PID) { let Some(XousDebugState { mut target, server: gdb, @@ -306,7 +306,6 @@ pub fn report_terminated(_pid: xous_kernel::PID) { let new_gdb = match gdb { GdbStubStateMachine::Running(inner) => { - println!("Reporting a STOP"); match inner.report_stop( &mut target, MultiThreadStopReason::Signal(Signal::EXC_BAD_ACCESS), @@ -326,9 +325,9 @@ pub fn report_terminated(_pid: xous_kernel::PID) { println!("GDB state was in Disconnect, which shouldn't be possible!"); return; } - GdbStubStateMachine::Idle(_inner) => { - println!("GDB state was in Idle, which shouldn't be possible!"); - return; + GdbStubStateMachine::Idle(inner) => { + println!("Please connect a debugger to debug process {}", pid); + GdbStubStateMachine::Idle(inner) } }; diff --git a/services/aes/src/vex/aes128.rs b/services/aes/src/vex/aes128.rs index aa9c88b81..1ef8f7c2d 100644 --- a/services/aes/src/vex/aes128.rs +++ b/services/aes/src/vex/aes128.rs @@ -21,7 +21,7 @@ fn set_encrypt_key_inner_128(user_key: &[u8], swap_final: bool) -> VexKeys128 { ^ (TE2[(temp >> 16) & 0xff] & 0xff000000) ^ (TE3[(temp >> 8) & 0xff] & 0x00ff0000) ^ (TE0[(temp) & 0xff] & 0x0000ff00) - ^ (TE1[(temp >> 24)] & 0x000000ff) + ^ (TE1[temp >> 24] & 0x000000ff) ^ rcon; rk[5 + rk_offset] = rk[1 + rk_offset] ^ rk[4 + rk_offset]; rk[6 + rk_offset] = rk[2 + rk_offset] ^ rk[5 + rk_offset]; @@ -68,19 +68,19 @@ pub fn aes128_dec_key_schedule(user_key: &[u8]) -> VexKeys128 { /* apply the inverse MixColumn transform to all round keys but the first and the last: */ let mut rk_offset = 4; for _ in 1..rounds { - rk[0 + rk_offset] = TD0[TE1[(rk[0 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[0 + rk_offset] = TD0[TE1[rk[0 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[0 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[0 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[0 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[1 + rk_offset] = TD0[TE1[(rk[1 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[1 + rk_offset] = TD0[TE1[rk[1 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[1 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[1 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[1 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[2 + rk_offset] = TD0[TE1[(rk[2 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[2 + rk_offset] = TD0[TE1[rk[2 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[2 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[2 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[2 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[3 + rk_offset] = TD0[TE1[(rk[3 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[3 + rk_offset] = TD0[TE1[rk[3 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[3 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[3 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[3 + rk_offset] as usize) & 0xff] as usize & 0xff]; diff --git a/services/aes/src/vex/aes256.rs b/services/aes/src/vex/aes256.rs index 7738edf32..30ad61d0b 100644 --- a/services/aes/src/vex/aes256.rs +++ b/services/aes/src/vex/aes256.rs @@ -26,7 +26,7 @@ fn set_encrypt_key_inner_256(user_key: &[u8], swap_final: bool) -> VexKeys256 { ^ (TE2[(temp >> 16) & 0xff] & 0xff000000) ^ (TE3[(temp >> 8) & 0xff] & 0x00ff0000) ^ (TE0[(temp) & 0xff] & 0x0000ff00) - ^ (TE1[(temp >> 24)] & 0x000000ff) + ^ (TE1[temp >> 24] & 0x000000ff) ^ rcon; rk[9 + rk_offset] = rk[1 + rk_offset] ^ rk[8 + rk_offset]; rk[10 + rk_offset] = rk[2 + rk_offset] ^ rk[9 + rk_offset]; @@ -39,7 +39,7 @@ fn set_encrypt_key_inner_256(user_key: &[u8], swap_final: bool) -> VexKeys256 { let temp = rk[11 + rk_offset] as usize; rk[12 + rk_offset] = rk[4 + rk_offset] - ^ (TE2[(temp >> 24)] & 0xff000000) + ^ (TE2[temp >> 24] & 0xff000000) ^ (TE3[(temp >> 16) & 0xff] & 0x00ff0000) ^ (TE0[(temp >> 8) & 0xff] & 0x0000ff00) ^ (TE1[(temp) & 0xff] & 0x000000ff); @@ -90,19 +90,19 @@ pub fn aes256_dec_key_schedule(user_key: &[u8]) -> VexKeys256 { /* apply the inverse MixColumn transform to all round keys but the first and the last: */ let mut rk_offset = 4; for _ in 1..rounds { - rk[0 + rk_offset] = TD0[TE1[(rk[0 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[0 + rk_offset] = TD0[TE1[rk[0 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[0 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[0 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[0 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[1 + rk_offset] = TD0[TE1[(rk[1 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[1 + rk_offset] = TD0[TE1[rk[1 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[1 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[1 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[1 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[2 + rk_offset] = TD0[TE1[(rk[2 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[2 + rk_offset] = TD0[TE1[rk[2 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[2 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[2 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[2 + rk_offset] as usize) & 0xff] as usize & 0xff]; - rk[3 + rk_offset] = TD0[TE1[(rk[3 + rk_offset] as usize >> 24)] as usize & 0xff] + rk[3 + rk_offset] = TD0[TE1[rk[3 + rk_offset] as usize >> 24] as usize & 0xff] ^ TD1[TE1[(rk[3 + rk_offset] as usize >> 16) & 0xff] as usize & 0xff] ^ TD2[TE1[(rk[3 + rk_offset] as usize >> 8) & 0xff] as usize & 0xff] ^ TD3[TE1[(rk[3 + rk_offset] as usize) & 0xff] as usize & 0xff]; diff --git a/services/codec/src/main.rs b/services/codec/src/main.rs index 545e845ac..50f8e3e27 100644 --- a/services/codec/src/main.rs +++ b/services/codec/src/main.rs @@ -20,7 +20,17 @@ struct ScalarCallback { cb_to_client_id: u32, } -fn main() -> ! { +fn main () -> ! { + let stack_size = 256 * 1024; + std::thread::Builder::new() + .stack_size(stack_size) + .spawn(wrapped_main) + .unwrap() + .join() + .unwrap() +} + +fn wrapped_main() -> ! { log_server::init_wait().unwrap(); log::set_max_level(log::LevelFilter::Info); info!("my PID is {}", xous::process::id()); diff --git a/services/keyboard/Cargo.toml b/services/keyboard/Cargo.toml index d6f377067..136e6768a 100644 --- a/services/keyboard/Cargo.toml +++ b/services/keyboard/Cargo.toml @@ -34,4 +34,4 @@ debuginject = [] # used only if you want direct key injection via serial or USB. rawserial = [] braille = [] inject-api = [] # used by the serial feature in usb -default = ["debuginject", "inject-api"] # "debugprint" +default = ["debuginject"] # "debugprint" diff --git a/services/usb-device-xous/Cargo.toml b/services/usb-device-xous/Cargo.toml index d7314fccc..daea13cea 100644 --- a/services/usb-device-xous/Cargo.toml +++ b/services/usb-device-xous/Cargo.toml @@ -19,7 +19,7 @@ num-traits = {version = "0.2.14", default-features = false} rkyv = {version = "0.4.3", default-features = false, features = ["const_generics"]} susres = {package = "xous-api-susres", version = "0.9.36"} modals = {path = "../modals"} -keyboard = {path = "../keyboard", feature="inject-api"} +keyboard = {path = "../keyboard", features=["inject-api"]} bitfield = "0.13.2" vcell = "0.1.3" xous-semver = "0.1.2"