From 62c2199871975942247758d57a65ca384fa67832 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 18 Aug 2025 03:00:42 +0000 Subject: kernel: disk: Improve tracking of disk information - Rename 'disk_meta' -> 'disk_root' - Add 'disk_info' structure - Add boot 'canary' value to 'disk_root' Signed-off-by: Ian Moffett --- sys/include/sys/disk.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/include/sys/disk.h b/sys/include/sys/disk.h index 852bb0f..a277797 100644 --- a/sys/include/sys/disk.h +++ b/sys/include/sys/disk.h @@ -96,19 +96,31 @@ typedef off_t blkoff_t; */ typedef uint8_t diskop_t; +/* + * Describes basic disk information + * + * @block_size: Hardware block size + * @vblock_size: Virtual block size + * @n_block: Number of blocks total + */ +struct disk_info { + uint32_t block_size; + uint32_t vblock_size; + size_t n_block; +}; + /* * The disk metadata structure contains information * describing the disk. It is used for Hyra's pbuf * (persistent buffers / sls) support. This structure * is to be stored at the very last sector of the drive. * - * @root_blk: Disk offset to root block - * @n_ublk: Number of usable user blocks + * @canary: Boot canary to verify persistent instance + * @info: Disk attributes */ -struct disk_meta { - char magic[6]; - blkoff_t root_blk; - size_t n_ublk; +struct disk_root { + uint32_t canary; + struct disk_info info; }; /* -- cgit v1.2.3