summaryrefslogtreecommitdiff
path: root/src/kernel/mem.h
diff options
context:
space:
mode:
authorBenji Dial <Benji3.141@gmail.com>2019-12-24 22:31:22 -0500
committerBenji Dial <Benji3.141@gmail.com>2019-12-24 22:31:22 -0500
commitf5f0f5ddae199121daebcd2213aabd81686cc074 (patch)
tree91d8d29ea497e282f841849e620d43f8fcafcfcc /src/kernel/mem.h
parenta947a7a143029ee8ef5cb4a4232d7439b8a79670 (diff)
downloadportland-os-f5f0f5ddae199121daebcd2213aabd81686cc074.tar.gz
start of 0.0.9 branch, using multiboot this time
Diffstat (limited to 'src/kernel/mem.h')
-rw-r--r--src/kernel/mem.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/kernel/mem.h b/src/kernel/mem.h
index 2bfb3bf..1eb27bd 100644
--- a/src/kernel/mem.h
+++ b/src/kernel/mem.h
@@ -22,8 +22,21 @@ OF THIS SOFTWARE.
#ifndef MEM_H
#define MEM_H
-#define MMAP ((uint16_t *)0x00002000)
-void *allocate_pages(uint16_t n_pages, uint16_t proc_n);
-void deallocate_pages(void *from, uint16_t n_pages);
+enum special_mmap_codes {
+ FREE = 0,
+ HARDWARE = 1,
+ KERNEL = 2
+};
+
+struct mmap_entry {
+ uint64_t base;
+ uint64_t length;
+ uint32_t whose;
+ struct mmap_entry *next;
+} __attribute__ ((__packed__));
+
+struct mmap_entry *mmap_start;
+void *allocate_block(uint32_t size, uint16_t proc_n);
+void deallocate_block(void *start);
#endif \ No newline at end of file