Nigel
b07b4f0d38
Problem: As our kernel grows we need more complex datastructures and functions these would come from the standard C/C++ library with normal programs. The kernel is a freestanding programme and has no access to standard libraries. Solution: We build a mini version of the standard C/C++ library which will contain the datastructures and functions we want. This library can then be statically linked into our kernel binary. Making it a statically linked library also gives more structure to the project. Keeping these random functions and datastructures in the kernel just clutters the kernel source code with less relevant source code.
20 lines
446 B
C
20 lines
446 B
C
#pragma once
|
|
#include <stddef.h>
|
|
#include <CoreLib/Memory.h>
|
|
|
|
#include "../prekernel/bootstructure.h"
|
|
#include "../terminal/kterm.h"
|
|
#include "../bitmap.h"
|
|
|
|
#define BLOCK_SIZE 4092
|
|
|
|
|
|
void SetupPhysicalMemoryManager(uint32_t mapAddress, uint32_t memorySize);
|
|
|
|
void* allocate_block();
|
|
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(); |