A portable implementation of the POSIX C standard library.
- Linux
- i386, x86_64, arm, aarch64, riscv64
- FreeBSD
- i386, x86_64, arm, aarch64, riscv64
- Darwin
- ppc, i386, x86_64, x86_64h, armv4t, armv5, armv6, armv7, armv7s, armv7k, arm64*, arm64e*, arm64_32*
- arm64 Darwin requires a patched kernel, as XNU doesn't allow static arm64 binaries by default
make release
make release OS=darwin
make release ARCH=arm
make tests
- Add some headers for your architecture to
include/machine
- Add a folder and an arch.mk to
platform/<os>/arch/<arch>
- Add your architecture's code to assembly files, currently just
crt/start.S
andplatform/<os>/src/syscall.S
- (Linux only) add your architecture's syscall definitions to
include/sys/linux/syscall.h
- Add some headers for your kernel to
include/sys/<os>
- Program a syscall interface driver in
platform/<os>/src/
, this should provide functions likeread()
,write()
,open()
, etc Try to use as little assembly as possible, the only assembly should be yoursyscall()
function, which all other functions will use - Add a platform.mk file to
platform/<os>/platform.mk
(this can add to variables like CFLAGS or be empty) - Add a folder and an arch.mk to
platform/<os>/arch/<arch>
- Darwin nanosleep is really bad, I think Apple implements it with signal magic, so figure that out.
- Make arc4random work in chroot, Apple does this, but how?
- Make signal functions work on linux.
- Add support for %a, %g, and %e formats in printf.
- Add support for $N arg number specification in printf.
- Update the whole codebase with comments, especially the stdio parts and crt.
- Fix Linux builds with the stack protector enabled segfaulting