Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -59,4 +59,5 @@
 #include <devmap.h>
 #include <sys/types.h>
+#include <inttypes.h>
 #include <errno.h>
 #include <bool.h>
@@ -112,5 +113,5 @@
 	printf(NAME ": ATA disk driver\n");
 
-	printf("I/O address 0x%p/0x%p\n", ctl_physical, cmd_physical);
+	printf("I/O address %p/%p\n", ctl_physical, cmd_physical);
 
 	if (ata_bd_init() != EOK)
@@ -180,9 +181,9 @@
 	}
 
-	printf(" %llu blocks", d->blocks, d->blocks / (2 * 1024));
+	printf(" %" PRIu64 " blocks", d->blocks, d->blocks / (2 * 1024));
 
 	mbytes = d->blocks / (2 * 1024);
 	if (mbytes > 0)
-		printf(" %llu MB.", mbytes);
+		printf(" %" PRIu64 " MB.", mbytes);
 
 	printf("\n");
Index: uspace/srv/bd/part/guid_part/guid_part.c
===================================================================
--- uspace/srv/bd/part/guid_part/guid_part.c	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/bd/part/guid_part/guid_part.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -54,4 +54,6 @@
 #include <devmap.h>
 #include <sys/types.h>
+#include <sys/typefmt.h>
+#include <inttypes.h>
 #include <libblock.h>
 #include <devmap.h>
@@ -196,6 +198,6 @@
 		size_mb = (part->length * block_size + 1024 * 1024 - 1)
 		    / (1024 * 1024);
-		printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
-		    name, part->length, size_mb);
+		printf(NAME ": Registered device %s: %" PRIu64 " blocks "
+		    "%" PRIuBN " MB.\n", name, part->length, size_mb);
 
 		part->dev = dev;
Index: uspace/srv/bd/part/mbr_part/mbr_part.c
===================================================================
--- uspace/srv/bd/part/mbr_part/mbr_part.c	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/bd/part/mbr_part/mbr_part.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -64,4 +64,6 @@
 #include <devmap.h>
 #include <sys/types.h>
+#include <sys/typefmt.h>
+#include <inttypes.h>
 #include <libblock.h>
 #include <devmap.h>
@@ -247,6 +249,6 @@
 		size_mb = (part->length * block_size + 1024 * 1024 - 1)
 		    / (1024 * 1024);
-		printf(NAME ": Registered device %s: %llu blocks %llu MB.\n",
-		    name, part->length, size_mb);
+		printf(NAME ": Registered device %s: %" PRIuBN " blocks "
+		    "%" PRIu64 " MB.\n", name, part->length, size_mb);
 
 		part->dev = dev;
@@ -274,5 +276,5 @@
 	if (brb == NULL) {
 		printf(NAME ": Failed allocating memory.\n");
-		return ENOMEM;	
+		return ENOMEM;
 	}
 
@@ -289,5 +291,6 @@
 	sgn = uint16_t_le2host(brb->signature);
 	if (sgn != BR_SIGNATURE) {
-		printf(NAME ": Invalid boot record signature 0x%04X.\n", sgn);
+		printf(NAME ": Invalid boot record signature 0x%04" PRIX16
+		    ".\n", sgn);
 		return EINVAL;
 	}
@@ -333,5 +336,6 @@
 		rc = block_read_direct(indev_handle, ba, 1, brb);
 		if (rc != EOK) {
-			printf(NAME ": Failed reading EBR block at %u.\n", ba);
+			printf(NAME ": Failed reading EBR block at %"
+			    PRIu32 ".\n", ba);
 			return rc;
 		}
@@ -339,6 +343,6 @@
 		sgn = uint16_t_le2host(brb->signature);
 		if (sgn != BR_SIGNATURE) {
-			printf(NAME ": Invalid boot record signature 0x%04X "
-			    " in EBR at %u.\n", sgn, ba);
+			printf(NAME ": Invalid boot record signature 0x%04"
+			    PRIX16 " in EBR at %" PRIu32 ".\n", sgn, ba);
 			return EINVAL;
 		}
Index: uspace/srv/hid/kbd/port/i8042.h
===================================================================
--- uspace/srv/hid/kbd/port/i8042.h	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd_port
- * @ingroup  kbd
- * @{
- */
-
-/** @file
- * @brief i8042 port driver.
- */
-
-#ifndef KBD_PORT_i8042_H_
-#define KBD_PORT_i8042_H_
-
-#include <libarch/ddi.h>
-#include <libarch/types.h>
-
-struct i8042 {
-	ioport8_t data;
-	uint8_t pad[3];
-	ioport8_t status;
-} __attribute__ ((packed));
-typedef struct i8042 i8042_t;
-
-#endif
-
-/**
- * @}
- */ 
Index: uspace/srv/loader/arch/amd64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/amd64/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/amd64/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/amd64.s
Index: uspace/srv/loader/arch/arm32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/arm32/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/arm32/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/arm32.s
Index: uspace/srv/loader/arch/ia32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia32/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/ia32/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ia32.s
Index: uspace/srv/loader/arch/ia64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia64/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/ia64/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,5 +27,4 @@
 #
 
-EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ia64.s
 AFLAGS += -xexplicit
Index: uspace/srv/loader/arch/mips32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/mips32/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/mips32/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/mips32.s
Index: uspace/srv/loader/arch/ppc32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__32_BITS__
 ARCH_SOURCES := arch/$(UARCH)/ppc32.s
Index: uspace/srv/loader/arch/sparc64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -27,4 +27,3 @@
 #
 
-EXTRA_CFLAGS = -D__64_BITS__
 ARCH_SOURCES := arch/$(UARCH)/sparc64.s
Index: uspace/srv/loader/elf_load.c
===================================================================
--- uspace/srv/loader/elf_load.c	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/elf_load.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -342,6 +342,6 @@
 	seg_ptr = (void *) seg_addr;
 
-	DPRINTF("Load segment at addr 0x%x, size 0x%x\n", seg_addr,
-		entry->p_memsz);	
+	DPRINTF("Load segment at addr %p, size 0x%x\n", seg_addr,
+		entry->p_memsz);
 
 	if (entry->p_align > 1) {
@@ -370,5 +370,5 @@
 	mem_sz = entry->p_memsz + (entry->p_vaddr - base);
 
-	DPRINTF("Map to seg_addr=0x%x-0x%x.\n", seg_addr,
+	DPRINTF("Map to seg_addr=%p-%p.\n", seg_addr,
 	entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
 
@@ -384,5 +384,5 @@
 	}
 
-	DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
+	DPRINTF("as_area_create(%p, 0x%x, %d) -> 0x%lx\n",
 		base + bias, mem_sz, flags, (uintptr_t)a);
 
@@ -461,5 +461,5 @@
 		elf->info->dynamic =
 		    (void *)((uint8_t *)entry->sh_addr + elf->bias);
-		DPRINTF("Dynamic section found at 0x%x.\n",
+		DPRINTF("Dynamic section found at %p.\n",
 			(uintptr_t)elf->info->dynamic);
 		break;
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision 7efc5177d0833414fcb6f7e2ce27f3efd24ce05d)
+++ uspace/srv/loader/main.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -392,5 +392,5 @@
 		/* Dynamically linked program */
 		DPRINTF("Run ELF interpreter.\n");
-		DPRINTF("Entry point: 0x%lx\n", interp_info.entry);
+		DPRINTF("Entry point: %p\n", interp_info.entry);
 		
 		ipc_answer_0(rid, EOK);
Index: uspace/srv/taskmon/Makefile
===================================================================
--- uspace/srv/taskmon/Makefile	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
+++ uspace/srv/taskmon/Makefile	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+LIBS = $(LIBC_PREFIX)/libc.a
+
+OUTPUT = taskmon
+
+SOURCES = \
+	taskmon.c
+
+include ../Makefile.common
Index: uspace/srv/taskmon/taskmon.c
===================================================================
--- uspace/srv/taskmon/taskmon.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
+++ uspace/srv/taskmon/taskmon.c	(revision 89ee7ffcc1cadaf04c540cd8bfc290aac1e6d4d5)
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2010 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup taskmon
+ * @brief
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <stdio.h>
+#include <ipc/ipc.h>
+#include <async.h>
+#include <ipc/services.h>
+#include <sys/typefmt.h>
+#include <task.h>
+#include <event.h>
+#include <macros.h>
+#include <errno.h>
+
+#define NAME  "taskmon"
+
+static void fault_event(ipc_callid_t callid, ipc_call_t *call)
+{
+	char *argv[11];
+	char *fname;
+	char *dump_fname;
+	char *s_taskid;
+	char **s;
+
+	task_id_t taskid;
+	uintptr_t thread;
+
+	taskid = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call));
+	thread = IPC_GET_ARG3(*call);
+
+	if (asprintf(&s_taskid, "%" PRIuTASKID, taskid) < 0) {
+		printf("Memory allocation failed.\n");
+		return;
+	}
+
+	if (asprintf(&dump_fname, "/scratch/d" PRIuTASKID ".txt", taskid) < 0) {
+		printf("Memory allocation failed.\n");
+		return;
+	}
+
+	printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
+
+#ifdef CONFIG_VERBOSE_DUMPS
+	argv[0] = "/app/redir";
+	argv[1] = "-i";
+	argv[2] = "/readme";
+	argv[3] = "-o";
+	argv[4] = dump_fname;
+	argv[5] = "--";
+	argv[6] = "/app/taskdump";
+	argv[7] = "-m";
+	argv[8] = "-t";
+	argv[9] = s_taskid;
+	argv[10] = NULL;
+#else
+	argv[0] = "/app/taskdump";
+	argv[1] = "-t";
+	argv[2] = s_taskid;
+	argv[3] = NULL;
+#endif
+	fname = argv[0];
+
+	printf(NAME ": Executing");
+        s = argv;
+	while (*s != NULL) {
+		printf(" %s", *s);
+		++s;
+	}
+	putchar('\n');
+
+	if (!task_spawn(fname, argv))
+		printf(NAME ": Error spawning taskdump.\n", fname);
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": Task Monitoring Service\n");
+
+	if (event_subscribe(EVENT_FAULT, 0) != EOK) {
+		printf(NAME ": Error registering fault notifications.\n");
+		return -1;
+	}
+
+	async_set_interrupt_received(fault_event);
+	async_manager();
+
+	return 0;
+}
+
+/** @}
+ */
