The kernel is divided into two major parts: the machine-independent code and the machine-dependent code. The former is shared among the ports, is entirely in C, and contains the algorithms and data structures that do not depend on the architecture on which the kernel is running. The latter contains the routines and modules that are called by the machine-independent code. The assembly portion of the kernel is kept in one file, locore.s. The file pmap.c interfaces the kernel's machine-independent virtual memory code with the machine's memory mapping facilities. Finally, the miscellaneous machine-dependent code is appropriately placed in machdep.c.