The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
File List
Here is a list of all files with brief descriptions:
 src
  arch
   x86
    boot
     
multiboot2.c
     
multiboot2.h
Multiboot 2 boot information, read into a boot_info_t
    boot64
     
limine_boot.c
    cpu
     
apic.c
     
apic.h
Local APIC and the I/O APIC
     
arch_context_x86.c
X86 implementation of the arch-neutral context-switch helpers
     
arch_impl.c
     
arch_irq_x86.c
X86 implementation of the arch-neutral IRQ API
     
double_fault.c
     
double_fault.h
     
exception.c
     
exception.h
     
fpu.c
FPU (x87) and SSE register state of user programs
     
gdt.c
     
gdt.h
     
gdt64.c
     
idt.c
     
idt.h
     
io.c
     
io.h
     
irq.c
     
irq.h
     
isr.c
     
isr.h
     
isr_gen.c
     
msi.c
     
paging.c
     
paging.h
     
paging64.c
     
pat.c
     
pat.h
Page attribute table: write-combining for the framebuffer
     
pic.c
     
pic.h
     
smp_boot.c
Start the other cores (application processors) of an x86 machine
    
hal_x86.c
X86 implementation of the hardware abstraction layer
   
arch.h
   
arch_context.h
   
arch_cpu.h
Arch part of per-CPU data: a segment base that points at the cpu_t of the core (kernel/cpu/cpu.h)
   
arch_irq.h
  common
   boot
    
boot_info.h
    
memory_map.h
    
video_modes.h
Video modes the firmware offers, as the bootloader reports them
   fb
    
fb_ioctl.h
Framebuffer device uapi: screeninfo structs and FBIO* request codes
   
div64.h
   
error.c
   
error.h
   
memory.c
   
memory.h
   
stdarg.h
   
stddef.h
   
stdint.h
   
stdio.c
   
stdio.h
   
string.c
   
string.h
  drivers
   disk
    
ahci.c
    
ahci.h
SATA disks through an AHCI controller (PCI class 01:06:01)
    
ata.c
    
ata.h
    
block_device.c
    
block_device.h
    
nvme.c
    
nvme.h
NVMe disks (PCI class 01:08:02)
    
partition.c
    
partition.h
    
ramdisk.c
    
ramdisk.h
Block device on a range of memory
   keyboard
    
keyboard.c
PS/2 keyboard driver implementation
    
keyboard.h
    
keyboard_ioctl.h
Ioctls of /dev/kbd: list, read and set the keyboard layout
    
keyboard_layout.h
Keyboard layout definitions
    
layout_dk_mac.c
Danish Mac keyboard layout for PS/2 keyboards
    
layout_us.c
US keyboard layout (ANSI, with the ISO key as backslash)
    
layouts.c
List of built-in keyboard layouts, and the active one
   mouse
    
ps2_mouse.c
    
ps2_mouse.h
PS/2 mouse on the i8042 controller's second (aux) port
   net
    
virtio_net.c
Virtio network device (see virtio_net.h)
    
virtio_net.h
Virtio network device (virtio 1.0, section 5.1)
   pci
    
pci.c
    
pci.h
PCI bus enumeration through the legacy configuration ports
    
pci_irq.c
    
pci_irq.h
Interrupts for PCI devices: MSI-X, MSI, or the legacy INTx line
   pit
    
pit.c
    
pit.h
   rtc
    
rtc.c
CMOS real-time clock (MC146818 compatible)
    
rtc.h
CMOS real-time clock: the wall-clock time at boot
   serial
    
serial.c
    
serial.h
   sound
    
ac97.c
    
ac97.h
AC'97 sound output (Intel ICH style controllers, PCI class 04:01; QEMU -device AC97)
    
hda.c
    
hda.h
Intel High Definition Audio output (PCI class 04:03; almost every PC since 2004; QEMU -device intel-hda -device hda-output)
   usb
    
hid.c
    
hid.h
Small HID report descriptor parser for pointing devices
    
xhci.c
    
xhci.h
USB keyboards and pointing devices through xHCI controllers (PCI class 0C:03:30)
   video
    fb
     
fb.c
Linear framebuffer driver implementation
     
fb.h
     
fb_text.c
Text grid renderer over the framebuffer
     
fb_text.h
Text grid on top of the linear framebuffer
     
font.h
Generated bitmap font for the framebuffer text renderer
    vga
     
vga.c
     
vga.h
    
display.c
Display layer (see display.h) and /dev/display
    
display.h
Display drivers: the layer between the fbdev (/dev/fb0) and a card that can change its mode
    
virtio_gpu.c
Virtio-gpu display (QEMU -vga virtio, or -device virtio-gpu)
    
virtio_gpu.h
Virtio-gpu display driver
   virtio
    
virtio.c
Virtio 1.0 on PCI: registers, features, split virtqueues (see virtio.h)
    
virtio.h
Virtio 1.0 devices on PCI (the "modern" interface)
  fs
   ext2
    
ext2.h
    
ext2_alloc.c
    
ext2_dir.c
    
ext2_file.c
    
ext2_inode.c
    
ext2_internal.h
    
ext2_io.c
    
ext2_link.c
Hard links, symbolic links, and the inodes with no data: named pipes and device nodes
    
ext2_mount.c
  kernel
   acpi
    
acpi.c
    
acpi.h
ACPI tables: RSDP, RSDT/XSDT, MADT, FADT, HPET and MCFG
   audio
    
audio.c
    
audio.h
Sound output core: /dev/dsp, /dev/mixer and the driver interface
    
soundcard.h
OSS sound interface: ioctl numbers and formats (ABI)
   console
    
console.c
System console: a tty over either the framebuffer or VGA text
    
console.h
    
console_file.c
    
fb_console.c
Adapts the framebuffer text grid to the tty backend interface
    
fb_console.h
Framebuffer tty backend
    
termios.h
   cpu
    
cpu.c
Data of each core (per-CPU data)
    
cpu.h
Data of each core (per-CPU data)
    
smp.c
Start the other cores at boot (smp_init in cpu.h)
   debug
    
backtrace.c
    
backtrace.h
    
ksyms.c
    
ksyms.h
   device
    
device.c
Flat device registry
    
device.h
Generic device model: a named/typed handle plus a registry
    
null.c
    
null.h
/dev/null and /dev/zero
   elf
    
elf.h
    
elf_loader.c
    
elf_loader.h
   fs
    
block_cache.c
    
block_cache.h
Sector cache in front of a block device
    
devfs.c
Read-only pseudo-filesystem backing the device registry
    
devfs.h
Small read-only pseudo-filesystem that surfaces the device registry
    
ext2_ops.c
Ext2 implementation of the filesystem operations vtable
    
ext2_ops.h
    
fs.c
Generic filesystem layer
    
fs.h
    
procfs.c
Read-only filesystem that shows kernel state as text
    
procfs.h
Read-only view of kernel state, mounted at /proc
    
tmpfs.c
Filesystem that keeps its files in kernel memory
    
tmpfs.h
Filesystem in kernel memory, mounted at /tmp
   hal
    
hal.h
   input
    
input.c
    
input.h
Input core: /dev/input, one stream of key, button, motion and wheel events from every input driver
    
input_event.h
Events of /dev/input (ABI)
   ipc
    
unix_socket.c
    
unix_socket.h
Unix domain stream sockets, with file descriptor passing
   irq
    
irq.c
Kernel IRQ handler manager
    
irq.h
Kernel IRQ handler manager: shared lines, per-handler control
   klog
    
klog.c
    
klog.h
   memory
    
boot_layout.c
    
boot_layout.h
    
fault.c
    
fault.h
    
heap.c
    
heap.h
    
kernel_layout.c
    
kernel_layout.h
    
kstack.c
    
kstack.h
    
memory.c
    
memory.h
    
memory_layout.h
    
mm.c
    
mm.h
    
mman.h
Mmap protection and flag constants (kernel side)
    
mmio.c
    
mmio.h
    
page.h
    
phys.h
    
pmm.c
    
pmm.h
    
pmm_layout.c
    
pmm_layout.h
    
region.c
    
region.h
    
reservations.c
    
reservations.h
    
shm.c
    
shm.h
Shared memory objects: pages that several processes map
    
tlb.c
TLB shootdown (tlb.h)
    
tlb.h
TLB shootdown: a change to the page tables reaches the TLB of every core that can hold the old entry
    
user_space.c
    
user_space.h
    
vma.c
    
vma.h
   net
    
arp.c
ARP cache (see arp.h)
    
arp.h
Address Resolution Protocol (RFC 826): the Ethernet address of an IPv4 address on the local network
    
byteorder.h
Network byte order (big endian) on the little-endian x86
    
checksum.c
Internet checksum (see checksum.h)
    
checksum.h
Internet checksum (RFC 1071): the ones' complement of the ones' complement sum of the 16-bit words
    
ethernet.c
Ethernet II frames (see ethernet.h)
    
ethernet.h
Ethernet II frames: the 14-byte header in front of ARP and IPv4
    
icmp.c
ICMP (see icmp.h)
    
icmp.h
ICMP for IPv4 (RFC 792): echo (ping) and "unreachable"
    
inet_internal.h
Parts of the IPv4 sockets that inet_socket.c (datagrams) and tcp_socket.c (streams) share
    
inet_socket.c
IPv4 sockets: UDP and ICMP echo here, and the calls of TCP sockets go to tcp_socket.c (see inet_socket.h)
    
inet_socket.h
IPv4 sockets: TCP (SOCK_STREAM), UDP (SOCK_DGRAM) and ICMP echo (SOCK_DGRAM with IPPROTO_ICMP, for ping, as Linux's ping sockets)
    
ipv4.c
IPv4 (see ipv4.h)
    
ipv4.h
IPv4 (RFC 791): the header, the checks, and where a packet goes
    
netif.c
Interface table and the loopback interface (see netif.h)
    
netif.h
Network interfaces: the devices that send and receive frames
    
tcp.c
TCP (see tcp.h)
    
tcp.h
TCP (RFC 9293): reliable byte streams between ports
    
tcp_socket.c
TCP sockets (SOCK_STREAM): the socket calls over tcp.c
    
udp.c
UDP (see udp.h)
    
udp.h
UDP (RFC 768): datagrams between ports
   process
    
process.c
    
process.h
    
wait_status.h
   random
    
blake2s.c
BLAKE2s (see blake2s.h)
    
blake2s.h
BLAKE2s hash (RFC 7693), without a key
    
chacha20.c
ChaCha20 block function (see chacha20.h)
    
chacha20.h
ChaCha20 block function (RFC 8439 section 2.3)
    
random.c
Random pool and generator (see random.h)
    
random.h
Random numbers for the kernel and for programs: /dev/urandom, /dev/random and the getrandom call
   scheduler
    
scheduler.c
    
scheduler.h
   signal
    
signal.c
POSIX signals: sending, default actions, user handlers
    
signal.h
   sync
    
atomic.h
Atomic operations on 32-bit and 64-bit words, for counters and flags that need no lock (reference counts, statistics)
    
completion.c
    
completion.h
Wait for a device: sleep until its interrupt, or poll
    
futex.c
Futex wait and wake (futex.h), and SYS_futex
    
futex.h
    
mutex.c
    
mutex.h
    
spinlock.c
    
spinlock.h
    
wait_queue.c
    
wait_queue.h
   syscall
    
fd_table.c
    
fd_table.h
    
pipe.c
    
pipe.h
    
sys_cred.c
User and group ids, file modes and owners
    
sys_fb.c
Pollkey syscall (non-blocking keyboard peek for graphics demos)
    
sys_fs.c
    
sys_io.c
    
sys_misc.c
    
sys_proc.c
    
sys_socket.c
    
sys_uname.c
    
syscall.h
    
syscall_dispatch.c
    
syscall_internal.h
   time
    
clock.c
    
clock.h
    
timer.c
    
timer.h
   tty
    
pty.c
    
pty.h
    
tty.c
Terminal state machine: ANSI escape parsing, cursor handling, output
    
tty.h
Terminal (TTY) layer
   usermode
    
brk.c
    
exec.c
    
trampoline.c
    
uaccess.c
    
uaccess.h
    
usermode.h
    
usermode_arch.c
   vfs
    
dirent.h
    
fifo.c
    
fifo.h
Named pipes (FIFOs): a pipe that processes reach by a name
    
file.c
    
file.h
    
flock.c
    
flock.h
Advisory whole-file locks (flock)
    
permission.c
    
permission.h
    
poll.c
    
poll.h
    
stat.h
    
vfs.h
    
vfs_link.c
Symbolic links across the mounts, and hard links
    
vfs_mount.c
VFS mount table
    
vfs_ops.c
    
vfs_path.c
   
assert.h
   
cmdline.c
Kernel command line (cmdline.h)
   
cmdline.h
Kernel command line that the bootloader gives: words split by spaces, each a flag ("nosmp") or a key and a value ("maxcpus=2")
   
errno.h
   
kernel.c
   
kernel.h
   
panic.c
   
panic.h
  lib
   apps
    include
     
apps.h
Programs of the desktop: the .app files
    
apps.c
Libapps: read the .app files of the desktop's programs
   bragi
    include
     
bragi.h
Bragi: TrueType text for libgfx buffers
    
bragi_cache.c
Bragi: the glyph cache of a face, and blending glyph masks
    
bragi_cell.c
Bragi: the monospace grid, with box drawing done in code
    
bragi_font.c
Bragi: fonts, faces, glyph lookup and metrics (stb_truetype)
    
bragi_internal.h
What the bragi sources share: the font, the face and the glyph
    
bragi_text.c
Bragi: UTF-8, measuring and drawing lines, wrapping, text boxes
   conf
    include
     
conf.h
Settings files: sections of "key = value" lines
    
conf.c
Libconf: settings files with sections and "key = value" lines
   gfx
    include
     
gfx.h
Libgfx: drawing into pixel buffers in memory
    
gfx.c
Libgfx: colours, rectangles, buffers, fills, copies and output
    
gfx_blur.c
Libgfx: a Gaussian blur of a whole buffer (a frosted backdrop)
    
gfx_internal.h
Pixel arithmetic shared by the libgfx sources
    
gfx_round.c
Libgfx: round rectangles, borders and soft shadows, drawn as CSS draws them
    
gfx_scale.c
Libgfx: drawing a buffer at another size (bilinear filtering)
    
gfx_shapes.c
Libgfx: lines
   heimdall
    include
     
heimdall.h
Libheimdall: windows on the ginnOS desktop (the heimdalld client)
     
heimdall_proto.h
Messages between heimdalld (the window server) and its clients
    
heimdall.c
Libheimdall: the client side of the heimdalld protocol
   icon
    include
     
icon.h
Icons from the icon packs in /usr/share/icons
    
icon.c
Icons from the icon packs (the format is in tools/icons/build.py)
   idunn
    include
     
idunn.h
Idunn: the widget toolkit of ginnOS
     
idunn_theme.h
Idunn: the design tokens (colours, sizes, text styles, shadows)
    
app.c
Idunn: the app loop and windows on the window server
    
badge.c
Idunn: a badge: small medium text in a pill, 22 pixels high, in four variants (default, secondary, outline, destructive)
    
button.c
Idunn: buttons in the variants of the preview (shadcn's, with the refined finish and a soft red delete button)
    
canvas.c
Widget the program draws itself (a terminal, a game)
    
check.c
Idunn: a check box, 16 pixels, with a label
    
context.c
Idunn: the fonts, text faces and icons of a theme
    
empty.c
Idunn: an icon on its own, and the empty state: an icon in a muted square, a title and a muted line, in the middle of the space
    
field.c
Idunn: a field: a label above a control, and help text below it, 6 pixels apart, as the usual form row
    
file_dialog.c
Idunn: a dialog to choose a file to open, or a name to save as
    
floating.c
Idunn: what floats over a window: tooltips (the primary colour, small text), popovers (a card next to a widget) and dialogs (a card in the middle of the window over the overlay colour, with buttons at the bottom right; the window behind gets no input)
    
idunn_internal.h
Idunn: what the widget classes share (not for apps)
    
label.c
Idunn: text in a style
    
layout.c
Idunn: rows and columns (a small CSS flexbox) and spacers
    
list.c
Idunn: a list view: rows of 32 pixels with an icon, text and a muted second text on the right; and a grid view, the same with tiles: a 48 pixel colour icon and the name below it (a file manager's icons)
    
list_heads.c
Idunn: heads over the columns of a list view
    
menu.c
Idunn: menus: a card in a popup (the card colour, a border, the radius, the md shadow, 4 pixels inside) with items of 32 pixels: an icon, the text and a shortcut in the muted colour; check items, separators and sub-menus
    
option.c
Idunn: a small control with its label to the right (check box, radio, switch), 10 pixels apart as in the preview
    
popup.c
Idunn: popup windows (menus, a select's choices, popovers, tooltips)
    
progress.c
Idunn: a progress bar: a rounded track in the muted colour, filled from the left in the accent colour, 8 pixels high
    
radio.c
Idunn: a radio group: choices with 16 pixel circles, one of them chosen (an accent ring and an 8 pixel dot)
    
scroll.c
Idunn: a scroll view: one child that can be taller than the view
    
select.c
Idunn: a select: a button like a text field with the chosen value and a chevron
    
separator.c
Idunn: a 1 pixel line in the border colour, across a column or down a row (its box stretches it)
    
slider.c
Idunn: a slider: a 4 pixel round track in the muted colour, filled with the accent up to a 16 pixel thumb
    
switch.c
Idunn: a switch, 32 by 18 pixels: a round track (the input colour when off, the accent when on) and a white 14 pixel thumb that slides in 120 ms
    
tabs.c
Idunn: tabs: a muted strip of tab names, the active one a raised pill, and below it the page of the active tab (the others are hidden)
    
text_area.c
Idunn: a text area: text in lines that wrap at spaces, in the same well as a text field
    
text_edit.c
Idunn: the text, the caret and the selection of an editable text, and the keys that act on them the same way in a text field and a text area
    
text_field.c
Idunn: a one-line text field: a slightly inset well with a placeholder, a blinking caret, selection with the mouse and the keys, the clipboard, and scrolling when the text is longer than the field
    
theme.c
Idunn: the design tokens and the theme file
    
widget.c
Idunn: the widget tree, sizes, what must be drawn again, and transitions
    
window.c
Idunn: a window's widgets: layout, drawing what changed, and the pointer and the keys
   image
    include
     
image.h
Load PNG, JPEG and BMP files into libgfx buffers
    
image.c
Load images into libgfx buffers, through stb_image
   mime
    include
     
mime.h
File types: the type name and the icon of a file
    
mime.c
File types from /usr/share/ginnos/mime.conf
   rat
    include
     
rat.h
Librat: the package manager of ginnOS
    
archive.c
Librat: read and check a package file (gzip, then ustar), and unpack its files and links into a stage folder
    
db.c
Librat: the database files
    
download.c
Librat: download a file with libcurl
    
index.c
Librat: the package index of the repository (index.conf)
    
info.c
Librat: the fields of .RATINFO, and the rules for names and versions
    
install.c
Librat: install a package file, or upgrade an installed package with it
    
internal.h
Parts of librat that its source files share
    
open.c
Librat: open a root folder, the lock, and the root image check
    
query.c
Librat: the queries
    
remove.c
Librat: remove an installed package
    
repo.c
Librat: the repository
    
signature.c
Librat: check the signature of the package index with the public keys of the image
    
txn.c
Librat: transactions
    
util.c
Librat helpers: messages, paths, file data and SHA-256, safe writes, folders
    
version.c
Librat: the order of versions, with the rules of Debian
   vt
    include
     
vt.h
Libvt: a terminal emulator without a screen
    
vt.c
Libvt: the parser, the screens and the scrollback
  libc
   include
    arpa
     
inet.h
IPv4 addresses as text ("10.0.2.15") and back
    net
     
if.h
Network interfaces: struct ifreq for the SIOC ioctls of <sys/ioctl.h>, which work on any AF_INET socket
    netinet
     
in.h
IPv4 addresses and ports, and the IP protocols
     
tcp.h
TCP socket options (setsockopt at IPPROTO_TCP)
    sys
     
fb.h
Framebuffer device interface (userspace)
     
file.h
Flock: advisory locks on whole files
     
input.h
Events of /dev/input (ABI)
     
ioctl.h
Device control requests
     
kbd.h
Ioctls of /dev/kbd: list, read and set the keyboard layout
     
mman.h
Memory-mapping interface (userspace)
     
random.h
Random bytes from the kernel's generator (getrandom)
     
reboot.h
Restart or turn off the machine (root only), as on Linux
     
resource.h
Process priorities: the nice value, -20 (the most CPU) to 19 (the least)
     
select.h
Select(), built on poll()
     
socket.h
Sockets: Unix domain stream sockets, with file descriptor passing, and IPv4 sockets (TCP; UDP, and ICMP for ping)
     
soundcard.h
OSS sound interface: ioctl numbers and formats (ABI)
     
stat.h
File metadata: stat() and fstat()
     
sysmacros.h
Device numbers: a major (the driver) and a minor (the device), packed as Linux packs them in 32 bits
     
time.h
Struct timeval and gettimeofday
     
times.h
Process CPU times
     
types.h
Basic system types
     
uio.h
Struct iovec: one piece of a scattered buffer (sendmsg, recvmsg)
     
un.h
Address of a Unix domain socket
     
utsname.h
Name of the system: uname
     
wait.h
Waiting for child processes
    
assert.h
Assert(): with NDEBUG defined it checks nothing
    
crypt.h
Password hashes: crypt() with the SHA-crypt "$5$" scheme (SHA-256), the one glibc and "openssl passwd -5" make
    
ctype.h
Character classes (the C locale, ASCII)
    
dirent.h
Reading directories: opendir, readdir, closedir
    
dlfcn.h
Loading shared libraries at run time
    
errno.h
    
fb.h
Userspace access to the linear framebuffer
    
fcntl.h
File open flags and open()
    
fnmatch.h
Shell patterns ("*.c", "[a-z]?"): fnmatch is musl's (see src/libc/src/regex/README.md)
    
grp.h
Group database (/etc/group: name:password:gid:members)
    
inttypes.h
Printf formats for the stdint.h types
    
langinfo.h
Facts about the locale
    
libgen.h
Parts of a path
    
limits.h
Sizes of the integer types and system limits
    
locale.h
Locales
    
math.h
Floating-point functions (double, and float with an f)
    
netdb.h
Names of hosts and services: getaddrinfo and the older calls
    
poll.h
Waiting for file descriptors to become ready
    
pthread.h
POSIX threads: start, wait for and end threads; mutexes, condition variables, read-write locks, barriers, spin locks, one-time initialization and thread-specific data
    
pty.h
Open a pseudo-terminal pair, and make one a process's terminal
    
pwd.h
User database (/etc/passwd: name:password:uid:gid:gecos:home:shell)
    
regex.h
POSIX regular expressions, basic (BRE) and extended (ERE)
    
sched.h
Scheduler: give up the CPU
    
search.h
Search trees (tsearch: a balanced tree of pointers the caller owns) and linear search in an array
    
semaphore.h
Unnamed POSIX semaphores, for the threads of one process
    
setjmp.h
Non-local jumps
    
sha2.h
SHA-256 (FIPS 180-4) in steps, for data that does not fit in memory at one time
    
shadow.h
Password hashes (/etc/shadow: name:hash:last:min:max:warn: inactive:expire:), which only root can read
    
signal.h
Signals: kill, sigaction, masks
    
stdarg.h
Variable argument lists (the compiler's builtins)
    
stdbool.h
Bool, true and false
    
stddef.h
NULL, size_t, ptrdiff_t, offsetof
    
stdint.h
Integer types of fixed width
    
stdio.h
Buffered streams and formatted input/output
    
stdlib.h
This file contains the declarations of general utility functions
    
string.h
This file contains the declarations of string manipulation functions
    
strings.h
Strcasecmp and strncasecmp (declared in string.h)
    
syscall.h
This file contains the declarations of system call numbers and the raw syscall interface
    
syslog.h
System log: ginnOS writes each message to the kernel log (/dev/kmsg), with the name, the pid and the level before it
    
termios.h
Terminal settings
    
time.h
Clocks, sleeping and calendar time (UTC only: there are no time zones, so local time is UTC)
    
unistd.h
This file contains the declarations of POSIX-like system call wrappers
    
utime.h
Utime: set a file's times in whole seconds (the older call; see utimensat in <sys/stat.h>)
    
wchar.h
Wide characters
    
wctype.h
Classes of wide characters (Unicode code points)
 tools
  
docs