PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
Page allocator. More...
Data Fields | |
struct lock | lock |
Mutual exclusion. More... | |
struct bitmap * | used_map |
Bitmap of free pages. More... | |
uint8_t * | base |
Base of pool. More... | |
Page allocator.
Hands out memory in page-size (or page-multiple) chunks. See malloc.h for an allocator that hands out smaller chunks.
System memory is divided into two "pools" called the kernel and user pools. The user pool is for user (virtual) memory pages, the kernel pool for everything else. The idea here is that the kernel needs to have memory for its own operations even if user processes are swapping like mad.
By default, half of system RAM is given to the kernel pool and half to the user pool. That should be huge overkill for the kernel pool, but that's just fine for demonstration purposes. A memory pool.
uint8_t* pool::base |
Base of pool.
Definition at line 33 of file palloc.c.
Referenced by init_pool(), page_from_pool(), palloc_free_multiple(), and palloc_get_multiple().
struct lock pool::lock |
Mutual exclusion.
Definition at line 31 of file palloc.c.
Referenced by init_pool(), and palloc_get_multiple().
struct bitmap* pool::used_map |
Bitmap of free pages.
Definition at line 32 of file palloc.c.
Referenced by init_pool(), page_from_pool(), palloc_free_multiple(), and palloc_get_multiple().