- Python 45.6%
- Rust 24.6%
- C 19.8%
- Assembly 10%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| docs | ||
| include/erix/cstd | ||
| runtime | ||
| scripts | ||
| src | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| .markdownlint-cli2.yaml | ||
| ARCHITECTURE.md | ||
| Cargo.toml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| ROADMAP.md | ||
| rustfmt.toml | ||
| SECURITY.md | ||
EriX C Byte and String Runtime
See the original initialized-thread runtime contract for explicit original thread images, C accessors, producer selection and lifetime obligations.
lib-cstd provides freestanding byte-memory and string operations for EriX:
memcpy, memmove, memset, memcmp, strlen, strcmp, strncmp,
memchr, strchr, strrchr, strcpy, strncpy, strcat, strncat,
strspn, strcspn, strpbrk and strnlen. A
dependency-free no_std Rust interface and
partial C headers use
one explicitly selected assembler companion.
See ARCHITECTURE for pointer and link contracts, ROADMAP for validation and integration status, and the design issue for scope.
Purpose of This Repository
The canonical x86_64 SysV ELF bodies are memory, string queries and string writers, together with byte-set queries. Rust declarations use namespaced symbols; the selected object policy can also provide conventional C aliases. Link exactly one companion object. A Cargo rlib alone contains declarations, and omitting the companion must fail to link a call.
The partial C interfaces are memory.h and
string.h. They do not provide complete standard
complete libc headers, startup, allocation or POSIX service routing. Separate
initialized-thread declarations and partial errno headers require the explicit
thread companion and an admitted original EriX thread image. Callers own
valid memory ranges. String queries read initialized bytes, with NUL/count
termination and returned-pointer obligations documented in each Rust
declaration. String writers require nonoverlapping ranges and caller-owned
capacity; strncpy pads to its count, while strncat appends one NUL without
padding. Neither count validates the destination size.
strnlen reads through the first NUL or its maximum count; a full bounded array
need not contain a terminator. The returned length grants no memory access.
The byte-set queries permit read-only overlap and exclude NUL from membership.
Each uses 32 bytes of ordinary stack scratch, with no red-zone dependence,
shared state or added CPU feature. Returned pointers retain source permissions.
To build a core-only object for host Rust tests, explicitly select the original
Integration process owner from commit
d68a95870076c3435b1a5ab36440d0941b5ab45e and installed LLVM tools. The output
parent must exist and the selected output directory must be fresh:
ERIX_PROCESS_OWNER=/absolute/pinned/integration/scripts/cargo_source_metadata.py
mkdir -p out
python3 -IB scripts/build-c-runtime.py \
--source "$PWD" --output "$PWD/out/core" --policy core \
--target x86_64-unknown-none --assembler /usr/bin/llvm-mc \
--archiver /usr/bin/llvm-ar --process-owner "$ERIX_PROCESS_OWNER" \
--hard-seconds 60 --stall-seconds 30 --log-bytes 4194304 \
--input-bytes 536870912
CARGO_ENCODED_RUSTFLAGS="$(printf '%s\037%s' '-Dwarnings' \
"-Clink-arg=$PWD/out/core/erix-c-memory.o")" cargo test --offline
Use --policy public for a conventional C or mixed C/Rust final link, and
--policy hidden for native shared-object ownership. The
validation driver accepts explicit compiler,
sysroot, header-resource and inspection-tool paths and exercises the complete
host/freestanding matrix. Its --help describes the finite command budgets.
No tool is discovered by the producer, and its child environment is scoped.
Clean-Room Policy
All implementation and fixtures are original EriX work. The four memory bodies retain the preceding Integration instructions; the validation driver extracts that exact historical literal without executing its generator. The string queries and writers are original scalar implementations derived from their contracts. No third-party implementation or host libc supplies an acceptance function.
License
All EriX-authored source is licensed under the ISC License.
Development Model
Security, reliability and performance are prioritized in that order. Keep unsafe pointer obligations explicit, deny missing Rust documentation and retain failure evidence. Tests execute the selected object and independent byte oracles; failed, missing or warningful evidence is not acceptance.
Governance Principles
Use the canonical contribution and security policies. Component documentation specializes the shared meta formats; shared governance files stay unchanged.
Policy Boundaries
This repository owns the byte/string implementation and its explicit link contract. Integration owns native image assembly and later selected-source migration. Neither numeric pointers nor a successful host test grant guest memory authority or establish a self-hosted build.
Native Rust consumers can enable memory-intrinsics to link the four canonical
memory primitives through the rlib. Select one memory provider at the final
link. String calls still need their companion; accessed ranges remain the
caller's responsibility. See Architecture for the boundary.
Contact
Development takes place in the EriX organization. Use the design issue for reviewable scope and the repository security policy for sensitive findings.