README introduces the project and build workflow; CONTRIBUTING covers the stub convention and syscall wrapper process; docs/ explains the architecture and the kernel ABI surface. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
2.8 KiB
2.8 KiB
Contributing to nulsl-libc
Thank you for helping Null Linux get a libc that fits in /dev/null.
Ground rules
- C17, and only C17. No GNU-isms in the language you write (inline
asm stays in the arch files where it belongs). The build forces
-std=c17 -ffreestanding -fno-builtin; make sure your code compiles clean under-Wall -Wextra -Wshadow -Wpointer-arith. - Stay lean. Null Linux runs a GUI in 32 MB. If a change adds RAM per process, it needs a better justification than convenience.
- AI drafts, humans ship. AI-generated code is welcome as a draft, but it must be reviewed, understood, and improved by a human before it lands. If you cannot explain every line, do not open the PR.
- The kernel is the API. Prefer a raw syscall wrapper over
inventing library machinery.
syscall()is the only ABI surface — keep it that way (see docs/syscalls.md).
Structure
include/— public headers. Declarations only; thestruct nulsl_filelayout and friends stay private insrc/internal.h.src/— implementations. One file per header/domain; keep files small (a#includeshort of 250 lines is a good ceiling).src/crt/crt0.S— the entry point. Kept out oflibc.aon purpose.tests/— anything you add must be exercised (make check).benchmarks/— anything performance-relevant needs a benchmark (make bench); if it isn't memory-lean, it doesn't ship.
The stub convention
Not implemented yet? It still needs its standard signature in the public
header, a documented error return, errno = ENOSYS, and a /* TODO */
comment naming what it needs. That is a feature, not a placeholder: every
stub fails loudly instead of silently misbehaving.
Adding a syscall wrapper
- Number in
include/sys/syscall.h(guarded, ABI in comment). - Declaration in the right public header.
- Thin wrapper in the right
src/file — onesyscall()call, nothing else. If it needs to be a stub, follow the stub convention. - Update
docs/syscalls.md(the table). - Extend a test in
tests/.
Workflow
./autogen.sh
make release && make check && make bench
make debug # for actual debugging (bin/debug/, -O0 -g)
- Style:
clang-format -ion your diff (see.clang-format); keep diffs formatted, small, and single-purpose. - LSP:
make compile_commands(needsbear) for clangd. - Verify:
make checkmust pass; runmake benchbefore and after to show you did not make anything slower. - Commits: small, atomic, descriptive. This project is written by humans and reviewed by humans; keep the history reviewable.
- PRs: one idea per PR, with tests. If the change is a stub → real transition, say which roadmap item it completes.
Communication
Open an issue or a PR on https://git.spectoria.dev/The-Null-Linux-Project/nulsl-libc.