summaryrefslogtreecommitdiff
path: root/src/kernel/mem.c
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.c
parenta947a7a143029ee8ef5cb4a4232d7439b8a79670 (diff)
downloadportland-os-f5f0f5ddae199121daebcd2213aabd81686cc074.tar.gz
start of 0.0.9 branch, using multiboot this time
Diffstat (limited to 'src/kernel/mem.c')
-rw-r--r--src/kernel/mem.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/kernel/mem.c b/src/kernel/mem.c
index 509c768..6544108 100644
--- a/src/kernel/mem.c
+++ b/src/kernel/mem.c
@@ -19,23 +19,10 @@ OF THIS SOFTWARE.
#include "mem.h"
-void *allocate_pages(uint16_t n_pages, uint16_t proc_n) {
- for (uint16_t *i = MMAP, *l = MMAP + 0x1000 - proc_n; ++i; i <= l)
- outer_for:
- if (!*i) {
- for (uint16_t j = 1; j < n_pages; ++j)
- if (i[j]) {
- i += j + 1;
- goto outer_for;
- }
- for (uint16_t j = 0; j < n_pages; ++j)
- i[j] = proc_n;
- return (void *)((i - MMAP) * 0x1000);
- }
- return (void *)0;
+void *allocate_block(uint32_t size, uint16_t proc_n) {
+ //TODO
}
-void deallocate_pages(void *from, uint16_t n_pages) {
- for (uint16_t *mb = MMAP + (uint32_t)from / 0x1000, *l = mb + n_pages; mb < l; ++mb)
- *mb = 0;
+void deallocate_block(void *start) {
+ //TODO
} \ No newline at end of file