Skip to content

Libraries

The support libraries in include/. Each header that is listed in docs/doc-publish in the zuzu repository gets a page here.

Standard and support headers

Header Summary
<ansi.h> ANSI terminal escape sequences.
<assert.h> assert(): panics in the kernel, quits the program in userspace; nothing with NDEBUG.
<bitmap.h> Fixed-size bitmaps stored in 32-bit words.
<compiler.h> Branch and placement hints shared by the kernel and userspace.
<convert.h> Number and string conversion, and byte-order helpers.
<cpio.h> Finding files in a cpio archive (new ASCII format), as used for the initrd.
<ctype.h> Character classification and case conversion, for the C locale.
<dirent.h> Minimal opendir/readdir/closedir for tier-2 (newlib) programs.
<elf.h> The parts of the ELF32 format the loader reads.
<list.h> Intrusive circular doubly linked list with a sentinel head.
<malloc.h> Userspace heap allocator.
<math.h> Floating-point constants, classification macros and libm declarations.
<newlib_compat.h> POSIX declarations this newlib build leaves out.
<sbrk.h> Program break for the heap allocator.
<snprintf.h> Bounded formatted output.
<stdio.h> Console I/O over ttysvc: printf and scanf families, and choosing the terminal.
<stdlib.h> Freestanding stdlib subset: conversions, sorting, searching and rand().
<string.h> Memory and string functions, and the formatting core.
<vector.h> Type-safe growable arrays, generated per element type by DEFINE_VEC().

dev/

Header Summary
<dev/devm.h> devsvc protocol: asking rootsvc's device service for a device by compatible string.
<dev/tty.h> ttysvc protocol and client helpers.

dev/protocols/

Header Summary
<dev/protocols/mmcdrv.h> Block-device protocol shared by every SD/MMC driver ("/dev/mmc0").

fs/

Header Summary
<fs/fsd_client.h> Minimal client for the fsd protocol.

fs/protocols/

Header Summary
<fs/protocols/fsd.h> fsd's protocol: sessions, requests and the shared buffer.

net/

Header Summary
<net/packetring.h> Single-producer, single-consumer ring of Ethernet frames between a NIC driver and netd.
<net/socket.h> Sockets: TCP and UDP through netd, over shared-memory rings.

net/protocols/

Header Summary
<net/protocols/netd.h> netd's service protocol: driver handshake and network interface queries.
<net/protocols/nic.h> Shared memory and doorbell protocol between a NIC driver and netd.

util/

Header Summary
<util/arena.h> Bump allocator over a caller-provided buffer.
<util/args.h> Small command-line argument helpers.
<util/devices.h> Look-ups in the syspage device list.
<util/fnv1a.h> 32-bit FNV-1a string hash.
<util/imgcache.h> Small cache of loaded program images, keyed by path.
<util/log.h> Leveled logging.
<util/spawn.h> Starting programs: load a ZXF or ELF32 image into a new space and run it.
<util/tls.h> Per-thread control block (TCB): identity, priority and message box.
<util/version.h> zuzuOS (userspace) version, separate from the kernel's version.
<util/zxf.h> ZXF, zuzu's executable container: header, segment table and optional blocks.