⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

compute_kernel_hash

Function compute_kernel_hash 

Source
pub fn compute_kernel_hash() -> Result<[u8; 32], KernelError>
Expand description

Compute a SHA-256 hash of the kernel image in memory.

Uses the __kernel_end linker symbol (defined in all three architecture linker scripts) to determine the extent of the kernel image. The start address is derived from the architecture-specific load address.

If linker symbols are not available, falls back to hashing the first 64 KiB of the kernel text section.