Index: test/fpu/fpu1/test.c
===================================================================
--- test/fpu/fpu1/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/fpu/fpu1/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -94,8 +94,8 @@
 
 		if((int)(100000000*e)!=E_10e8)
-			panic("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
+			panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
 	}
 
-	printf("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
+	printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
 	atomic_inc(&threads_ok);
 }
@@ -132,13 +132,13 @@
 #ifdef __ia64_ARCH_H__
 		if((int)(1000000*pi)!=PI_10e8)
-			panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
+			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
 #else
 		if((int)(100000000*pi)!=PI_10e8)
-			panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
+			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
 #endif
 
 	}
 
-	printf("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
+	printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
 	atomic_inc(&threads_ok);
 }
Index: test/mm/falloc1/test.c
===================================================================
--- test/mm/falloc1/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/mm/falloc1/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -60,5 +60,5 @@
 				
 				if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
-					panic("Test failed. Block at address %X (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
+					panic("Test failed. Block at address %P (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
 				}
 				
Index: test/mm/falloc2/test.c
===================================================================
--- test/mm/falloc2/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/mm/falloc2/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -78,5 +78,5 @@
 				for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
 					if (((__u8 *) frames[i])[k] != val) {
-						printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %X\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
+						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);
 						failed();
 					}
Index: test/mm/mapping1/test.c
===================================================================
--- test/mm/mapping1/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/mm/mapping1/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -51,7 +51,7 @@
 	frame1 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
 
-	printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
+	printf("Writing %#X to physical address %P.\n", VALUE0, KA2PA(frame0));
 	*((__u32 *) frame0) = VALUE0;
-	printf("Writing %L to physical address %P.\n", VALUE1, KA2PA(frame1));
+	printf("Writing %#X to physical address %P.\n", VALUE1, KA2PA(frame1));
 	*((__u32 *) frame1) = VALUE1;
 	
@@ -61,13 +61,13 @@
 	page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
 	
-	printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
-	printf("Value at virtual address %P is %L.\n", PAGE1, v1 = *((__u32 *) PAGE1));
+	printf("Value at virtual address %P is %#X.\n", PAGE0, v0 = *((__u32 *) PAGE0));
+	printf("Value at virtual address %P is %#X.\n", PAGE1, v1 = *((__u32 *) PAGE1));
 	
 	ASSERT(v0 == VALUE0);
 	ASSERT(v1 == VALUE1);
 
-	printf("Writing %X to virtual address %P.\n", 0, PAGE0);
+	printf("Writing %#X to virtual address %P.\n", 0, PAGE0);
 	*((__u32 *) PAGE0) = 0;
-	printf("Writing %X to virtual address %P.\n", 0, PAGE1);
+	printf("Writing %#X to virtual address %P.\n", 0, PAGE1);
 	*((__u32 *) PAGE1) = 0;	
 
@@ -75,6 +75,6 @@
 	v1 = *((__u32 *) PAGE1);
 	
-	printf("Value at virtual address %P is %X.\n", PAGE0, *((__u32 *) PAGE0));	
-	printf("Value at virtual address %P is %X.\n", PAGE1, *((__u32 *) PAGE1));
+	printf("Value at virtual address %P is %#X.\n", PAGE0, *((__u32 *) PAGE0));	
+	printf("Value at virtual address %P is %#X.\n", PAGE1, *((__u32 *) PAGE1));
 
 	ASSERT(v0 == 0);
Index: test/print/print1/test.c
===================================================================
--- test/print/print1/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/print/print1/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -31,11 +31,19 @@
 void test(void)
 {
+	__native nat = 0x12345678u;
 	printf(" Printf test \n");
-	printf(" Q  %Q  %q \n",0x1111111111111111ull, 0x2222222222222222ull);
-	printf(" Q,l  %Q  %l \n", 0x3333333333333333ull, 0x01234567);
-	printf(" l,Q  %l  %Q \n", 0x01234567, 0x4444444444444444ull);
-	printf(" L  %L  %l \n",0x01234567 ,0x01234567);   
-	printf(" W  %W  %w \n",0x0123 ,0x0123);   
-	printf(" B  %B  %b \n",0x01 ,0x01);
+	
+	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, __native '%#zX'. '%#llX' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
+	
 	printf(" Print to NULL '%s'\n",NULL);
 	return;
Index: test/synch/rwlock4/test.c
===================================================================
--- test/synch/rwlock4/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/synch/rwlock4/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -133,5 +133,5 @@
 		
 		context_save(&ctx);
-		printf("sp=%X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
+		printf("sp=%#X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
 		
 		k = random(7) + 1;
Index: test/synch/rwlock5/test.c
===================================================================
--- test/synch/rwlock5/test.c	(revision 5b04fc75c4e9e21145afd331bebd1892939b8ba2)
+++ test/synch/rwlock5/test.c	(revision c7c0b89b6e6a42abfe99e8cb5d3d5882ffdeac6e)
@@ -92,5 +92,5 @@
 		writers = (4-i)*WRITERS;
 
-		printf("Creating %d readers and %d writers...", readers, writers);
+		printf("Creating %ld readers and %ld writers...", readers, writers);
 		
 		for (j=0; j<(READERS+WRITERS)/2; j++) {
@@ -117,5 +117,5 @@
 	
 		while (items_read.count != readers || items_written.count != writers) {
-			printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
+			printf("%zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
 			thread_usleep(100000);
 		}
