KERNEL: Pre-kernel sets up the physical memory manager.
* BUG: allocated blocks is possibly incorrect! * prekernel no longer gets compiled as being in physical memory
This commit is contained in:
@ -5,22 +5,14 @@
|
||||
#include "../lib/mem.h"
|
||||
#include "../bitmap.h"
|
||||
|
||||
// Asumming i386 for now!
|
||||
#define BLOCK_SIZE 4092
|
||||
|
||||
#define IS_ALIGNED(addr, align) !((addr) & ~((align) - 1))
|
||||
#define ALIGN(addr, align) (((addr) & ~((align) - 1 )) + (align))
|
||||
|
||||
struct PhysicalMemoryManagerInfoBlock
|
||||
{
|
||||
uint32_t* memoryBitMap;
|
||||
uint32_t pmmap_size;
|
||||
uint32_t max_blocks;
|
||||
int used_blocks;
|
||||
};
|
||||
void SetupPhysicalMemoryManager(uint32_t mapAddress, uint32_t memorySize);
|
||||
|
||||
void SetupPhysicalMemoryManager(BootInfoBlock* memory);
|
||||
void free_block(void* ptr);
|
||||
void* allocate_block();
|
||||
void allocate_region(uint32_t, uint32_t);
|
||||
void deallocate_region(uint32_t , uint32_t );
|
||||
void free_block(void* ptr);
|
||||
|
||||
void allocate_region(uint32_t address, uint32_t size);
|
||||
void deallocate_region(uint32_t address, uint32_t size);
|
||||
|
||||
int GetUsedBlocks();
|
Reference in New Issue
Block a user