Plan B User's Manual


vm ­ Virtual memory boxes




The virtual memory box provides a mean to exchange data between the application address space and the rest of the Plan B system. All processes (but for kernel processes) have an inner vm box representing their virtual memory. Depending on the architecture of the system, vm may contain some inner boxes defined by the kernel while starting up the process; for example, b:segs is a box representing the piece of VM used to exchange information between the kernel and the user code.

While in the born state, other processes may create VM boxes for a given process. Otherwise, only the process containing the vm box is allowed to create inner boxes on it.

Boxes created (with make(2) or by the system) under vm are segments on that address space. In addition to status information as said in info(2), segments have a starting address and a length. The system can make the segment grow depending on the information copied to it. The library function vmboxaddr(3), can be used to gain access to the memory of a segment box.

Besides segment boxes, vm understands address ranges as names. This means that any vm box can be considered to contain all feasible names of the form start:limit, where start and limit are hexadecimal numbers representing virtual addresses. Thus, inner boxes named start:limit can be used to operate on portions of an address space given their boundaries; see vmboxaddr(3) for examples.




/src/b/port/vmbox.c and /src/b/*/vm.c.

See also



The implementation is not portable to non-hosted environments and must change.

Plan B User's Manual. First edition.