Mercurial > lcfOS
view kernel/memory.c3 @ 406:b1daa462ee17
Made kernel run again
author | Windel Bouwman |
---|---|
date | Fri, 20 Feb 2015 14:25:35 +0100 |
parents | 0fb6633c42f6 |
children | ad6be5454067 |
line wrap: on
line source
module memory; import arch; import io; var int ptr; // Let the heap grow upwards.. function void init() { ptr = 0x80000; } function byte* alloc(int size) { var int ptr2; ptr2 = ptr; io.print2("alloc size ", size); io.print2("alloc address ", ptr); // Increment new free point: ptr = ptr + size; return ptr2; } function void memcpy(byte* dst, byte* src, int size) { var int i; for (i = 0; i < size; i = i + 1) { *(dst + i) = *(src + i); } }