aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / kernel / dev / disk_layout.h
| 1 | /* SPDX-License-Identifier: Apache-2.0 |
| 2 | * Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* disk_layout.h -- how the AIENOS C kernel stages share the boot NVMe disk. |
| 18 | * |
| 19 | * Everything below is INSIDE the AIENOS GPT partition (dev/disk_part.h): unit |
| 20 | * numbers are relative to the partition's first LBA and every access goes |
| 21 | * through the bounds-checked translation layer ck_part_xlate. The rest of the |
| 22 | * disk (protective MBR, primary and backup GPT, other partitions) is only |
| 23 | * ever read (GPT parse), never written. |
| 24 | * |
| 25 | * unit 0..3 sealed-Store anti-rollback anchor (torn_slot, 4 units) |
| 26 | * unit 4..U-2 Store v1 region (store_sealed / ADR 0015) |
| 27 | * unit U-1 scratch unit for the NVMe write/flush/read-back probe |
| 28 | * A unit is 4096 bytes (8 blocks of 512 or 1 block of 4096); U = whole units |
| 29 | * in the AIENOS partition. The probe only ever writes the partition's last unit. */ |
| 30 | #ifndef AIENOS_CK_DISK_LAYOUT_H |
| 31 | #define AIENOS_CK_DISK_LAYOUT_H |
| 32 | #include <stdint.h> |
| 33 | #define CK_LAYOUT_UNIT 4096u |
| 34 | #define CK_LAYOUT_ANCHOR_UNITS 4u |
| 35 | #define CK_LAYOUT_PROBE_UNITS 1u |
| 36 | #define CK_LAYOUT_MIN_STORE_UNITS 64u |
| 37 | #endif |