blob: 6871e11193998be2aba04efb9929398170f5b1b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/**
* @file
*
* Physical Memory Manager
* =======================
*
* Allocating and Deallocating memory pagewise. Run mem_init() first.
*
*
* Memory Map
* ----------
* This will allow to mark a bit on/off for each page to indicte if it is
* currently used or not.
*
* Remember that we have 4096 bytes per page so we need 1048576 bits to
* cover the whole 32bit addressable memory 2^32 byte (4GB).
*
* This results in a 128KiB map we which allocate statically.
*/
#include "multiboot.h"
/**
* Init the physical memory manager. Please provide the multiboot_information
* strucutre filled by your bootloader (as grub).
* This is required for memory map et al.
*/
uint32_t mem_init(multiboot_information *info);
void* mem_alloc_block ();
void mem_free_block(void* p);
uint32_t mem_get_free_blocks_count();
|