ChorusOS 4.0 Porting Guide

Heap and Stack

heapStart points to the beginning of a block of statically allocated memory. The block can be used by the bootstrap program for dynamic memory allocation. For instance, the heap is used by the device tree library memory allocator (see "Initial Device Tree") to build the initial state of the board's device tree.

heapCur points to the first byte available for future allocation. mkbootconf sets heapCur to heapStart.

heapLimit points to the heap memory limit. The size of the heap memory is equal to heapLimit-heapStart.

The heap is also used for the initial stack. The bootconf startup procedure initializes the current stack pointer with the heapLimit value.

All other fields of the BootConf structure are initialized dynamically during the system bootstrap.