Index: kernel/arch/amd64/include/mm/as.h
===================================================================
--- kernel/arch/amd64/include/mm/as.h	(revision 22e8166d31603820c5ff6a19314d26c8a16f3ece)
+++ kernel/arch/amd64/include/mm/as.h	(revision 62da45a052d2336d92cdd681cdde3e0d05b1665a)
@@ -39,5 +39,5 @@
 
 #define KERNEL_ADDRESS_SPACE_START_ARCH		(unsigned long) 0xffff800000000000
-#define KERNEL_ADDRESS_SPACE_END_ARCH		(unsigned long) 0xffffffffffffffff
+#define KERNEL_ADDRESS_SPACE_END_ARCH		(unsigned long) 0xffffffff80000000
 #define USER_ADDRESS_SPACE_START_ARCH		(unsigned long) 0x0000000000000000
 #define USER_ADDRESS_SPACE_END_ARCH		(unsigned long) 0x00007fffffffffff
Index: kernel/arch/amd64/src/amd64.c
===================================================================
--- kernel/arch/amd64/src/amd64.c	(revision 22e8166d31603820c5ff6a19314d26c8a16f3ece)
+++ kernel/arch/amd64/src/amd64.c	(revision 62da45a052d2336d92cdd681cdde3e0d05b1665a)
@@ -72,14 +72,13 @@
 static void clean_IOPL_NT_flags(void)
 {
-	asm
-	(
-		"pushfq;"
-		"pop %%rax;"
-		"and $~(0x7000),%%rax;"
-		"pushq %%rax;"
-		"popfq;"
-		:
-		:
-		:"%rax"
+	asm (
+		"pushfq\n"
+		"pop %%rax\n"
+		"and $~(0x7000), %%rax\n"
+		"pushq %%rax\n"
+		"popfq\n"
+		:
+		:
+		: "%rax"
 	);
 }
@@ -91,12 +90,11 @@
 static void clean_AM_flag(void)
 {
-	asm
-	(
-		"mov %%cr0,%%rax;"
-		"and $~(0x40000),%%rax;"
-		"mov %%rax,%%cr0;"
-		:
-		:
-		:"%rax"
+	asm (
+		"mov %%cr0, %%rax\n"
+		"and $~(0x40000), %%rax\n"
+		"mov %%rax, %%cr0\n"
+		:
+		:
+		: "%rax"
 	);
 }
@@ -128,4 +126,5 @@
 }
 
+
 void arch_post_mm_init(void)
 {
@@ -136,5 +135,5 @@
 		/* hard clock */
 		i8254_init();
-
+				
 #ifdef CONFIG_FB
 		if (vesa_present()) 
@@ -149,7 +148,7 @@
 		zone_merge_all();
 	}
+	
 	/* Setup fast SYSCALL/SYSRET */
 	syscall_setup_cpu();
-	
 }
 
Index: kernel/arch/amd64/src/mm/page.c
===================================================================
--- kernel/arch/amd64/src/mm/page.c	(revision 22e8166d31603820c5ff6a19314d26c8a16f3ece)
+++ kernel/arch/amd64/src/mm/page.c	(revision 62da45a052d2336d92cdd681cdde3e0d05b1665a)
@@ -88,5 +88,5 @@
 	if (config.cpu_active == 1) {
 		page_mapping_operations = &pt_mapping_operations;
-		
+
 		/*
 		 * PA2KA(identity) mapping for all frames.
@@ -96,7 +96,8 @@
 			page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, identity_flags);
 		}
+		
 		/* Upper kernel mapping
 		 * - from zero to top of kernel (include bottom addresses
-		 *   because some are needed for init )
+		 *   because some are needed for init)
 		 */
 		for (cur = PA2KA_CODE(0); cur < config.base + config.kernel_size; cur += FRAME_SIZE)
Index: kernel/arch/ia32/src/mm/frame.c
===================================================================
--- kernel/arch/ia32/src/mm/frame.c	(revision 22e8166d31603820c5ff6a19314d26c8a16f3ece)
+++ kernel/arch/ia32/src/mm/frame.c	(revision 62da45a052d2336d92cdd681cdde3e0d05b1665a)
@@ -62,9 +62,7 @@
 	for (i = 0; i < e820counter; i++) {
 		if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) {
-			start = ADDR2PFN(ALIGN_UP(e820table[i].base_address,
-						  FRAME_SIZE));
-			size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size,
-						   FRAME_SIZE));
-			if (minconf < start || minconf >= start + size)
+			start = ADDR2PFN(ALIGN_UP(e820table[i].base_address, FRAME_SIZE));
+			size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size, FRAME_SIZE));
+			if ((minconf < start) || (minconf >= start + size))
 				conf = start;
 			else
@@ -112,14 +110,13 @@
 {
 	static pfn_t minconf;
-
+	
 	if (config.cpu_active == 1) {
 		cmd_initialize(&e820_info);
 		cmd_register(&e820_info);
 
-
 		minconf = 1;
 #ifdef CONFIG_SMP
 		minconf = max(minconf,
-			      ADDR2PFN(AP_BOOT_OFFSET+hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size));
+			ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size));
 #endif
 #ifdef CONFIG_SIMICS_FIX
@@ -134,9 +131,9 @@
 		/* Reserve AP real mode bootstrap memory */
 		frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 
-				       (hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
+			(hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
 		
 #ifdef CONFIG_SIMICS_FIX
 		/* Don't know why, but these addresses help */
-		frame_mark_unavailable(0xd000 >> FRAME_WIDTH,3);
+		frame_mark_unavailable(0xd000 >> FRAME_WIDTH, 3);
 #endif
 #endif
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision 22e8166d31603820c5ff6a19314d26c8a16f3ece)
+++ kernel/generic/src/console/console.c	(revision 62da45a052d2336d92cdd681cdde3e0d05b1665a)
@@ -61,4 +61,5 @@
 	.write = null_putchar
 };
+
 chardev_t null_stdout = {
 	.name = "null",
