Index: kernel/arch/ia32/src/boot/boot.S
===================================================================
--- kernel/arch/ia32/src/boot/boot.S	(revision 328f324bc169113023515c3003ef864c3c65b399)
+++ kernel/arch/ia32/src/boot/boot.S	(revision 72bcb25fd2166818d63b580efcafdf265183c0c8)
@@ -64,6 +64,6 @@
 	multiboot_meeting_point:
 	
-	pushl %ebx							# save parameters from GRUB
-	pushl %eax
+	movl %eax, grub_eax					# save parameters from GRUB
+	movl %ebx, grub_ebx
 	
 	xorl %eax, %eax  
@@ -105,6 +105,6 @@
 	call map_kernel							# map kernel and turn paging on
 	
-	popl %eax
-	popl %ebx
+	movl grub_eax, %eax
+	movl grub_ebx, %ebx
 	cmpl $MULTIBOOT_LOADER_MAGIC, %eax				# compare GRUB signature
 	je valid_boot
@@ -482,6 +482,4 @@
 .code32
 vesa_init_protect:
-	popl %esp
-
 	movw $selector(KDATA_DES), %cx
 	movw %cx, %es
@@ -491,4 +489,6 @@
 	movw %cx, %ss
 	
+	movl $START_STACK, %esp			# initialize stack pointer
+
 	jmpl $selector(KTEXT_DES), $vesa_meeting_point
 
@@ -503,4 +503,10 @@
 	.space 4096, 0
 
+grub_eax:
+	.long 0
+
+grub_ebx:
+	.long 0
+
 pse_msg:
 	.ascii "Page Size Extension not supported. System halted.\0"
Index: kernel/arch/ia32/src/mm/page.c
===================================================================
--- kernel/arch/ia32/src/mm/page.c	(revision 328f324bc169113023515c3003ef864c3c65b399)
+++ kernel/arch/ia32/src/mm/page.c	(revision 72bcb25fd2166818d63b580efcafdf265183c0c8)
@@ -62,5 +62,5 @@
 		 */
 		for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
-			flags = PAGE_CACHEABLE;
+			flags = PAGE_CACHEABLE | PAGE_WRITE;
 			if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size))
 				flags |= PAGE_GLOBAL;
@@ -70,8 +70,6 @@
 		exc_register(14, "page_fault", (iroutine) page_fault);
 		write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
-	}
-	else {
+	} else
 		write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
-	}
 
 	paging_on();
@@ -87,5 +85,5 @@
 	pfn_t i;
 	for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)
-		page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);
+		page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE);
 	
 	last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
@@ -96,10 +94,10 @@
 void page_fault(int n, istate_t *istate)
 {
-        uintptr_t page;
+	uintptr_t page;
 	pf_access_t access;
 	
-        page = read_cr2();
+	page = read_cr2();
 		
-        if (istate->error_word & PFERR_CODE_RSVD)
+	if (istate->error_word & PFERR_CODE_RSVD)
 		panic("Reserved bit set in page directory.\n");
 
@@ -108,12 +106,12 @@
 	else
 		access = PF_ACCESS_READ;
-
-        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
+	
+	if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
 		fault_if_from_uspace(istate, "Page fault: %#x", page);
-
-                decode_istate(istate);
-                printf("page fault address: %#x\n", page);
-                panic("page fault\n");
-        }
+		
+		decode_istate(istate);
+		printf("page fault address: %#x\n", page);
+		panic("page fault\n");
+	}
 }
 
Index: kernel/arch/ia32/src/smp/smp.c
===================================================================
--- kernel/arch/ia32/src/smp/smp.c	(revision 328f324bc169113023515c3003ef864c3c65b399)
+++ kernel/arch/ia32/src/smp/smp.c	(revision 72bcb25fd2166818d63b580efcafdf265183c0c8)
@@ -83,11 +83,11 @@
 	if (config.cpu_count > 1) {		
 		page_mapping_insert(AS_KERNEL, l_apic_address, (uintptr_t) l_apic, 
-				  PAGE_NOT_CACHEABLE);
+				  PAGE_NOT_CACHEABLE | PAGE_WRITE);
 		page_mapping_insert(AS_KERNEL, io_apic_address, (uintptr_t) io_apic,
-				  PAGE_NOT_CACHEABLE);
+				  PAGE_NOT_CACHEABLE | PAGE_WRITE);
 				  
 		l_apic = (uint32_t *) l_apic_address;
 		io_apic = (uint32_t *) io_apic_address;
-        }
+	}
 }
 
