The kernelSpace field describes the initial address space. The exact interpretation of this descriptor is architecture dependent:
In some cases, kernelSpace describes the address space which must be established in the hardware when entering the microkernel.
In other cases, kernelSpace describes the address space which must be established by the microkernel's memory management module.
Some architectures do not require kernelSpace at all (for example when there is no MMU).
Other architecture-dependent requirements for the initial address space layout may be specified. See "The Boot-Kernel Interface" for details.
If required, the initial virtual address space is specified by the PhMap structure:
typedef struct PhChunk { PhAddr start; /* chunk physical start address */ PhSize size; /* chunk size in bytes */ unsigned int tag; /* chunk attributes */ } PhChunk; typedef struct PhMap { int numChunks; /* number of items in the array */ PhChunk* chunk; /* array of chunk descriptors */ } PhMap;
PhMap and PhChunk
are declared in source_dir/nucleus/sys/common/src/kern/bki/phMap.h and source_dir/nucleus/sys/common/src/kern/bki/phChunk.h respectively. The PhMap structure is
a series of PhChunk
entries, each entry describing the virtual-to-physical
translation of a contiguous range of virtual addresses. The size field of
a PhChunk
descriptor indicates the size of the range. The starting
address of the range is given by the sum of the size values of the previous
ranges. Therefore, the PhMap structure must describe
the entire virtual address space.
If the tag value in PhChunk
is equal to KSP_INVALID the translation is invalid and
access to any address in the range described by PhChunk
is prohibited.
Otherwise, the start field of a PhChunk
structure gives the starting address of the physical address range
that the virtual address is mapped to. The tag
field of a PhChunk structure specifies the attributes
associated with the mapping. The highest 24 bits of tag are used to store architecture-dependent attribute sets,
such as memory access rights and cache control. See "The Boot-Kernel Interface"
for details of architecture-specific BKI. The lowest 8 bits are reserved for
use by the microkernel, and are set to 0 by mkimage.
The value of the spaceBarrier field may influence the dimensions of the supervisor and the user virtual address spaces. The exact meaning of this field is architecture dependent.