Index: kernel/arch/mips32/src/console.c
===================================================================
--- kernel/arch/mips32/src/console.c	(revision a0f6a61c9a8fa25fea57e5aec9b67811c126299c)
+++ kernel/arch/mips32/src/console.c	(revision 0b5f9fa8f85b747067b6791c2924eaa4a3965b76)
@@ -41,10 +41,9 @@
 void console_init(devno_t devno)
 {
-	if (arc_enabled()) {
-		arc_console();
-	} else if (serial_init()) {
-		serial_console(devno);
-	} else {
-		msim_console(devno);
+	if (!arc_console()) {
+		if (serial_init())
+			serial_console(devno);
+		else
+			msim_console(devno);
 	}
 }
Index: kernel/arch/mips32/src/drivers/arc.c
===================================================================
--- kernel/arch/mips32/src/drivers/arc.c	(revision a0f6a61c9a8fa25fea57e5aec9b67811c126299c)
+++ kernel/arch/mips32/src/drivers/arc.c	(revision 0b5f9fa8f85b747067b6791c2924eaa4a3965b76)
@@ -107,15 +107,10 @@
 };
 
-static arc_sbp *sbp = (arc_sbp *)PA2KA(0x1000);
+static arc_sbp *sbp = (arc_sbp *) PA2KA(0x1000);
 static arc_func_vector_t *arc_entry; 
 
 
-static void arc_putchar(char ch);
-
 /** Return true if ARC is available */
-int arc_enabled(void)
-{
-	return sbp != NULL;
-}
+#define arc_enabled() (sbp != NULL)
 
 
@@ -139,9 +134,9 @@
 	return;
 	
-	for (i=0; i < configdata->count; i++) {
+	for (i = 0; i < configdata->count; i++) {
 		switch (configdata->descr[i].type) {
 		case CmResourceTypePort:
 			printf("Port: %p-size:%d ",
-			       (uintptr_t)configdata->descr[i].u.port.start,
+			       (uintptr_t) configdata->descr[i].u.port.start,
 			       configdata->descr[i].u.port.length);
 			break;
@@ -170,6 +165,6 @@
 
 	printf("%s: ",ctypes[c->type]);
-	for (i=0;i < c->identifier_len;i++)
-		printf("%c",c->identifier[i]);
+	for (i = 0; i < c->identifier_len; i++)
+		printf("%c", c->identifier[i]);
 
 	printf(" ");
@@ -183,5 +178,5 @@
 static int cmd_arc_print_devices(cmd_arg_t *argv)
 {
-	arc_component *c,*next;
+	arc_component *c, *next;
 
 	c = arc_entry->getchild(NULL);
@@ -211,26 +206,21 @@
  *
  */
-static int cmd_arc_print_memmap(cmd_arg_t *argv)
-{
-	arc_memdescriptor_t *desc;
-
-	printf("Memory map:\n");
-
-	desc = arc_entry->getmemorydescriptor(NULL);
-	while (desc) {
-		printf("%s: %d(%p) (size: %dKB)\n",basetypes[desc->type],
-		       desc->basepage * ARC_FRAME,
-		       desc->basepage * ARC_FRAME,
-		       desc->basecount*ARC_FRAME/1024);
-		desc = arc_entry->getmemorydescriptor(desc);
-	}
-	return 1;
-}
-static cmd_info_t memmap_info = {
-	.name = "arcmemmap",
-	.description = "Print arc memory map",
-	.func = cmd_arc_print_memmap,
-	.argc = 0
-};
+void physmem_print(void)
+{
+	printf("Base       Size       Type\n");
+	printf("---------- ---------- ---------\n");
+	
+	if (arc_enabled()) {
+		arc_memdescriptor_t *desc = arc_entry->getmemorydescriptor(NULL);
+		
+		while (desc) {
+			printf("%#10x %#10x %s\n",
+				desc->basepage * ARC_FRAME, desc->basecount * ARC_FRAME,
+				basetypes[desc->type]);
+			desc = arc_entry->getmemorydescriptor(desc);
+		}	
+	} else
+		printf("%#10x %#10x free\n", 0, config.memory_size);
+}
 
 /** Print charactor to console */
@@ -244,18 +234,6 @@
 	arc_entry->write(1, &ch, 1, &cnt);
 	interrupts_restore(ipl);
-	
-}
-
-static int cmd_reboot(cmd_arg_t *argv)
-{
-	arc_entry->reboot();
-	return 0;
-}
-static cmd_info_t reboot_info = {
-	.name = "reboot",
-	.description = "Reboot computer",
-	.func = cmd_reboot,
-	.argc = 0
-};
+}
+
 
 /** Initialize ARC structure
@@ -277,8 +255,4 @@
 
 	/* Add command for resetting the computer */
-	cmd_initialize(&reboot_info);
-	cmd_register(&reboot_info);
-	cmd_initialize(&memmap_info);
-	cmd_register(&memmap_info);
 	cmd_initialize(&devlist_info);
 	cmd_register(&devlist_info);
@@ -286,4 +260,15 @@
 	return 0;
 }
+
+int arc_reboot(void)
+{
+	if (arc_enabled()) {
+		arc_entry->reboot();
+		return true;
+	}
+	
+	return false;
+}
+
 
 static bool kbd_polling_enabled;
@@ -297,5 +282,5 @@
 	long result;
 	
-	if (! kbd_polling_enabled)
+	if (!kbd_polling_enabled)
 		return;
 
@@ -303,5 +288,5 @@
 		return;
 	result = arc_entry->read(0, &ch, 1, &count);
-	if (result || count!=1) {
+	if ((result) || (count != 1)) {
 		return;
 	}
@@ -321,5 +306,5 @@
 
 	result = arc_entry->read(0, &ch, 1, &count);
-	if (result || count!=1) {
+	if ((result) || (count != 1)) {
 		printf("Error reading from ARC keyboard.\n");
 		cpu_halt();
@@ -354,12 +339,18 @@
 };
 
-void arc_console(void)
-{
-	kbd_polling_enabled = true;
-	
-	chardev_initialize("arc_console", &console, &arc_ops);
-	virtual_timer_fnc = &arc_keyboard_poll;
-	stdin = &console;
-	stdout = &console;
+int arc_console(void)
+{
+	if (arc_enabled()) {
+		kbd_polling_enabled = true;
+		
+		chardev_initialize("arc_console", &console, &arc_ops);
+		virtual_timer_fnc = &arc_keyboard_poll;
+		stdin = &console;
+		stdout = &console;
+		
+		return true;
+	}
+	
+	return false;
 }
 
@@ -368,33 +359,38 @@
  * currently we use the FreeMemory (what about the LoadedProgram?)
  */
-void arc_frame_init(void)
-{
-	arc_memdescriptor_t *desc;
-	int total = 0;
-	uintptr_t base;
-	size_t basesize;
-
-	desc = arc_entry->getmemorydescriptor(NULL);
-	while (desc) {
-		if (desc->type == FreeMemory ||
-		    desc->type == FreeContiguous) {
-			base = desc->basepage*ARC_FRAME;
-			basesize = desc->basecount*ARC_FRAME;
-
-			if (base % FRAME_SIZE ) {
-				basesize -= FRAME_SIZE - (base % FRAME_SIZE);
-				base = ALIGN_UP(base, FRAME_SIZE);
+int arc_frame_init(void)
+{
+	if (arc_enabled()) {
+		arc_memdescriptor_t *desc;
+		int total = 0;
+		uintptr_t base;
+		size_t basesize;
+	
+		desc = arc_entry->getmemorydescriptor(NULL);
+		while (desc) {
+			if ((desc->type == FreeMemory) ||
+			    (desc->type == FreeContiguous)) {
+				base = desc->basepage*ARC_FRAME;
+				basesize = desc->basecount*ARC_FRAME;
+	
+				if (base % FRAME_SIZE ) {
+					basesize -= FRAME_SIZE - (base % FRAME_SIZE);
+					base = ALIGN_UP(base, FRAME_SIZE);
+				}
+				basesize = ALIGN_DOWN(basesize, FRAME_SIZE);
+	
+				total += basesize;
+				
+				zone_create(ADDR2PFN(base), SIZE2FRAMES(basesize),
+					    ADDR2PFN(base), 0);
 			}
-			basesize = ALIGN_DOWN(basesize, FRAME_SIZE);
-
-			total += basesize;
-			
-			zone_create(ADDR2PFN(base), SIZE2FRAMES(basesize),
-				    ADDR2PFN(base), 0);
+			desc = arc_entry->getmemorydescriptor(desc);
 		}
-		desc = arc_entry->getmemorydescriptor(desc);
-	}
-
-	config.memory_size = total;
+	
+		config.memory_size = total;
+		return true;
+	}
+	
+	return false;
 }
 
Index: kernel/arch/mips32/src/mips32.c
===================================================================
--- kernel/arch/mips32/src/mips32.c	(revision a0f6a61c9a8fa25fea57e5aec9b67811c126299c)
+++ kernel/arch/mips32/src/mips32.c	(revision 0b5f9fa8f85b747067b6791c2924eaa4a3965b76)
@@ -142,14 +142,13 @@
 void userspace(uspace_arg_t *kernel_uarg)
 {
-	/* EXL=1, UM=1, IE=1 */
+	/* EXL = 1, UM = 1, IE = 1 */
 	cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit |
-					      cp0_status_um_bit |
-					      cp0_status_ie_enabled_bit));
+		cp0_status_um_bit | cp0_status_ie_enabled_bit));
 	cp0_epc_write((uintptr_t) kernel_uarg->uspace_entry);
-	userspace_asm(((uintptr_t) kernel_uarg->uspace_stack+PAGE_SIZE), 
-		      (uintptr_t) kernel_uarg->uspace_uarg,
-		      (uintptr_t) kernel_uarg->uspace_entry);
-	while (1)
-		;
+	userspace_asm(((uintptr_t) kernel_uarg->uspace_stack + PAGE_SIZE), 
+		(uintptr_t) kernel_uarg->uspace_uarg,
+		(uintptr_t) kernel_uarg->uspace_entry);
+	
+	while (1);
 }
 
@@ -181,5 +180,7 @@
 void arch_reboot(void)
 {
-	___halt();
+	if (!arc_reboot())
+		___halt();
+	
 	while (1);
 }
Index: kernel/arch/mips32/src/mm/frame.c
===================================================================
--- kernel/arch/mips32/src/mm/frame.c	(revision a0f6a61c9a8fa25fea57e5aec9b67811c126299c)
+++ kernel/arch/mips32/src/mm/frame.c	(revision 0b5f9fa8f85b747067b6791c2924eaa4a3965b76)
@@ -46,7 +46,5 @@
 void frame_arch_init(void)
 {
-	if (arc_enabled())
-		arc_frame_init();
-	else {
+	if (!arc_frame_init()) {
 		zone_create(0, ADDR2PFN(config.memory_size), 1, 0);
 		/*
