summaryrefslogtreecommitdiff
path: root/src/kernel/mem.c
blob: d002050cd6ab6ef193337912bd27d230042d14ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <arch/generic.h>
#include <kernel/mem.h>

extern void *_bss_end;
static void *highest_page;

void mem_init() {
	highest_page = &_bss_end;
}

void *page_alloc(size_t pages) {
	void *bottom = highest_page;
	highest_page += pages * PAGE_SIZE;
	return bottom;
}

// frees `pages` consecutive pages starting from *first
void page_free(void *first, size_t pages) {
	// not implemented
}