Index: arch/amd64/include/interrupt.h
===================================================================
--- arch/amd64/include/interrupt.h	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ arch/amd64/include/interrupt.h	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -100,4 +100,6 @@
 extern void trap_virtual_disable_irqs(__u16 irqmask);
 extern void trap_virtual_eoi(void);
+/* AMD64 - specific page handler */
+extern void ident_page_fault(int n, istate_t *istate);
 
 #endif
Index: arch/amd64/src/interrupt.c
===================================================================
--- arch/amd64/src/interrupt.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ arch/amd64/src/interrupt.c	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -103,4 +103,89 @@
 }
 
+
+/* Definitions for identic page mapper */
+pte_t helper_ptl1[512] __attribute__((aligned (PAGE_SIZE)));
+pte_t helper_ptl2[512] __attribute__((aligned (PAGE_SIZE)));
+pte_t helper_ptl3[512] __attribute__((aligned (PAGE_SIZE)));
+extern pte_t ptl_0; /* From boot.S */
+
+#define PTL1_PRESENT(ptl0, page) (!(GET_PTL1_FLAGS_ARCH(ptl0, PTL0_INDEX_ARCH(page)) & PAGE_NOT_PRESENT))
+#define PTL2_PRESENT(ptl1, page) (!(GET_PTL2_FLAGS_ARCH(ptl1, PTL1_INDEX_ARCH(page)) & PAGE_NOT_PRESENT))
+#define PTL3_PRESENT(ptl2, page) (!(GET_PTL3_FLAGS_ARCH(ptl2, PTL2_INDEX_ARCH(page)) & PAGE_NOT_PRESENT))
+
+#define PTL1_ADDR(ptl0, page) ((pte_t *)PA2KA(GET_PTL1_ADDRESS_ARCH(ptl0, PTL0_INDEX_ARCH(page))))
+#define PTL2_ADDR(ptl1, page) ((pte_t *)PA2KA(GET_PTL2_ADDRESS_ARCH(ptl1, PTL1_INDEX_ARCH(page))))
+#define PTL3_ADDR(ptl2, page) ((pte_t *)PA2KA(GET_PTL3_ADDRESS_ARCH(ptl2, PTL2_INDEX_ARCH(page))))
+
+#define SETUP_PTL1(ptl0, page, tgt)  {	\
+	SET_PTL1_ADDRESS_ARCH(ptl0, PTL0_INDEX_ARCH(page), (__address)KA2PA(tgt)); \
+        SET_PTL1_FLAGS_ARCH(ptl0, PTL0_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \
+    }
+#define SETUP_PTL2(ptl1, page, tgt)  {	\
+	SET_PTL2_ADDRESS_ARCH(ptl1, PTL1_INDEX_ARCH(page), (__address)KA2PA(tgt)); \
+        SET_PTL2_FLAGS_ARCH(ptl1, PTL1_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \
+    }
+#define SETUP_PTL3(ptl2, page, tgt)  {	\
+	SET_PTL3_ADDRESS_ARCH(ptl2, PTL2_INDEX_ARCH(page), (__address)KA2PA(tgt)); \
+        SET_PTL3_FLAGS_ARCH(ptl2, PTL2_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \
+    }
+#define SETUP_FRAME(ptl3, page, tgt)  {	\
+	SET_FRAME_ADDRESS_ARCH(ptl3, PTL3_INDEX_ARCH(page), (__address)KA2PA(tgt)); \
+        SET_FRAME_FLAGS_ARCH(ptl3, PTL3_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \
+    }
+
+/** Identic page mapper
+ *
+ * We need to map whole physical memory identically before the page subsystem
+ * is initializaed. This thing clears page table and fills in the specific
+ * items.
+ */
+void ident_page_fault(int n, istate_t *istate)
+{
+	__address page;
+	static __address oldpage = 0;
+	pte_t *aptl_1, *aptl_2, *aptl_3;
+
+	page = read_cr2();
+	if (oldpage) {
+		/* Unmap old address */
+		aptl_1 = PTL1_ADDR(&ptl_0, oldpage);
+		aptl_2 = PTL2_ADDR(aptl_1, oldpage);
+		aptl_3 = PTL3_ADDR(aptl_2, oldpage);
+
+		SET_FRAME_FLAGS_ARCH(aptl_3, PTL3_INDEX_ARCH(oldpage), PAGE_NOT_PRESENT);
+		if (aptl_3 == helper_ptl3)
+			SET_PTL3_FLAGS_ARCH(aptl_2, PTL2_INDEX_ARCH(oldpage), PAGE_NOT_PRESENT);
+		if (aptl_2 == helper_ptl2)
+			SET_PTL2_FLAGS_ARCH(aptl_1, PTL1_INDEX_ARCH(oldpage), PAGE_NOT_PRESENT);
+		if (aptl_1 == helper_ptl1)
+			SET_PTL1_FLAGS_ARCH(&ptl_0, PTL0_INDEX_ARCH(oldpage), PAGE_NOT_PRESENT);
+	}
+	if (PTL1_PRESENT(&ptl_0, page))
+		aptl_1 = PTL1_ADDR(&ptl_0, page);
+	else {
+		SETUP_PTL1(&ptl_0, page, helper_ptl1);
+		aptl_1 = helper_ptl1;
+	}
+	    
+	if (PTL2_PRESENT(aptl_1, page)) 
+		aptl_2 = PTL2_ADDR(aptl_1, page);
+	else {
+		SETUP_PTL2(aptl_1, page, helper_ptl2);
+		aptl_2 = helper_ptl2;
+	}
+
+	if (PTL3_PRESENT(aptl_2, page))
+		aptl_3 = PTL3_ADDR(aptl_2, page);
+	else {
+		SETUP_PTL3(aptl_2, page, helper_ptl3);
+		aptl_3 = helper_ptl3;
+	}
+	
+	SETUP_FRAME(aptl_3, page, page);
+
+	oldpage = page;
+}
+
 void page_fault(int n, istate_t *istate)
 {
Index: arch/amd64/src/pm.c
===================================================================
--- arch/amd64/src/pm.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ arch/amd64/src/pm.c	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -175,4 +175,5 @@
 	exc_register( 7, "nm_fault", nm_fault);
 	exc_register(12, "ss_fault", ss_fault);
+	exc_register(14, "ident_mapper", ident_page_fault);
 }
 
Index: generic/include/ipc/ipc.h
===================================================================
--- generic/include/ipc/ipc.h	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ generic/include/ipc/ipc.h	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -38,6 +38,7 @@
 
 /* Flags for calls */
-#define IPC_CALL_ANSWERED      1 /**< This is answer to a call */
-#define IPC_CALL_STATIC_ALLOC  2 /**< This call will not be freed on error */
+#define IPC_CALL_ANSWERED      0x1 /**< This is answer to a call */
+#define IPC_CALL_STATIC_ALLOC  0x2 /**< This call will not be freed on error */
+#define IPC_CALL_DISPATCHED    0x4 /**< Call is in dispatch queue */
 
 /* Flags for ipc_wait_for_call */
Index: generic/src/console/console.c
===================================================================
--- generic/src/console/console.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ generic/src/console/console.c	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -39,7 +39,29 @@
 #include <arch/atomic.h>
 
+#define BUFLEN 2048
+static char debug_buffer[BUFLEN];
+static size_t offset = 0;
+/** Initialize stdout to something that does not print, but does not fail
+ *
+ * Save data in some buffer so that it could be retrieved in the debugger
+ */
+static void null_putchar(chardev_t *d, const char ch)
+{
+	if (offset >= BUFLEN)
+		offset = 0;
+	debug_buffer[offset++] = ch;
+}
+
+static chardev_operations_t null_stdout_ops = {
+	.write = null_putchar
+};
+chardev_t null_stdout = {
+	.name = "null",
+	.op = &null_stdout_ops
+};
+
 /** Standard input character device. */
 chardev_t *stdin = NULL;
-chardev_t *stdout = NULL;
+chardev_t *stdout = &null_stdout;
 
 /** Get character from character device. Do not echo character.
Index: generic/src/ipc/ipc.c
===================================================================
--- generic/src/ipc/ipc.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ generic/src/ipc/ipc.c	(revision dabe6333033ab3fdefc2073afacfd46f2a7cb686)
@@ -185,4 +185,5 @@
 	answerbox_t *callerbox = request->callerbox;
 
+	request->flags &= ~IPC_CALL_DISPATCHED;
 	request->flags |= IPC_CALL_ANSWERED;
 
@@ -218,4 +219,5 @@
 			/* Append request to dispatch queue */
 			list_append(&request->list, &box->dispatched_calls);
+			request->flags |= IPC_CALL_DISPATCHED;
 		} else {
 			if (!(flags & IPC_WAIT_NONBLOCKING)) {
