38cc34a6e949591b8b351d3ab0a55bf8132e20e5
elibc — Standard C Library for Elyz
Minimal C library for the Elyz OS, based on musl's organisational principles but adapted to Elyz's capability-based, syscall-less architecture.
Structure
elibc/
├── arch/ # Architecture-specific code
│ ├── generic/ # Fallback implementation & abstract interfaces
│ │ ├── kcall.h # Kernel-call abstraction (no syscalls in Elyz)
│ │ ├── startup_info.h # Process-startup description
│ │ └── bits/ # Type-size definitions
│ └── x86_64/ # x86_64 port
│ ├── kcall.h # Kernel-call placeholder (ABI TBD)
│ ├── startup_info.h # x86_64 startup layout (ABI TBD)
│ ├── atomic_arch.h # Locked cmpxchg / atomic ops
│ └── bits/
├── include/ # Public headers (POSIX-like API)
├── src/ # Source implementations
│ ├── internal/ # Libc state, errno, bump allocator (temporary)
│ ├── string/ # Pure-C string ops (memcpy, strlen, etc.)
│ ├── stdio/ # (reserved)
│ └── stdlib/ # atoi, etc.
├── crt/ # C runtime entry point
├── Makefile
└── configure
Key differences from a traditional libc (glibc/musl)
| Traditional (Linux) | Elyz / elibc |
|---|---|
syscall/int 0x80 |
Capability invocation → PM Actor messaging |
brk/sbrk |
ELYZ_OP_ALLOCATE via elyz_kcall |
_exit syscall |
ELYZ_OP_EXIT via kcall |
errno via TLS |
__errno_location (plain global for now) |
Porting to a new arch
- Create
arch/<name>/with:kcall.h— kernel-call mechanismstartup_info.h— process-startup layoutarch.mak— arch-specific compiler/linker flagsbits/alltypes.h.in— type sizesatomic_arch.h— atomic ops (optional, fallback exists)
- Add detection in
configure - Build:
./configure && make
Building
./configure
make
Description
Languages
C
93.3%
Makefile
6.7%