Portable NVMe controller/namespace driver core with a small OS-dependency layer (“osdeps”).
This repository ships the core and a standalone osdeps contract so you can drop it into your OS/kernel/runtime with minimal glue.
.
├── include/
│ ├── nvme.h
│ ├── nvme_hw.h
│ └── nvme_osdeps.h
├── src/
│ └── nvme.c
└── osdeps/
├── standalone/
│ └── nvme_osdeps_impl.h
└── lykos/
└── nvme_osdeps_impl.h
- A C compiler (GCC/Clang)
- Meson + Ninja for building the library
The default build targets the standalone osdeps contract and does not require any external kernel headers.
This produces libnvme.a and installs headers under nvme/.
meson setup build -Dosdeps=standalone
ninja -C buildThe standalone osdeps header (osdeps/standalone/nvme_osdeps_impl.h) declares the minimal platform surface the driver expects.
You must provide implementations for (see the header for the authoritative list):
nvme_log(int level, const char *fmt, ...)
panic(const char *fmt, ...) (noreturn)vm_alloc(size_t)
heap_alloc(size_t), heap_free(void*)
spinlock_acquire(spinlock_t*), spinlock_release(spinlock_t*)
arch_lcpu_relax(void)mmio_map(uintptr_t phys, size_t size)
dma_alloc(size_t) -> dma_buf_t { vaddr, paddr, size }
dma_free(dma_buf_t*)The current driver integrates with a simple drive_t structure (see standalone osdeps header) and expects:
drive_create(int type)
drive_mount(drive_t*)