Index: kernel/test/fpu/mips2.c
===================================================================
--- kernel/test/fpu/mips2.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/fpu/mips2.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -46,4 +46,5 @@
 static atomic_t threads_fault;
 static waitq_t can_start;
+static bool sh_quiet;
 
 static void testit1(void *data)
@@ -71,5 +72,6 @@
 		
 		if (arg != after_arg) {
-			printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+			if (!sh_quiet)
+				printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -102,5 +104,6 @@
 		
 		if (arg != after_arg) {
-			printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+			if (!sh_quiet)
+				printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -114,9 +117,12 @@
 {
 	unsigned int i, total = 0;
+	sh_quiet = quiet;
 	
 	waitq_initialize(&can_start);
 	atomic_set(&threads_ok, 0);
 	atomic_set(&threads_fault, 0);
-	printf("Creating %d threads... ", 2 * THREADS);
+	
+	if (!quiet)
+		printf("Creating %d threads... ", 2 * THREADS);
 
 	for (i = 0; i < THREADS; i++) {
@@ -124,5 +130,6 @@
 		
 		if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
-			printf("could not create thread %d\n", 2 * i);
+			if (!quiet)
+				printf("could not create thread %d\n", 2 * i);
 			break;
 		}
@@ -131,5 +138,6 @@
 		
 		if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
-			printf("could not create thread %d\n", 2 * i + 1);
+			if (!quiet)
+				printf("could not create thread %d\n", 2 * i + 1);
 			break;
 		}
@@ -137,5 +145,7 @@
 		total++;
 	}
-	printf("ok\n");
+	
+	if (!quiet)
+		printf("ok\n");
 		
 	thread_sleep(1);
@@ -143,5 +153,6 @@
 	
 	while (atomic_get(&threads_ok) != total) {
-		printf("Threads left: %d\n", total - atomic_get(&threads_ok));
+		if (!quiet)
+			printf("Threads left: %d\n", total - atomic_get(&threads_ok));
 		thread_sleep(1);
 	}
Index: kernel/test/mm/falloc1.c
===================================================================
--- kernel/test/mm/falloc1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/mm/falloc1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -56,5 +56,7 @@
 	for (run = 0; run < TEST_RUNS; run++) {
 		for (order = 0; order <= MAX_ORDER; order++) {
-			printf("Allocating %d frames blocks ... ", 1 << order);
+			if (!quiet)
+				printf("Allocating %d frames blocks ... ", 1 << order);
+			
 			allocated = 0;
 			for (i = 0; i < MAX_FRAMES >> order; i++) {
@@ -62,5 +64,6 @@
 				
 				if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
-					printf("Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
+					if (!quiet)
+						printf("Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
 					return "Test failed";
 				}
@@ -69,10 +72,12 @@
 					allocated++;
 				else {
-					printf("done. ");
+					if (!quiet)
+						printf("done. ");
 					break;
 				}
 			}
 			
-			printf("%d blocks allocated.\n", allocated);
+			if (!quiet)
+				printf("%d blocks allocated.\n", allocated);
 		
 			if (run) {
@@ -82,8 +87,12 @@
 				results[order] = allocated;
 			
-			printf("Deallocating ... ");
+			if (!quiet)
+				printf("Deallocating ... ");
+			
 			for (i = 0; i < allocated; i++)
 				frame_free(KA2PA(frames[i]));
-			printf("done.\n");
+			
+			if (!quiet)
+				printf("done.\n");
 		}
 	}
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/mm/falloc2.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -48,4 +48,5 @@
 static atomic_t thread_count;
 static atomic_t thread_fail;
+static bool sh_quiet;
 
 static void falloc(void * arg)
@@ -57,5 +58,6 @@
 	uintptr_t * frames =  (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC);
 	if (frames == NULL) {
-		printf("Thread #%d (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
+		if (!sh_quiet)
+			printf("Thread #%d (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
 		atomic_inc(&thread_fail);
 		atomic_dec(&thread_count);
@@ -67,5 +69,7 @@
 	for (run = 0; run < THREAD_RUNS; run++) {
 		for (order = 0; order <= MAX_ORDER; order++) {
-			printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
+			if (!sh_quiet)
+				printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
+			
 			allocated = 0;
 			for (i = 0; i < (MAX_FRAMES >> order); i++) {
@@ -77,11 +81,16 @@
 					break;
 			}
-			printf("Thread #%d (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
-
-			printf("Thread #%d (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
+			
+			if (!sh_quiet)
+				printf("Thread #%d (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
+			
+			if (!sh_quiet)
+				printf("Thread #%d (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
+			
 			for (i = 0; i < allocated; i++) {
 				for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
 					if (((uint8_t *) frames[i])[k] != val) {
-						printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
+						if (!sh_quiet)
+							printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
 						atomic_inc(&thread_fail);
 						goto cleanup;
@@ -90,5 +99,7 @@
 				frame_free(KA2PA(frames[i]));
 			}
-			printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
+			
+			if (!sh_quiet)
+				printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
 		}
 	}
@@ -96,5 +107,7 @@
 cleanup:	
 	free(frames);
-	printf("Thread #%d (cpu%d): Exiting\n", THREAD->tid, CPU->id);
+	
+	if (!sh_quiet)
+		printf("Thread #%d (cpu%d): Exiting\n", THREAD->tid, CPU->id);
 	atomic_dec(&thread_count);
 }
@@ -103,4 +116,5 @@
 {
 	unsigned int i;
+	sh_quiet = quiet;
 
 	atomic_set(&thread_count, THREADS);
@@ -110,5 +124,6 @@
 		thread_t * thrd = thread_create(falloc, NULL, TASK, 0, "falloc", false);
 		if (!thrd) {
-			printf("Could not create thread %d\n", i);
+			if (!quiet)
+				printf("Could not create thread %d\n", i);
 			break;
 		}
@@ -117,5 +132,6 @@
 	
 	while (atomic_get(&thread_count) > 0) {
-		printf("Threads left: %d\n", atomic_get(&thread_count));
+		if (!quiet)
+			printf("Threads left: %d\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/mm/mapping1.c
===================================================================
--- kernel/test/mm/mapping1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/mm/mapping1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -49,17 +49,25 @@
 	frame0 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
 	frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
-
-	printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
+	
+	if (!quiet)
+		printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
 	*((uint32_t *) frame0) = VALUE0;
-	printf("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
+	if (!quiet)
+		printf("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
 	*((uint32_t *) frame1) = VALUE1;
 	
-	printf("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
+	if (!quiet)
+		printf("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
 	page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE);
-	printf("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1));	
+	if (!quiet)
+		printf("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1));	
 	page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
 	
-	printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((uint32_t *) PAGE0));
-	printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1));
+	v0 = *((uint32_t *) PAGE0);
+	v1 = *((uint32_t *) PAGE1);
+	if (!quiet) {
+		printf("Value at virtual address %p is %#x.\n", PAGE0, v0);
+		printf("Value at virtual address %p is %#x.\n", PAGE1, v1);
+	}
 	
 	if (v0 != VALUE0)
@@ -67,8 +75,10 @@
 	if (v1 != VALUE1)
 		return "Value at v1 not equal to VALUE1";
-
-	printf("Writing %#x to virtual address %p.\n", 0, PAGE0);
+	
+	if (!quiet)
+		printf("Writing %#x to virtual address %p.\n", 0, PAGE0);
 	*((uint32_t *) PAGE0) = 0;
-	printf("Writing %#x to virtual address %p.\n", 0, PAGE1);
+	if (!quiet)
+		printf("Writing %#x to virtual address %p.\n", 0, PAGE1);
 	*((uint32_t *) PAGE1) = 0;	
 
@@ -76,6 +86,8 @@
 	v1 = *((uint32_t *) PAGE1);
 	
-	printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0));	
-	printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
+	if (!quiet) {
+		printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0));	
+		printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
+	}
 
 	if (v0 != 0)
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/mm/slab1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -38,63 +38,85 @@
 static void * data[VAL_COUNT];
 
-static void testit(int size, int count) 
+static void testit(int size, int count, bool quiet) 
 {
 	slab_cache_t *cache;
 	int i;
 	
-	printf("Creating cache, object size: %d.\n", size);
-	cache = slab_cache_create("test_cache", size, 0, NULL, NULL, 
-				  SLAB_CACHE_NOMAGAZINE);	
-	printf("Allocating %d items...", count);
+	if (!quiet)
+		printf("Creating cache, object size: %d.\n", size);
+	
+	cache = slab_cache_create("test_cache", size, 0, NULL, NULL,
+				SLAB_CACHE_NOMAGAZINE);
+	
+	if (!quiet)
+		printf("Allocating %d items...", count);
+	
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb((uintptr_t) data[i], size, 0);
 	}
-	printf("done.\n");
-	printf("Freeing %d items...", count);
-	for (i = 0; i < count; i++) {
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Freeing %d items...", count);
+	}
+	
+	for (i = 0; i < count; i++)
 		slab_free(cache, data[i]);
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Allocating %d items...", count);
 	}
-	printf("done.\n");
-
-	printf("Allocating %d items...", count);
+	
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb((uintptr_t) data[i], size, 0);
 	}
-	printf("done.\n");
-
-	printf("Freeing %d items...", count / 2);
-	for (i = count - 1; i >= count / 2; i--) {
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Freeing %d items...", count / 2);
+	}
+	
+	for (i = count - 1; i >= count / 2; i--)
 		slab_free(cache, data[i]);
+	
+	if (!quiet) {
+		printf("done.\n");	
+		printf("Allocating %d items...", count / 2);
 	}
-	printf("done.\n");	
-
-	printf("Allocating %d items...", count / 2);
+	
 	for (i = count / 2; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb((uintptr_t) data[i], size, 0);
 	}
-	printf("done.\n");
-	printf("Freeing %d items...", count);
-	for (i = 0; i < count; i++) {
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Freeing %d items...", count);
+	}
+	
+	for (i = 0; i < count; i++)
 		slab_free(cache, data[i]);
-	}
-	printf("done.\n");	
+	
+	if (!quiet)
+		printf("done.\n");	
 	slab_cache_destroy(cache);
-
-	printf("Test complete.\n");
+	
+	if (!quiet)
+		printf("Test complete.\n");
 }
 
-static void testsimple(void)
+static void testsimple(bool quiet)
 {
-	testit(100, VAL_COUNT);
-	testit(200, VAL_COUNT);
-	testit(1024, VAL_COUNT);
-	testit(2048, 512);
-	testit(4000, 128);
-	testit(8192, 128);
-	testit(16384, 128);
-	testit(16385, 128);
+	testit(100, VAL_COUNT, quiet);
+	testit(200, VAL_COUNT, quiet);
+	testit(1024, VAL_COUNT, quiet);
+	testit(2048, 512, quiet);
+	testit(4000, 128, quiet);
+	testit(8192, 128, quiet);
+	testit(16384, 128, quiet);
+	testit(16385, 128, quiet);
 }
 
@@ -106,4 +128,5 @@
 static slab_cache_t *thr_cache;
 static semaphore_t thr_sem;
+static bool sh_quiet;
 
 static void slabtest(void *data)
@@ -114,5 +137,7 @@
 	thread_detach(THREAD);
 	
-	printf("Starting thread #%d...\n",THREAD->tid);
+	if (!sh_quiet)
+		printf("Starting thread #%d...\n", THREAD->tid);
+	
 	for (j = 0; j < 10; j++) {
 		for (i = 0; i < THR_MEM_COUNT; i++)
@@ -125,21 +150,24 @@
 			slab_free(thr_cache, thr_data[offs][i]);
 	}
-	printf("Thread #%d finished\n", THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("Thread #%d finished\n", THREAD->tid);
+	
 	semaphore_up(&thr_sem);
 }
 
-static void testthreads(void)
+static void testthreads(bool quiet)
 {
 	thread_t *t;
 	int i;
 
-	thr_cache = slab_cache_create("thread_cache", THR_MEM_SIZE, 0, 
-				      NULL, NULL, 
-				      SLAB_CACHE_NOMAGAZINE);
+	thr_cache = slab_cache_create("thread_cache", THR_MEM_SIZE, 0, NULL, NULL,
+					SLAB_CACHE_NOMAGAZINE);
 	semaphore_initialize(&thr_sem, 0);
 	for (i = 0; i < THREADS; i++) {  
-		if (!(t = thread_create(slabtest, (void *) (unative_t) i, TASK, 0, "slabtest", false)))
-			printf("Could not create thread %d\n", i);
-		else
+		if (!(t = thread_create(slabtest, (void *) (unative_t) i, TASK, 0, "slabtest", false))) {
+			if (!quiet)
+				printf("Could not create thread %d\n", i);
+		} else
 			thread_ready(t);
 	}
@@ -149,12 +177,15 @@
 	
 	slab_cache_destroy(thr_cache);
-	printf("Test complete.\n");
 	
+	if (!quiet)
+		printf("Test complete.\n");
 }
 
 char * test_slab1(bool quiet)
 {
-	testsimple();
-	testthreads();
+	sh_quiet = quiet;
+	
+	testsimple(quiet);
+	testthreads(quiet);
 	
 	return NULL;
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/mm/slab2.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -43,5 +43,5 @@
  *  now allocation should clean magazines and allow for full allocation.
  */
-static void totalmemtest(void)
+static void totalmemtest(bool quiet)
 {
 	slab_cache_t *cache1;
@@ -50,66 +50,82 @@
 
 	void *data1, *data2;
-	void *olddata1=NULL, *olddata2=NULL;
+	void *olddata1 = NULL, *olddata2 = NULL;
 	
 	cache1 = slab_cache_create("cache1_tst", ITEM_SIZE, 0, NULL, NULL, 0);
 	cache2 = slab_cache_create("cache2_tst", ITEM_SIZE, 0, NULL, NULL, 0);
-
-	printf("Allocating...");
+	
+	if (!quiet)
+		printf("Allocating...");
+	
 	/* Use atomic alloc, so that we find end of memory */
 	do {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
 		data2 = slab_alloc(cache2, FRAME_ATOMIC);
-		if (!data1 || !data2) {
+		if ((!data1) || (!data2)) {
 			if (data1)
-				slab_free(cache1,data1);
+				slab_free(cache1, data1);
 			if (data2)
-				slab_free(cache2,data2);
+				slab_free(cache2, data2);
 			break;
 		}
-		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
-		memsetb((uintptr_t)data2, ITEM_SIZE, 0);
-		*((void **)data1) = olddata1;
-		*((void **)data2) = olddata2;
+		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
+		memsetb((uintptr_t) data2, ITEM_SIZE, 0);
+		*((void **) data1) = olddata1;
+		*((void **) data2) = olddata2;
 		olddata1 = data1;
 		olddata2 = data2;
-	} while(1);
-	printf("done.\n");
+	} while (1);
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Deallocating cache2...");
+	}
+	
 	/* We do not have memory - now deallocate cache2 */
-	printf("Deallocating cache2...");
 	while (olddata2) {
-		data2 = *((void **)olddata2);
+		data2 = *((void **) olddata2);
 		slab_free(cache2, olddata2);
 		olddata2 = data2;
 	}
-	printf("done.\n");
-
-	printf("Allocating to cache1...\n");
-	for (i=0; i<30; i++) {
+	
+	if (!quiet) {
+		printf("done.\n");
+		printf("Allocating to cache1...\n");
+	}
+	
+	for (i = 0; i < 30; i++) {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
 		if (!data1) {
-			printf("Incorrect memory size - use another test.");
+			if (!quiet)
+				printf("Incorrect memory size - use another test.");
 			return;
 		}
-		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
-		*((void **)data1) = olddata1;
+		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
+		*((void **) data1) = olddata1;
 		olddata1 = data1;
 	}
 	while (1) {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
-		if (!data1) {
-			break;
-		}
-		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
-		*((void **)data1) = olddata1;
-		olddata1 = data1;
-	}
-	printf("Deallocating cache1...");
+		if (!data1)
+			break;
+		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
+		*((void **) data1) = olddata1;
+		olddata1 = data1;
+	}
+	
+	if (!quiet)
+		printf("Deallocating cache1...");
+	
 	while (olddata1) {
-		data1 = *((void **)olddata1);
+		data1 = *((void **) olddata1);
 		slab_free(cache1, olddata1);
 		olddata1 = data1;
 	}
-	printf("done.\n");
-	slab_print_list();
+	
+	if (!quiet) {
+		printf("done.\n");
+		slab_print_list();
+	}
+	
 	slab_cache_destroy(cache1);
 	slab_cache_destroy(cache2);
@@ -120,4 +136,5 @@
 static condvar_t thread_starter;
 static mutex_t starter_mutex;
+static bool sh_quiet;
 
 #define THREADS 8
@@ -126,15 +143,18 @@
 {
 	void *data = NULL, *new;
-
+	
 	thread_detach(THREAD);
-
+	
 	mutex_lock(&starter_mutex);
 	condvar_wait(&thread_starter,&starter_mutex);
 	mutex_unlock(&starter_mutex);
-		
-	printf("Starting thread #%d...\n",THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("Starting thread #%d...\n",THREAD->tid);
 
 	/* Alloc all */
-	printf("Thread #%d allocating...\n", THREAD->tid);
+	if (!sh_quiet)
+		printf("Thread #%d allocating...\n", THREAD->tid);
+	
 	while (1) {
 		/* Call with atomic to detect end of memory */
@@ -142,15 +162,21 @@
 		if (!new)
 			break;
-		*((void **)new) = data;
-		data = new;
-	}
-	printf("Thread #%d releasing...\n", THREAD->tid);
+		*((void **) new) = data;
+		data = new;
+	}
+	
+	if (!sh_quiet)
+		printf("Thread #%d releasing...\n", THREAD->tid);
+	
 	while (data) {
 		new = *((void **)data);
-		*((void **)data) = NULL;
+		*((void **) data) = NULL;
 		slab_free(thr_cache, data);
 		data = new;
 	}
-	printf("Thread #%d allocating...\n", THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("Thread #%d allocating...\n", THREAD->tid);
+	
 	while (1) {
 		/* Call with atomic to detect end of memory */
@@ -158,21 +184,26 @@
 		if (!new)
 			break;
-		*((void **)new) = data;
-		data = new;
-	}
-	printf("Thread #%d releasing...\n", THREAD->tid);
+		*((void **) new) = data;
+		data = new;
+	}
+	
+	if (!sh_quiet)
+		printf("Thread #%d releasing...\n", THREAD->tid);
+	
 	while (data) {
 		new = *((void **)data);
-		*((void **)data) = NULL;
+		*((void **) data) = NULL;
 		slab_free(thr_cache, data);
 		data = new;
 	}
-
-	printf("Thread #%d finished\n", THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("Thread #%d finished\n", THREAD->tid);
+	
 	slab_print_list();
 	semaphore_up(&thr_sem);
 }
 
-static void multitest(int size)
+static void multitest(int size, bool quiet)
 {
 	/* Start 8 threads that just allocate as much as possible,
@@ -181,17 +212,18 @@
 	thread_t *t;
 	int i;
-
-	printf("Running stress test with size %d\n", size);
+	
+	if (!quiet)
+		printf("Running stress test with size %d\n", size);
+	
 	condvar_initialize(&thread_starter);
 	mutex_initialize(&starter_mutex);
 
-	thr_cache = slab_cache_create("thread_cache", size, 0, 
-				      NULL, NULL, 
-				      0);
+	thr_cache = slab_cache_create("thread_cache", size, 0, NULL, NULL, 0);
 	semaphore_initialize(&thr_sem,0);
 	for (i = 0; i < THREADS; i++) {  
-		if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest", false)))
-			printf("Could not create thread %d\n", i);
-		else
+		if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest", false))) {
+			if (!quiet)
+				printf("Could not create thread %d\n", i);
+		} else
 			thread_ready(t);
 	}
@@ -203,19 +235,24 @@
 	
 	slab_cache_destroy(thr_cache);
-	printf("Stress test complete.\n");
+	if (!quiet)
+		printf("Stress test complete.\n");
 }
 
 char * test_slab2(bool quiet)
 {
-	printf("Running reclaim single-thread test .. pass 1\n");
-	totalmemtest();
-	printf("Running reclaim single-thread test .. pass 2\n");
-	totalmemtest();
-	printf("Reclaim test OK.\n");
-
-	multitest(128);
-	multitest(2048);
-	multitest(8192);
-	printf("All done.\n");
+	sh_quiet = quiet;
+	
+	if (!quiet)
+		printf("Running reclaim single-thread test .. pass 1\n");
+	totalmemtest(quiet);
+	if (!quiet)
+		printf("Running reclaim single-thread test .. pass 2\n");
+	totalmemtest(quiet);
+	if (!quiet)
+		printf("Reclaim test OK.\n");
+	
+	multitest(128, quiet);
+	multitest(2048, quiet);
+	multitest(8192, quiet);
 	
 	return NULL;
Index: kernel/test/print/print1.c
===================================================================
--- kernel/test/print/print1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/print/print1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -33,36 +33,38 @@
 char * test_print1(bool quiet)
 {
-	int retval;
-	unative_t nat = 0x12345678u;
-	
-	char buffer[BUFFER_SIZE];
-	
-	printf(" text 10.8s %*.*s \n", 5, 3, "text");
-	printf(" very long text 10.8s %10.8s \n", "very long text");
-	printf(" text 8.10s %8.10s \n", "text");
-	printf(" very long text 8.10s %8.10s \n", "very long text");
-
-	printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n",'a', 'b', 'c', 'd', 'e' );
-	printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",1, 1, 1, 1, 1 );
-	printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",-1, -1, -1, -1, -1 );
-	printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n",17, 17, 17, 17, 17 );
-
-	printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
-	
-	printf(" Print to NULL '%s'\n", NULL);
-
-	retval = snprintf(buffer, BUFFER_SIZE, "Short text without parameters.");
-	printf("Result is: '%s', retval = %d\n", buffer, retval);
-
-	retval = snprintf(buffer, BUFFER_SIZE, "Very very very long text without parameters.");
-	printf("Result is: '%s', retval = %d\n", buffer, retval);
-	
-	printf("Print short text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
-	retval = snprintf(buffer, BUFFER_SIZE, "Short %s", "text");
-	printf("Result is: '%s', retval = %d\n", buffer, retval);
-	
-	printf("Print long text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
-	retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text`s length is more than %d. We are interested in the result.", "text" , BUFFER_SIZE);
-	printf("Result is: '%s', retval = %d\n", buffer, retval);
+	if (!quiet) {
+		int retval;
+		unative_t nat = 0x12345678u;
+		
+		char buffer[BUFFER_SIZE];
+		
+		printf(" text 10.8s %*.*s \n", 5, 3, "text");
+		printf(" very long text 10.8s %10.8s \n", "very long text");
+		printf(" text 8.10s %8.10s \n", "text");
+		printf(" very long text 8.10s %8.10s \n", "very long text");
+		
+		printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n",'a', 'b', 'c', 'd', 'e' );
+		printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",1, 1, 1, 1, 1 );
+		printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",-1, -1, -1, -1, -1 );
+		printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n",17, 17, 17, 17, 17 );
+		
+		printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
+		
+		printf(" Print to NULL '%s'\n", NULL);
+		
+		retval = snprintf(buffer, BUFFER_SIZE, "Short text without parameters.");
+		printf("Result is: '%s', retval = %d\n", buffer, retval);
+		
+		retval = snprintf(buffer, BUFFER_SIZE, "Very very very long text without parameters.");
+		printf("Result is: '%s', retval = %d\n", buffer, retval);
+		
+		printf("Print short text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
+		retval = snprintf(buffer, BUFFER_SIZE, "Short %s", "text");
+		printf("Result is: '%s', retval = %d\n", buffer, retval);
+		
+		printf("Print long text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
+		retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text`s length is more than %d. We are interested in the result.", "text" , BUFFER_SIZE);
+		printf("Result is: '%s', retval = %d\n", buffer, retval);
+	}
 	
 	return NULL;
Index: kernel/test/synch/rwlock1.c
===================================================================
--- kernel/test/synch/rwlock1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/synch/rwlock1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -60,5 +60,4 @@
 	rwlock_read_unlock(&rwlock);
 	
-	
 	rwlock_write_lock(&rwlock);
 	rwlock_write_unlock(&rwlock);	
Index: kernel/test/synch/rwlock2.c
===================================================================
--- kernel/test/synch/rwlock2.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/synch/rwlock2.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -39,19 +39,19 @@
 
 static rwlock_t rwlock;
+static bool sh_quiet;
 
 static void writer(void *arg)
 {
-
-	thread_detach(THREAD);
-
-	printf("Trying to lock rwlock for writing....\n");    
-
+	if (!sh_quiet)
+		printf("Trying to lock rwlock for writing....\n");
+	
 	rwlock_write_lock(&rwlock);
 	rwlock_write_unlock(&rwlock);
 	
-	printf("Trying to lock rwlock for reading....\n");    	
+	if (!sh_quiet)
+		printf("Trying to lock rwlock for reading....\n");
+	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_unlock(&rwlock);	
-	printf("Test passed.\n");
 }
 
@@ -59,4 +59,5 @@
 {
 	thread_t *thrd;
+	sh_quiet = quiet;
 	
 	rwlock_initialize(&rwlock);
@@ -80,4 +81,7 @@
 	rwlock_read_unlock(&rwlock);
 	
+	thread_join(thrd);
+	thread_detach(thrd);
+	
 	return NULL;
 }
Index: kernel/test/synch/rwlock3.c
===================================================================
--- kernel/test/synch/rwlock3.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/synch/rwlock3.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -35,23 +35,32 @@
 #include <synch/rwlock.h>
 
-#define READERS		50
-#define WRITERS		50
+#define THREADS	4
 
+static atomic_t thread_count;
 static rwlock_t rwlock;
+static bool sh_quiet;
 
 static void reader(void *arg)
 {
 	thread_detach(THREAD);
-
-	printf("cpu%d, tid %d: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);    	
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
+	
 	rwlock_read_lock(&rwlock);
-	rwlock_read_unlock(&rwlock);	
-	printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);    		
-
-	printf("cpu%d, tid %d: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);    	
+	rwlock_read_unlock(&rwlock);
+	
+	if (!sh_quiet) {
+		printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);    		
+		printf("cpu%d, tid %d: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);    	
+	}
 
 	rwlock_write_lock(&rwlock);
 	rwlock_write_unlock(&rwlock);
-	printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);    			
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);
+	
+	atomic_dec(&thread_count);
 }
 
@@ -60,19 +69,27 @@
 	int i;
 	thread_t *thrd;
+	sh_quiet = quiet;
+	
+	atomic_set(&thread_count, THREADS);
 	
 	rwlock_initialize(&rwlock);
 	rwlock_write_lock(&rwlock);
 	
-	for (i = 0; i < 4; i++) {
+	for (i = 0; i < THREADS; i++) {
 		thrd = thread_create(reader, NULL, TASK, 0, "reader", false);
 		if (thrd)
 			thread_ready(thrd);
-		else
+		else if (!quiet)
 			printf("Could not create reader %d\n", i);
 	}
 
 	thread_sleep(1);
+	rwlock_write_unlock(&rwlock);
 	
-	rwlock_write_unlock(&rwlock);
+	while (atomic_get(&thread_count) > 0) {
+		if (!quiet)
+			printf("Threads left: %d\n", atomic_get(&thread_count));
+		thread_sleep(1);
+	}
 	
 	return NULL;
Index: kernel/test/synch/rwlock4.c
===================================================================
--- kernel/test/synch/rwlock4.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/synch/rwlock4.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -44,6 +44,8 @@
 #define WRITERS		50
 
+static atomic_t thread_count;
 static rwlock_t rwlock;
 static atomic_t threads_fault;
+static bool sh_quiet;
 
 SPINLOCK_INITIALIZE(rw_lock);
@@ -71,26 +73,40 @@
 
 	to = random(40000);
-	printf("cpu%d, tid %d w+ (%d)\n", CPU->id, THREAD->tid, to);
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d w+ (%d)\n", CPU->id, THREAD->tid, to);
+	
 	rc = rwlock_write_lock_timeout(&rwlock, to);
 	if (SYNCH_FAILED(rc)) {
-		printf("cpu%d, tid %d w!\n", CPU->id, THREAD->tid);
+		if (!sh_quiet)
+			printf("cpu%d, tid %d w!\n", CPU->id, THREAD->tid);
+		atomic_dec(&thread_count);
 		return;
 	}
-	printf("cpu%d, tid %d w=\n", CPU->id, THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d w=\n", CPU->id, THREAD->tid);
 
 	if (rwlock.readers_in) {
-		printf("Oops.");
+		if (!sh_quiet)
+			printf("Oops.");
 		atomic_inc(&threads_fault);
+		atomic_dec(&thread_count);
 		return;
 	}
 	thread_usleep(random(1000000));
 	if (rwlock.readers_in) {
-		printf("Oops.");	
+		if (!sh_quiet)
+			printf("Oops.");	
 		atomic_inc(&threads_fault);
+		atomic_dec(&thread_count);
 		return;
 	}
 
 	rwlock_write_unlock(&rwlock);
-	printf("cpu%d, tid %d w-\n", CPU->id, THREAD->tid);	
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d w-\n", CPU->id, THREAD->tid);
+	atomic_dec(&thread_count);
 }
 
@@ -102,14 +118,25 @@
 	
 	to = random(2000);
-	printf("cpu%d, tid %d r+ (%d)\n", CPU->id, THREAD->tid, to);
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d r+ (%d)\n", CPU->id, THREAD->tid, to);
+	
 	rc = rwlock_read_lock_timeout(&rwlock, to);
 	if (SYNCH_FAILED(rc)) {
-		printf("cpu%d, tid %d r!\n", CPU->id, THREAD->tid);
+		if (!sh_quiet)
+			printf("cpu%d, tid %d r!\n", CPU->id, THREAD->tid);
+		atomic_dec(&thread_count);
 		return;
 	}
-	printf("cpu%d, tid %d r=\n", CPU->id, THREAD->tid);
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d r=\n", CPU->id, THREAD->tid);
+	
 	thread_usleep(30000);
 	rwlock_read_unlock(&rwlock);
-	printf("cpu%d, tid %d r-\n", CPU->id, THREAD->tid);		
+	
+	if (!sh_quiet)
+		printf("cpu%d, tid %d r-\n", CPU->id, THREAD->tid);
+	atomic_dec(&thread_count);
 }
 
@@ -117,5 +144,6 @@
 {
 	context_t ctx;
-	uint32_t i, k;
+	uint32_t i;
+	sh_quiet = quiet;
 	
 	waitq_initialize(&can_start);
@@ -123,26 +151,33 @@
 	atomic_set(&threads_fault, 0);
 	
+	uint32_t rd = random(7) + 1;
+	uint32_t wr = random(5) + 1;
+	
+	atomic_set(&thread_count, rd + wr);
+	
 	thread_t *thrd;
 	
 	context_save(&ctx);
-	printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
+	if (!quiet) {
+		printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
+		printf("Creating %d readers\n", rd);
+	}
 	
-	k = random(7) + 1;
-	printf("Creating %d readers\n", k);
-	for (i = 0; i < k; i++) {
+	for (i = 0; i < rd; i++) {
 		thrd = thread_create(reader, NULL, TASK, 0, "reader", false);
 		if (thrd)
 			thread_ready(thrd);
-		else
+		else if (!quiet)
 			printf("Could not create reader %d\n", i);
 	}
 
-	k = random(5) + 1;
-	printf("Creating %d writers\n", k);
-	for (i = 0; i < k; i++) {
+	if (!quiet)
+		printf("Creating %d writers\n", wr);
+	
+	for (i = 0; i < wr; i++) {
 		thrd = thread_create(writer, NULL, TASK, 0, "writer", false);
 		if (thrd)
 			thread_ready(thrd);
-		else
+		else if (!quiet)
 			printf("Could not create writer %d\n", i);
 	}
@@ -151,4 +186,10 @@
 	waitq_wakeup(&can_start, WAKEUP_ALL);
 	
+	while (atomic_get(&thread_count) > 0) {
+		if (!quiet)
+			printf("Threads left: %d\n", atomic_get(&thread_count));
+		thread_sleep(1);
+	}
+	
 	if (atomic_get(&threads_fault) == 0)
 		return NULL;
Index: kernel/test/sysinfo/sysinfo1.c
===================================================================
--- kernel/test/sysinfo/sysinfo1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/sysinfo/sysinfo1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -35,5 +35,6 @@
 char * test_sysinfo1(bool quiet)
 {
-	sysinfo_dump(NULL, 0);
+	if (!quiet)
+		sysinfo_dump(NULL, 0);
 	return NULL;
 }
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision c8410ec9f0d3f0ee180b616cb46f74dd729e0723)
+++ kernel/test/thread/thread1.c	(revision 33c0c649a09f3bb9a6bdecc8a3c62eaae91bad68)
@@ -41,4 +41,5 @@
 static atomic_t finish;
 static atomic_t threads_finished;
+static bool sh_quiet;
 
 static void threadtest(void *data)
@@ -47,5 +48,6 @@
 
 	while (atomic_get(&finish)) {
-		printf("%d\n", (int) (THREAD->tid));
+		if (!sh_quiet)
+			printf("%d\n", (int) (THREAD->tid));
 		thread_usleep(100);
 	}
@@ -56,4 +58,5 @@
 {
 	unsigned int i, total = 0;
+	sh_quiet = quiet;
 	
 	atomic_set(&finish, 1);
@@ -63,5 +66,6 @@
 		thread_t *t;
 		if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest", false))) {
-			printf("Could not create thread %d\n", i);
+			if (!quiet)
+				printf("Could not create thread %d\n", i);
 			break;
 		}
@@ -70,10 +74,12 @@
 	}
 	
-	printf("Running threads for 10 seconds...\n");
+	if (!quiet)
+		printf("Running threads for 10 seconds...\n");
 	thread_sleep(10);
 	
 	atomic_set(&finish, 0);
 	while (atomic_get(&threads_finished) < total) {
-		printf("Threads left: %d\n", total - atomic_get(&threads_finished));
+		if (!quiet)
+			printf("Threads left: %d\n", total - atomic_get(&threads_finished));
 		thread_sleep(1);
 	}
