Index: kernel/arch/ia32xen/include/boot/boot.h
===================================================================
--- kernel/arch/ia32xen/include/boot/boot.h	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/include/boot/boot.h	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -118,6 +118,17 @@
 	pfn_t store_mfn;            /**< Shared page (machine page) */
 	evtchn_t store_evtchn;      /**< Event channel for store communication */
-	pfn_t console_mfn;          /**< Console page (machine page) */
-	evtchn_t console_evtchn;    /**< Event channel for console messages */
+	
+	union {
+        struct {
+			pfn_t mfn;          /**< Console page (machine page) */
+			evtchn_t evtchn;    /**< Event channel for console messages */
+        } domU;
+		
+        struct {
+            uint32_t info_off;  /**< Offset of console_info struct */
+            uint32_t info_size; /**< Size of console_info struct from start */
+        } dom0;
+    } console;
+	
 	pte_t *ptl0;                /**< Boot PTL0 (kernel address) */
 	uint32_t pt_frames;         /**< Number of bootstrap page table frames */
@@ -127,4 +138,38 @@
 	int8_t cmd_line[GUEST_CMDLINE];
 } start_info_t;
+
+#define XEN_CONSOLE_VGA		0x03
+#define XEN_CONSOLE_VESA	0x23
+
+typedef struct {
+    uint8_t video_type;  
+
+    union {
+        struct {
+            uint16_t font_height;
+            uint16_t cursor_x;
+			uint16_t cursor_y;
+            uint16_t rows;
+			uint16_t columns;
+        } vga;
+
+        struct {
+            uint16_t width;
+			uint16_t height;
+            uint16_t bytes_per_line;
+            uint16_t bits_per_pixel;
+            uint32_t lfb_base;
+            uint32_t lfb_size;
+            uint8_t red_pos;
+			uint8_t red_size;
+            uint8_t green_pos;
+			uint8_t green_size;
+            uint8_t blue_pos;
+			uint8_t blue_size;
+            uint8_t rsvd_pos;
+			uint8_t rsvd_size;
+        } vesa_lfb;
+    } info;
+} console_info_t;
 
 typedef struct {
Index: kernel/arch/ia32xen/include/hypercall.h
===================================================================
--- kernel/arch/ia32xen/include/hypercall.h	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/include/hypercall.h	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -62,5 +62,4 @@
 #define XEN_VERSION				17
 #define XEN_CONSOLE_IO			18
-#define XEN_VM_ASSIST			21
 #define XEN_MMUEXT_OP			26
 
@@ -102,14 +101,4 @@
 
 
-/*
- * Commands to XEN_VM_ASSIST
- */
-#define VMASST_CMD_ENABLE				0
-#define VMASST_CMD_DISABLE				1
-#define VMASST_TYPE_4GB_SEGMENTS		0
-#define VMASST_TYPE_4GB_SEGMENTS_NOTIFY	1
-#define VMASST_TYPE_WRITABLE_PAGETABLES	2
-
-
 #define DOMID_SELF (0x7FF0U)
 #define DOMID_IO   (0x7FF1U)
@@ -219,9 +208,4 @@
 {
 	return hypercall3(XEN_CONSOLE_IO, cmd, count, str);
-}
-
-static inline int xen_vm_assist(const unsigned int cmd, const unsigned int type)
-{
-    return hypercall2(XEN_VM_ASSIST, cmd, type);
 }
 
Index: kernel/arch/ia32xen/include/mm/page.h
===================================================================
--- kernel/arch/ia32xen/include/mm/page.h	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/include/mm/page.h	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -77,17 +77,30 @@
 	mmu_ext.cmd = MMUEXT_NEW_BASEPTR; \
 	mmu_ext.mfn = ADDR2PFN(PA2MA(ptl0)); \
-	xen_mmuext_op(&mmu_ext, 1, NULL, DOMID_SELF); \
+	ASSERT(xen_mmuext_op(&mmu_ext, 1, NULL, DOMID_SELF) == 0); \
 }
 
 #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) { \
+	mmuext_op_t mmu_ext; \
+	\
+	mmu_ext.cmd = MMUEXT_PIN_L1_TABLE; \
+	mmu_ext.mfn = ADDR2PFN(PA2MA(a)); \
+	ASSERT(xen_mmuext_op(&mmu_ext, 1, NULL, DOMID_SELF) == 0); \
+	\
 	mmu_update_t update; \
 	\
 	update.ptr = PA2MA(KA2PA(&((pte_t *) (ptl0))[(i)])); \
-	update.val = PA2MA(a) | 0x0003; \
-	xen_mmu_update(&update, 1, NULL, DOMID_SELF); \
-}
+	update.val = PA2MA(a); \
+	ASSERT(xen_mmu_update(&update, 1, NULL, DOMID_SELF) == 0); \
+}
+
 #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
 #define SET_PTL3_ADDRESS_ARCH(ptl2, i, a)
-#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a)	(((pte_t *) (ptl3))[(i)].frame_address = PA2MA(a) >> 12)
+#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) { \
+	mmu_update_t update; \
+	\
+	update.ptr = PA2MA(KA2PA(&((pte_t *) (ptl3))[(i)])); \
+	update.val = PA2MA(a); \
+	ASSERT(xen_mmu_update(&update, 1, NULL, DOMID_SELF) == 0); \
+}
 
 #define GET_PTL1_FLAGS_ARCH(ptl0, i)		get_pt_flags((pte_t *) (ptl0), (index_t)(i))
@@ -197,16 +210,22 @@
 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)
 {
-	pte_t *p = &pt[i];
-	
-	p->page_cache_disable = !(flags & PAGE_CACHEABLE);
-	p->present = !(flags & PAGE_NOT_PRESENT);
-	p->uaccessible = (flags & PAGE_USER) != 0;
-	p->writeable = (flags & PAGE_WRITE) != 0;
-	p->global = (flags & PAGE_GLOBAL) != 0;
+	pte_t p = pt[i];
+	
+	p.page_cache_disable = !(flags & PAGE_CACHEABLE);
+	p.present = !(flags & PAGE_NOT_PRESENT);
+	p.uaccessible = (flags & PAGE_USER) != 0;
+	p.writeable = (flags & PAGE_WRITE) != 0;
+	p.global = (flags & PAGE_GLOBAL) != 0;
 	
 	/*
 	 * Ensure that there is at least one bit set even if the present bit is cleared.
 	 */
-	p->soft_valid = true;
+	p.soft_valid = true;
+	
+	mmu_update_t update;
+	
+	update.ptr = PA2MA(KA2PA(&(pt[i])));
+	update.pte = p;
+	xen_mmu_update(&update, 1, NULL, DOMID_SELF);
 }
 
Index: kernel/arch/ia32xen/src/boot/boot.S
===================================================================
--- kernel/arch/ia32xen/src/boot/boot.S	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/src/boot/boot.S	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -49,5 +49,5 @@
 ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,				.long,	kernel_image_start)
 ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE,	.long,	hypercall_page)
-ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,			.asciz,	"writable_page_tables|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel")
+ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,			.asciz,	"auto_translated_physmap|supervisor_mode_kernel")
 ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,			.asciz,	"no")
 ELFNOTE(Xen, XEN_ELFNOTE_LOADER,			.asciz,	"generic")
Index: kernel/arch/ia32xen/src/drivers/xconsole.c
===================================================================
--- kernel/arch/ia32xen/src/drivers/xconsole.c	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/src/drivers/xconsole.c	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -43,5 +43,4 @@
 #define MASK_INDEX(index, ring) ((index) & (sizeof(ring) - 1))
 
-static bool asynchronous = false;
 static void xen_putchar(chardev_t *d, const char ch);
 
@@ -55,11 +54,9 @@
 	chardev_initialize("xen_out", &xen_console, &xen_ops);
 	stdout = &xen_console;
-	if (!(start_info.flags & SIF_INITDOMAIN))
-		asynchronous = true;
 }
 
 void xen_putchar(chardev_t *d, const char ch)
 {
-	if (asynchronous) {
+	if (start_info.console.domU.evtchn != 0) {
 		uint32_t cons = console_page.out_cons;
 		uint32_t prod = console_page.out_prod;
@@ -78,5 +75,5 @@
 		console_page.out_prod = prod;
 		
-		xen_notify_remote(start_info.console_evtchn);
+		xen_notify_remote(start_info.console.domU.evtchn);
 	} else
 		xen_console_io(CONSOLE_IO_WRITE, 1, &ch);
Index: kernel/arch/ia32xen/src/ia32xen.c
===================================================================
--- kernel/arch/ia32xen/src/ia32xen.c	(revision 9ab9c2ec85cf371e50f3b815722f6586f78add5b)
+++ kernel/arch/ia32xen/src/ia32xen.c	(revision 8cd140f26dd9503acc9c3b85b265d95ff017cea4)
@@ -72,6 +72,4 @@
 void arch_pre_main(void)
 {
-	xen_vm_assist(VMASST_CMD_ENABLE, VMASST_TYPE_WRITABLE_PAGETABLES);
-	
 	pte_t pte;
 	memsetb((uintptr_t) &pte, sizeof(pte), 0);
@@ -80,12 +78,16 @@
 	pte.writeable = 1;
 	pte.frame_address = ADDR2PFN((uintptr_t) start_info.shared_info);
-	xen_update_va_mapping(&shared_info, pte, UVMF_INVLPG);
-	
-	pte.present = 1;
-	pte.writeable = 1;
-	pte.frame_address = start_info.console_mfn;
-	xen_update_va_mapping(&console_page, pte, UVMF_INVLPG);
-	
-	xen_set_callbacks(XEN_CS, xen_callback, XEN_CS, xen_failsafe_callback);
+	ASSERT(xen_update_va_mapping(&shared_info, pte, UVMF_INVLPG) == 0);
+	
+	if (!(start_info.flags & SIF_INITDOMAIN)) {
+		/* Map console frame */
+		pte.present = 1;
+		pte.writeable = 1;
+		pte.frame_address = start_info.console.domU.mfn;
+		ASSERT(xen_update_va_mapping(&console_page, pte, UVMF_INVLPG) == 0);
+	} else
+		start_info.console.domU.evtchn = 0;
+	
+	ASSERT(xen_set_callbacks(XEN_CS, xen_callback, XEN_CS, xen_failsafe_callback) == 0);
 	
 	/* Create identity mapping */
@@ -94,5 +96,5 @@
 	meminfo.size = start_info.frames - meminfo.start;
 	meminfo.reserved = 0;
-	
+
 	uintptr_t pa;
 	index_t last_ptl0 = 0;
@@ -108,6 +110,7 @@
 			
 			pte_t *tptl3 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(start_info.ptl0, PTL0_INDEX(tva)));
-			SET_FRAME_FLAGS(tptl3, PTL3_INDEX(tva), PAGE_PRESENT);
+			SET_FRAME_ADDRESS(tptl3, PTL3_INDEX(tva), 0);
 			SET_PTL1_ADDRESS(start_info.ptl0, PTL0_INDEX(va), tpa);
+			SET_FRAME_ADDRESS(tptl3, PTL3_INDEX(tva), tpa);
 			
 			last_ptl0 = PTL0_INDEX(va);
