basic heap implementation
[cortex-from-scratch] / term.c
diff --git a/term.c b/term.c
index d1a6431..92017e6 100644 (file)
--- a/term.c
+++ b/term.c
@@ -21,6 +21,8 @@
 #include <lib/regfunc.h>
 #include <lib/tinyprintf.h>
 
+#include <lib/pool.h>
+
 #include <drivers/led.h>
 
 #define SERIAL 1
@@ -41,7 +43,6 @@
 
 static char buf[BUFSIZE];
 
-
 struct cmd {
        char * name;
        int (*function)(int argc, char ** argsv);
@@ -83,6 +84,12 @@ int showmem(int argc, char ** argsv) {
        
        }
 
+       extern mem_pool_t kheap_pool;
+       int * a = kalloc(&kheap_pool);
+       *a = argc;
+       printf("%d\n", *a);
+       printf("%p\n", a);
+
        return 0;
 }