Makar ships a minimal freestanding C library (libc/) that provides just
enough of the standard C interface for the kernel to compile against. It is
not a full POSIX libc - it exists solely to satisfy the #include
dependencies of the kernel and its subdirectories.
| Header | Source(s) | Description |
|---|---|---|
stdio.h |
stdio/printf.c, putchar.c, puts.c |
Formatted and character output. |
stdlib.h |
stdlib/abort.c |
Abnormal termination. |
string.h |
string/mem*.c, strlen.c |
Memory and string utilities. |
sys/cdefs.h |
- | Compiler/libc identification macros. |
sys/cdefs.h#define __makar_libc 1
Identifies this as the Makar freestanding libc. Code that needs to detect
the Makar environment at compile time can test #ifdef __makar_libc.
-ffreestanding - no hosted runtime is
available.putchar is the single output primitive; printf and puts are built on
top of it. The kernel’s tty.c supplies the concrete putchar
implementation via the linker.malloc/free) is provided here; the
kernel’s own kmalloc/kfree heap is used instead.<stdarg.h>-compatible vprintf / snprintf for safer formatted
output in kernel subsystems.printf to support %d, %u, %x, %p format specifiers fully.<errno.h> for richer error reporting from syscall
stubs.