Skip to content

std.freestanding

for a program built with –target freestanding, which has no os under it

pub set_output :: fn(write: extern fn(*const u8, usize))

println and the panic message go to write, e.g. a serial port; nothing is printed before

pub halt :: fn()

interrupts off, halted for good

pub add_memory :: fn(base: usize, len: usize)

gives zones the memory [base, base + len), e.g. a free range of the boot loader’s memory map; it must be memory nothing else uses. before any is given, and after it runs out, zones take a 1 MiB static heap

pub free_memory :: fn() -> usize

the bytes zones can still take