Lab2
|
Data Structures | |
struct | mmap_t |
Functions | |
int | 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() | |
Variables | |
void * | mmap_t::virtual |
virtual address | |
unsigned long | mmap_t::size |
size of memory region |
Functions related to low memory (first 1 MB of physical memory), required for BIOS
int 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.
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.
size | size of the memory block to allocate |
map | pointer to mmap_t data structure, which represents the memory map |
void lm_free | ( | mmap_t * | map | ) |
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.
map | pointer to mmap_t data structure of the block being freed |