summaryrefslogtreecommitdiff
path: root/kernel/memory.h
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-04-02 18:04:26 +0000
committerAda Christine <adachristine18@gmail.com>2021-04-02 18:04:26 +0000
commit167481f8988a860ea6d7ea8bbdb7155e4eb7abeb (patch)
treec348e1ea1bec525039decf6f15477d381f2d0bd7 /kernel/memory.h
parenta41f11851c23390510a8cf9d0a932b9d08636fb0 (diff)
kernel has gdt now and loads segment register and we can allocate pages
Diffstat (limited to 'kernel/memory.h')
-rw-r--r--kernel/memory.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/memory.h b/kernel/memory.h
new file mode 100644
index 0000000..da573da
--- /dev/null
+++ b/kernel/memory.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef uint64_t phys_addr_t;
+typedef uint64_t virt_addr_t;
+
+void memory_init();
+
+void *kmalloc(size_t size);
+void kfree(void *block);
+
+phys_addr_t page_alloc(void);
+void page_free(phys_addr_t page);
+