comparison kernel/memory.c3 @ 408:ad6be5454067

Added image build task
author Windel Bouwman
date Sat, 21 Feb 2015 12:17:47 +0100
parents 0fb6633c42f6
children 6aa9743ed362
comparison
equal deleted inserted replaced
407:9eb1fc6aad6c 408:ad6be5454067
7 7
8 // Let the heap grow upwards.. 8 // Let the heap grow upwards..
9 9
10 function void init() 10 function void init()
11 { 11 {
12 ptr = 0x80000; 12 ptr = 0x60080000;
13 } 13 }
14 14
15 function byte* alloc(int size) 15 function byte* alloc(int size)
16 { 16 {
17 var int ptr2; 17 var int ptr2;
23 // Increment new free point: 23 // Increment new free point:
24 ptr = ptr + size; 24 ptr = ptr + size;
25 return ptr2; 25 return ptr2;
26 } 26 }
27 27
28 function byte* allocate_physical()
29 {
30 return 0;
31 }
32
33 function byte* allocate_virtual(byte* address)
34 {
35 var byte* address2;
36 address2 = allocate_physical();
37 return address2;
38 }
39
28 function void memcpy(byte* dst, byte* src, int size) 40 function void memcpy(byte* dst, byte* src, int size)
29 { 41 {
30 var int i; 42 var int i;
31 for (i = 0; i < size; i = i + 1) 43 io.print2("memcpy to ", cast<int>(dst));
44 io.print2("memcpy from ", cast<int>(src));
45 for (i = 0; i < size; i += 1)
32 { 46 {
33 *(dst + i) = *(src + i); 47 *(dst + i) = *(src + i);
34 } 48 }
35 } 49 }
36 50