Index: boot/Makefile
===================================================================
--- boot/Makefile	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/Makefile	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -68,4 +68,7 @@
 		cp "$$file" "$(DIST_PATH)/app/" ; \
 	done
+	for file in $(RD_DATA) ; do \
+		cp "$$file" "$(DIST_PATH)/" ; \
+	done
 ifeq ($(CONFIG_PCUT_TESTS),y)
 	echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all"
@@ -84,5 +87,5 @@
 	echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html"
 endif
-
+	
 ifeq ($(CONFIG_PCUT_SELF_TESTS),y)
 	echo "echo Running all PCUT self-tests..." >"$(DIST_PATH)/test/run_pcut"
@@ -102,5 +105,5 @@
 	echo "</ul></body></html>" >>"$(DIST_PATH)/test/pcut.html"
 endif
-
+	
 	for drv in $(RD_DRVS) ; do \
 		drv_dir="`dirname "$$drv"`" ; \
@@ -135,4 +138,5 @@
 clean_dist:
 	rm -f $(INITRD).img $(COMPS_H) $(COMPS_C) $(LINK) $(LINK).comp *.co
+	find $(USPACE_PATH)/dist -mindepth 1 -maxdepth 1 -type f -exec rm \{\} \;
 	rm -f $(USPACE_PATH)/dist/srv/*
 	rm -rf $(USPACE_PATH)/dist/drv/*
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/Makefile.common	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -237,4 +237,11 @@
 	$(USPACE_PATH)/app/bdsh/test-bdsh
 
+RD_DATA_ESSENTIAL = \
+	$(USPACE_PATH)/app/bdsh/demo.txt
+
+RD_DATA_NON_ESSENTIAL = \
+	$(USPACE_PATH)/app/modplay/demo.xm \
+	$(USPACE_PATH)/app/viewer/logo.tga
+
 
 COMPONENTS = \
@@ -254,4 +261,5 @@
 RD_DRVS = $(RD_DRVS_ESSENTIAL)
 RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL)
+RD_DATA = $(RD_DATA_ESSENTIAL)
 else
 RD_SRVS = $(RD_SRVS_ESSENTIAL) $(RD_SRVS_NON_ESSENTIAL)
@@ -259,4 +267,5 @@
 RD_DRVS = $(RD_DRVS_ESSENTIAL) $(RD_DRVS_NON_ESSENTIAL)
 RD_DRVS_FW = $(RD_DRVS_FW_ESSENTIAL) $(RD_DRVS_FW_NON_ESSENTIAL)
+RD_DATA = $(RD_DATA_ESSENTIAL) $(RD_DATA_NON_ESSENTIAL)
 endif
 
Index: boot/arch/amd64/Makefile.inc
===================================================================
--- boot/arch/amd64/Makefile.inc	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/amd64/Makefile.inc	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -66,4 +66,7 @@
 	$(USPACE_PATH)/app/wavplay/wavplay
 
+RD_DATA_NON_ESSENTIAL += \
+	$(USPACE_PATH)/app/wavplay/demo.wav
+
 BOOT_OUTPUT = $(ROOT_PATH)/image.iso
 PREBUILD = $(INITRD).img
Index: boot/arch/arm32/include/types.h
===================================================================
--- boot/arch/arm32/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/arm32/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -45,4 +45,6 @@
 typedef uint32_t pfn_t;
 
+typedef int32_t ptrdiff_t;
+
 typedef struct {
 	/** Address where the task was placed. */
Index: boot/arch/ia64/include/types.h
===================================================================
--- boot/arch/ia64/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/ia64/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -40,4 +40,6 @@
 typedef uint64_t uintptr_t;
 
+typedef int64_t ptrdiff_t;
+
 typedef struct {
 	void *addr;
Index: boot/arch/mips32/include/types.h
===================================================================
--- boot/arch/mips32/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/mips32/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -37,4 +37,6 @@
 typedef uint32_t uintptr_t;
 
+typedef int32_t ptrdiff_t;
+
 typedef struct {
 	/** Address where the task was placed. */
Index: boot/arch/ppc32/include/types.h
===================================================================
--- boot/arch/ppc32/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/ppc32/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -38,4 +38,6 @@
 typedef int32_t native_t;
 
+typedef int32_t ptrdiff_t;
+
 typedef struct {
 	void *addr;
Index: boot/arch/riscv64/include/types.h
===================================================================
--- boot/arch/riscv64/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/riscv64/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -37,4 +37,6 @@
 typedef uint64_t uintptr_t;
 
+typedef int64_t ptrdiff_t;
+
 typedef struct {
 	void *start;
Index: boot/arch/sparc64/include/types.h
===================================================================
--- boot/arch/sparc64/include/types.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/arch/sparc64/include/types.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -38,4 +38,6 @@
 typedef int64_t native_t;
 
+typedef int64_t ptrdiff_t;
+
 typedef struct {
 	void *addr;
Index: boot/generic/src/printf_core.c
===================================================================
--- boot/generic/src/printf_core.c	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ boot/generic/src/printf_core.c	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -605,7 +605,13 @@
 			
 			switch (uc) {
-			/** @todo Unimplemented qualifiers:
-			 *        t ptrdiff_t - ISO C 99
-			 */
+			case 't':
+				/* ptrdiff_t */
+				if (sizeof(ptrdiff_t) == sizeof(int32_t))
+					qualifier = PrintfQualifierInt;
+				else
+					qualifier = PrintfQualifierLongLong;
+				i = nxt;
+				uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
+				break;
 			case 'h':
 				/* Char or short */
Index: defaults/mips32/Makefile.config
===================================================================
--- defaults/mips32/Makefile.config	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ defaults/mips32/Makefile.config	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -44,4 +44,4 @@
 CONFIG_HID_OUT = generic
 
-# Barebone build with essential binaries only 
+# Barebone build with essential binaries only
 CONFIG_BAREBONE = y
Index: defaults/mips32/malta-be/Makefile.config
===================================================================
--- defaults/mips32/malta-be/Makefile.config	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ defaults/mips32/malta-be/Makefile.config	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -1,2 +1,2 @@
 # Machine type
-MACHINE = bmalta 
+MACHINE = bmalta
Index: defaults/mips32/malta-le/Makefile.config
===================================================================
--- defaults/mips32/malta-le/Makefile.config	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ defaults/mips32/malta-le/Makefile.config	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -1,2 +1,2 @@
 # Machine type
-MACHINE = lmalta 
+MACHINE = lmalta
Index: kernel/generic/include/typedefs.h
===================================================================
--- kernel/generic/include/typedefs.h	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ kernel/generic/include/typedefs.h	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -61,4 +61,6 @@
 typedef volatile uint32_t ioport32_t;
 
+typedef native_t ptrdiff_t;
+
 #ifdef __32_BITS__
 
Index: kernel/generic/src/printf/printf_core.c
===================================================================
--- kernel/generic/src/printf/printf_core.c	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ kernel/generic/src/printf/printf_core.c	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -733,7 +733,13 @@
 			
 			switch (uc) {
-			/** @todo Unimplemented qualifiers:
-			 *        t ptrdiff_t - ISO C 99
-			 */
+			case 't':
+				/* ptrdiff_t */
+				if (sizeof(ptrdiff_t) == sizeof(int32_t))
+					qualifier = PrintfQualifierInt;
+				else
+					qualifier = PrintfQualifierLongLong;
+				i = nxt;
+				uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
+				break;
 			case 'h':
 				/* Char or short */
Index: kernel/test/print/print2.c
===================================================================
--- kernel/test/print/print2.c	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ kernel/test/print/print2.c	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -52,4 +52,13 @@
 	TPRINTF("Real output:     [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21);
 	
+	char ch[12];
+	ptrdiff_t d, neg_d;
+	
+	d = &ch[0] - &ch[12];
+	neg_d = (unsigned)(-d);
+	TPRINTF("Testing printf(\"%%td %%tu %%tx %%ti %%to\", d, neg_d, neg_d, d, neg_d):\n");
+	TPRINTF("Expected output: [-12] [12] [c] [-12] [14]\n");
+	TPRINTF("Real output:     [%td] [%tu] [%tx] [%ti] [%to]\n\n", d, neg_d, neg_d, d, neg_d);
+	
 	sysarg_t nat = UINTN_C(0x12345678);
 	
Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ tools/autotool.py	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -925,5 +925,5 @@
 		# Platform-specific utilities
 		if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
-			common['GENISOIMAGE'] = check_app_alternatives(["mkisofs", "genisoimage", "xorriso"], ["--version"], "ISO 9660 creation utility", "usually part of genisoimage")
+			common['GENISOIMAGE'] = check_app_alternatives(["genisoimage", "mkisofs", "xorriso"], ["--version"], "ISO 9660 creation utility", "usually part of genisoimage")
 			if common['GENISOIMAGE'] == 'xorriso':
 				common['GENISOIMAGE'] += ' -as genisoimage'
Index: uspace/app/bdsh/demo.txt
===================================================================
--- uspace/app/bdsh/demo.txt	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
+++ uspace/app/bdsh/demo.txt	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -0,0 +1,10 @@
+Multilingual text test
+----------------------
+
+English:  Quick brown fox jumps over the lazy dog
+Czech:    Příliš žluťoučký kůň úpěl ďábelské ódy
+Greek:    Ὦ ξεῖν’, ἀγγέλλειν Λακεδαιμονίοις ὅτι τῇδε
+Hebrew:   משוואת ברנולי היא משוואה בהידרודינמיקה
+Arabic:   التوزيع الجغرافي للحمل العنقودي
+Russian:  Леннон познакомился с художницей-авангардисткой
+Armenian: Սկսեց հրատարակվել Երուսաղեմի հայկական
Index: uspace/app/modplay/Makefile
===================================================================
--- uspace/app/modplay/Makefile	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ uspace/app/modplay/Makefile	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -37,4 +37,5 @@
 	-I$(LIBHOUND_PREFIX)/include \
 	-I$(LIBPCM_PREFIX)/include
+
 BINARY = modplay
 
Index: uspace/app/tester/print/print2.c
===================================================================
--- uspace/app/tester/print/print2.c	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ uspace/app/tester/print/print2.c	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -53,4 +53,13 @@
 	TPRINTF("Real output:     [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21);
 	
+	char ch[12];
+	ptrdiff_t d, neg_d;
+	
+	d = &ch[0] - &ch[12];
+	neg_d = (unsigned)(-d);
+	TPRINTF("Testing printf(\"%%td %%tu %%tx %%ti %%to\", d, neg_d, neg_d, d, neg_d):\n");
+	TPRINTF("Expected output: [-12] [12] [c] [-12] [14]\n");
+	TPRINTF("Real output:     [%td] [%tu] [%tx] [%ti] [%to]\n\n", d, neg_d, neg_d, d, neg_d);
+	
 	return NULL;
 }
Index: pace/dist/demo.txt
===================================================================
--- uspace/dist/demo.txt	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ 	(revision )
@@ -1,10 +1,0 @@
-Multilingual text test
-----------------------
-
-English:  Quick brown fox jumps over the lazy dog
-Czech:    Příliš žluťoučký kůň úpěl ďábelské ódy
-Greek:    Ὦ ξεῖν’, ἀγγέλλειν Λακεδαιμονίοις ὅτι τῇδε
-Hebrew:   משוואת ברנולי היא משוואה בהידרודינמיקה
-Arabic:   التوزيع الجغرافي للحمل العنقودي
-Russian:  Леннон познакомился с художницей-авангардисткой
-Armenian: Սկսեց հրատարակվել Երուսաղեմի հայկական
Index: uspace/lib/c/generic/io/printf_core.c
===================================================================
--- uspace/lib/c/generic/io/printf_core.c	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ uspace/lib/c/generic/io/printf_core.c	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -1448,7 +1448,13 @@
 			
 			switch (uc) {
-			/** @todo Unimplemented qualifiers:
-			 *        t ptrdiff_t - ISO C 99
-			 */
+			case 't':
+				/* ptrdiff_t */
+				if (sizeof(ptrdiff_t) == sizeof(int32_t))
+					qualifier = PrintfQualifierInt;
+				else
+					qualifier = PrintfQualifierLongLong;
+				i = nxt;
+				uc = str_decode(fmt, &nxt, STR_NO_LIMIT);
+				break;
 			case 'h':
 				/* Char or short */
Index: version
===================================================================
--- version	(revision 2166728911012eaec91ede11a4cebdac0ba5a81a)
+++ version	(revision 368ee04b0543abf978947ce5a1ea47698bb9692f)
@@ -36,5 +36,5 @@
 
 VERSION = 0
-PATCHLEVEL = 6
+PATCHLEVEL = 7
 SUBLEVEL = 0
 
@@ -45,4 +45,4 @@
 endif
 
-NAME = Elastic Horse
-COPYRIGHT = Copyright (c) 2001-2016 HelenOS project
+NAME = Parabolic Potassium
+COPYRIGHT = Copyright (c) 2001-2017 HelenOS project
