diff --git a/userspace/libc.c b/userspace/libc.c index deac602..e39b93b 100644 --- a/userspace/libc.c +++ b/userspace/libc.c @@ -42,12 +42,13 @@ void *memcpy(void *dst0, const void *src0, size_t len0) #else char *dst = dst0; const char *src = src0; - long *aligned_dst; - const long *aligned_src; /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */ if (!TOO_SMALL(len0) && !UNALIGNED(src, dst)) { + long *aligned_dst; + const long *aligned_src; + aligned_dst = (long *)dst; aligned_src = (long *)src; diff --git a/userspace/main_user.c b/userspace/main_user.c index 3d4925f..b31292f 100644 --- a/userspace/main_user.c +++ b/userspace/main_user.c @@ -5,11 +5,11 @@ int func_help() { printf("\nAvailable Commands:\n"); - printf(" suicide\n"); - printf(" help\n"); - printf(" syscall5\n"); - printf(" alloc\n"); - printf(" tiny: a tiny C interpreter\n"); + printf(" help: this help\n"); + printf(" suicide: userspace self kill\n"); + printf(" syscall5: a syscall with parameters over the stack \n"); + printf(" alloc: test allocation\n"); + printf(" tiny: a tiny C-like interpreter\n"); return 0; } @@ -21,7 +21,7 @@ int func_suicide() return 0; } -void *initialHeap = 0; +char *initialHeap = 0; int func_alloc() { @@ -30,7 +30,7 @@ int func_alloc() } printf("Testing allocation\n"); int allocSize = 4096 * 2; - void *currentHeap = brk(0); + char *currentHeap = brk(0); if (currentHeap - initialHeap < allocSize) { brk(initialHeap + allocSize); } diff --git a/userspace/tiny.c b/userspace/tiny.c index 52f11a8..196d242 100644 --- a/userspace/tiny.c +++ b/userspace/tiny.c @@ -284,6 +284,7 @@ void run() int func_tiny() { + printf("Enter your program then ESC\n\n"); printf("TinyC grammar\n"); printf(" ::= \n"); printf(" ::= \"if\" |\n");