diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-18 03:00:42 +0000 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-18 03:00:42 +0000 |
commit | 62c2199871975942247758d57a65ca384fa67832 (patch) | |
tree | d1611b81a6c550a2fce25ce519ea1afd9d368b70 | |
parent | 8f14e904b04cc695be87d0496099292446b8eca6 (diff) |
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 <ian@osmora.org>
-rw-r--r-- | sys/include/sys/disk.h | 24 |
1 files 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 @@ -97,18 +97,30 @@ 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; }; /* |