OSKit has it's own C library that is oriented towards kernel use. It is based on the BSD C library source. This is a minimal library where all dependencies on global variables or other files has been minimized. The stdio library is designed with kernel use in mind.
OSKit provides three levels of memory allocation. The first level is the standard C library routines, malloc, realloc, calloc, and free. The second level is much more memory efficient, and the third is OSKit specific, and used for allocating a specific type of memory.
For OSKit's memory function to work, the global variable malloc_lmm must be set to the address of all the physical memory in the system. Malloc_lmm is of the type lmm_t as defined in the header file oskit/c/malloc.h.
Here is a list of all the memory allocation routines:
malloc_lmm - LMM pool used by the default memory allocation functions
malloc - allocate uninitialized memory
mustmalloc - allocate uninitialized memory and panic on failure
memalign - allocate aligned uninitialized memory
calloc - allocate cleared memory
mustcalloc - allocate cleared memory and panic on failure
realloc - change the size of an existing memory block
free - release an allocated memory block
smalloc - allocated uninitialized memory with explicit size
smemalign - allocate aligned memory with explicit size
sfree - release a memory block with explicit size
mallocf - allocate uninitialized memory with explicit LMM flags
memalignf - allocate aligned uninitialized memory with explict LMM flags
smallocf - allocated uninitialized memory with explicit size and LMM flags
smemalignf - allocate aligned memory with explicit size and LMM flags
morecore - add memory to malloc memory pool
mem_lock - Lock access to malloc memory pool
mem_unlock - Unlock access to malloc memory pool
fflush
fputc
ftell
printf
sscanf
fgetc
fputs
fwrite
putchar
stdio
fgets
fread
getchar
puts
vfprintf
fopen
fscanf
gets
rewind
fclose
fprintf
fseek
perror
sprintf