os_abi_sentinel 0.1.0

Dependency-free, no_std-first ABI contract utilities for Rust OS development: compile-time layout/offset assertions and minimal ABI versioning.
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented7 out of 10 items with examples
  • Size
  • Source code size: 34.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.8 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • alisio85/os_abi_sentinel
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • alisio85

os_abi_sentinel

os_abi_sentinel is a dependency-free, no_std-first crate for Rust OS development (edition 2024) focused on one thing: keeping your ABI contracts correct across boundaries.

It provides:

  • Compile-time ABI assertions: type size, alignment, and field offsets
  • Minimal ABI versioning: tiny, dependency-free version types and compatibility checks

Relationship with your other crates

This crate is intentionally independent and complements your other crates by covering a different concern:

  • os_metal_primitives: hardware-facing primitives (MMIO, bitfields, IRQ, etc.)
  • os_dev_toolkit: diagnostics/logging/developer tooling
  • os_kernel_foundry: higher-level kernel scaffolding

os_abi_sentinel focuses on the stability of data layouts and compatibility rules at component boundaries.

Quick example: enforce a boot info ABI

use os_abi_sentinel::{const_assert_align, const_assert_offset, const_assert_size};

#[repr(C)]
pub struct BootInfo {
    pub magic: u32,
    pub version: u32,
    pub mem_map_ptr: u64,
    pub mem_map_len: u32,
    pub _reserved: u32,
}

const_assert_size!(BootInfo, 24);
const_assert_align!(BootInfo, 8);
const_assert_offset!(BootInfo, mem_map_ptr, 8);
const_assert_offset!(BootInfo, mem_map_len, 16);

Documentation

  • API docs: build locally with cargo doc --open
  • Project docs: see the docs/ directory, starting from docs/MANUAL.md

License

MIT. See LICENSE.

Attribution

This crate was created by an AI assistant based on an idea and requirements by alisio85. See NOTICE.md.