next up previous contents index
Next: 10.14.10 base_multiboot_init_cmdline: command-line preprocessing Up: (X86 PC) MultiBoot Startup Previous: 10.14.8 multiboot_main: general MultiBoot

10.14.9 base_multiboot_init_mem: physical memory initialization

   

SYNOPSIS

#include <oskit/x86/pc/base_multiboot.h>

void base_multiboot_init_mem(void);

DESCRIPTION

This function finds all physical memory available for general use and adds it to the malloc_lmm pool, as described in Section 10.14.3. It is normally called automatically during initialization by multiboot_main (see Section 10.14.8).

This function uses the lower and upper memory size fields in the MultiBoot information structure to determine the total amount of physical memory available; it then adds all of this memory to the malloc_lmm pool except for the following ``special'' areas:

This function uses phys_lmm_init to initialize the malloc_lmm, and phys_lmm_add to add available physical memory to it (see Section 10.11.1); as a consequence, this causes the physical memory found to be split up automatically according to the three main functional ``classes'' of PC memory: low 1MB memory accessible to real-mode software, low 16MB memory accessible to the built-in DMA controller, and ``all other'' memory. This division allows the OS to allocate ``special'' memory when needed for device access or for calls to real-mode BIOS routines, simply by specifying the appropriate flags in the LMM allocation calls.

XXX currently doesn't use the memory range array.

DEPENDENCIES

phystokv
10.6.2
boot_info
10.14.7
phys_lmm_init
10.11.3
phys_lmm_add
10.11.4
strlen
9.4.18


next up previous contents index
Next: 10.14.10 base_multiboot_init_cmdline: command-line preprocessing Up: (X86 PC) MultiBoot Startup Previous: 10.14.8 multiboot_main: general MultiBoot

University of Utah Flux Research Group