apm88xxxx: cpu driver: add serial init and printf.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 11 Jun 2015 14:11:30 +0000 (16:11 +0200)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Thu, 11 Jun 2015 14:11:30 +0000 (16:11 +0200)
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

kernel/arch/apm88xxxx/init.c

index 14bed81..f35e58b 100644 (file)
@@ -1,4 +1,5 @@
 #include <kernel.h>
+#include <serial.h>
 
 /**
  * \brief Kernel stack.
@@ -7,7 +8,20 @@
  */
 uintptr_t kernel_stack[KERNEL_STACK_SIZE / sizeof(uintptr_t)] __attribute__ ((aligned(16)));
 
+__attribute__((noreturn))
 void arch_init(void *arg);
 void arch_init(void *arg)
 {
+    // set console port: XXX which?
+    serial_console_port = 0;
+
+    // init serial console, skip hwinit for now
+    serial_console_init(false);
+
+    // print something
+    printf("Barrelfish APM88xxxx CPU driver starting at addr 0x%"
+            PRIxLVADDR" on core %"PRIuCOREID"\n",
+            local_phys_to_mem((lpaddr_t)&kernel_first_byte), my_core_id);
+
+    while(1);
 }