Functions |
void * | lm_init (void) |
| Initializes the low memory area, the region up to the 1 MByte physical address, by mapping it on the process' physical memory address.
|
void * | lm_alloc (unsigned long size, mmap_t *map) |
| Allocates a memory block in low memory area with the specified size.
|
void | lm_free (mmap_t *map) |
| Frees a memory block in the low memory area, previously allocated using lm_alloc()
|
Detailed Description
Functions related to low memory (first 1 MB of physical memory), required for BIOS
Function Documentation
Initializes the low memory area, the region up to the 1 MByte physical address, by mapping it on the process' physical memory address.
- Returns
- virtual address on which the first 1 MiB was mapped, NULL upon failure
void* lm_alloc |
( |
unsigned long |
size, |
|
|
mmap_t * |
map |
|
) |
| |
Allocates a memory block in low memory area with the specified size.
Allocates a memory block in the region up to the 1 MByte physical address with the input size. Initializes the input mmap_t struct with the maping information, which can be read but must not be modified.
- Parameters
-
size | size of the memory block to allocate |
map | pointer to mmap_t data structure, which represents the memory map |
- Returns
- the virtual address of the memory block on success, NULL otherwise
Frees a memory block in the low memory area, previously allocated using lm_alloc()
Frees a memory block in the region up to the 1 MByte physical addess, previously allocated using lm_alloc(). Takes as input the address of the mmap_t structure that was passed to lm_alloc(), and that must have not been modified since.
- Parameters
-
map | pointer to mmap_t data structure of the block being freed |