add some comments and an assert to check consistency

This commit is contained in:
bunnie 2024-01-05 16:47:31 +08:00
parent 61686007c7
commit 10154b8372

View file

@ -226,6 +226,11 @@ impl<'a> RootKeys {
4096, // map just the backup block
xous::MemoryFlags::R,
).expect("couldn't map in the kernel region");
// This is a good assumption, but calling it out here -- we're mapping a region that is assumed to
// match HEADER_TOTAL_SIZE, but part of the reason we hard code the number is because KERNEL_BACKUP_OFFSET
// is in the xous crate (maybe it shouldn't be?) and is hard-coded to 4096 (0x1000), so for now we have
// this assert to catch a consistency problem in assumptions down the road.
assert!(HEADER_TOTAL_SIZE == 4096);
// determine the ostensible length of the kernel from an unprotected length hint. This is
// later verified to match the signed version that is contained within the block that is mapped
// in this address.