From c4a55a3cb5f6e7f12e9f136f7f5a354cb0fcb78c Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 21 Feb 2023 18:19:12 +0800 Subject: [PATCH] fix multiplatform details; bump version number printed --- loader/src/main.rs | 7 +++++-- loader/src/secboot.rs | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/loader/src/main.rs b/loader/src/main.rs index 5cecbc964..8dbf9adc3 100644 --- a/loader/src/main.rs +++ b/loader/src/main.rs @@ -30,6 +30,8 @@ const KERNEL_STACK_PAGE_COUNT: usize = 1; const KERNEL_ARGUMENT_OFFSET: usize = 0xffc0_0000; const GUARD_MEMORY_BYTES: usize = 2 * PAGE_SIZE; +pub const SIGBLOCK_SIZE: usize = 0x1000; + const FLG_VALID: usize = 0x1; const FLG_X: usize = 0x8; const FLG_W: usize = 0x4; @@ -57,8 +59,6 @@ mod debug; mod fonts; #[cfg(feature="secboot")] mod secboot; -#[cfg(feature="secboot")] -use secboot::SIGBLOCK_SIZE; // Install a panic handler when not running tests. #[cfg(not(test))] @@ -1550,6 +1550,7 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! { ); } } else { + #[cfg(feature="resume")] unsafe { let backup_args: *mut [u32; 7] = BACKUP_ARGS_ADDR as *mut[u32; 7]; #[cfg(feature="debug-print")] @@ -1581,6 +1582,8 @@ fn boot_sequence(args: KernelArguments, _signature: u32) -> ! { clean, ); } + #[cfg(not(feature="resume"))] + panic!("Unreachable code executed"); } } #[cfg(feature="resume")] diff --git a/loader/src/secboot.rs b/loader/src/secboot.rs index 667b601cc..daa38d2c9 100644 --- a/loader/src/secboot.rs +++ b/loader/src/secboot.rs @@ -1,13 +1,14 @@ use crate::println; -pub const SIGBLOCK_SIZE: usize = 0x1000; +use crate::SIGBLOCK_SIZE; -const VERSION_STR: &'static str = "Xous OS Loader v0.9.4\n\r"; +const VERSION_STR: &'static str = "Xous OS Loader v0.9.5\n\r"; // v0.9.0 -- initial version // v0.9.1 -- booting with hw acceleration, and "simplest signature" check on the entire xous.img blob // v0.9.2 -- add version and length check between header and signed area // v0.9.3 -- add lockout of key ROM in die() routine // v0.9.4 -- monorepo conversion +// v0.9.5 -- multiplatform conversion pub const STACK_LEN: u32 = 8192 - (7 * 4); // 7 words for backup kernel args pub const STACK_TOP: u32 = 0x4100_0000 - STACK_LEN;