Instruction file imported from CloudCarpentry/Bharat-OS (
.github/instructions/kernel.instructions.md). Copyright stays with the author.
Bharat-OS Kernel and Low-Level Instructions
- Read root
AGENTS.mdand the nearest scopedAGENTS.mdbefore editing. - Keep kernel code mechanism-only and verification-friendly.
- New public functions/types use
bh_*; public constants/macros/enums useBH_*. - Document ownership, lock ordering, memory ordering, lifecycle states, and cross-core protocol invariants.
- Do not pass pointers or native-width layout-dependent fields through IPC/uRPC/wire structures.
- Use fixed-width versioned messages and static layout assertions.
- Do not hold locks while waiting for remote completion.
- Use monotonic HAL time and bounded retries; implement replay/idempotence where retries occur.
- Consider MMU, MMU-Lite, and MPU backends for memory-protection changes.
- Add focused regression, negative, concurrency, and partial-failure tests.
- Run the mandatory architecture and QEMU gates from root
AGENTS.mdbefore completion.