diff --git a/Makefile b/Makefile index 4d85a03..50ea96b 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,8 @@ KERNEL_OBJ := \ kern/libkern/panic.o \ kern/libkern/memory.o \ kern/libkern/spinlock.o \ - kern/libkern/mini-printf.o + kern/libkern/mini-printf.o \ + kern/libkern/stdio.o kern/kernel.elf: $(KERNEL_OBJ) @echo LD $@ diff --git a/kern/libkern/uart.c b/kern/libkern/uart.c index bb753f3..df0af5d 100644 --- a/kern/libkern/uart.c +++ b/kern/libkern/uart.c @@ -4,7 +4,3 @@ void uart_putc(char c) { *UART_BASE = c; } - -void uart_puts(const char *s) { - while (*s) uart_putc(*s++); -} diff --git a/kern/libkern/uart.h b/kern/libkern/uart.h index 953c5f6..8f08f1a 100644 --- a/kern/libkern/uart.h +++ b/kern/libkern/uart.h @@ -4,7 +4,4 @@ /** Send a single character to the UART device */ void uart_putc(char c); -/** Send a **NULL TERMINATED** string to the UART device */ -void uart_puts(const char *s); - #endif diff --git a/kern/start.c b/kern/start.c index e717064..15a224f 100644 --- a/kern/start.c +++ b/kern/start.c @@ -1,10 +1,12 @@ #include #include #include +#include #include #include #include #include +#include #include /** @@ -37,30 +39,24 @@ void start() { if (id == 0) { /* Here we will do a bunch of initialization steps */ kalloc_init(); - uart_puts("Hello Neptune!\n"); spinlock_init(&sl); + kprintf("Hello Neptune!\n"); + + __sync_synchronize(); hold = 0; } else { while (hold); } - // spin_lock(&sl); - // - // uart_puts("Hart number: "); - // uart_putc(id + '0'); - // uart_putc('\n'); - // - // spin_unlock(&sl); - if (id == 0) { spin_lock(&sl); - uart_puts("Core count: "); - uart_putc(max_hart + '0'); - uart_putc('\n'); - if (max_hart == NCPU) { - uart_puts("All cores up!"); - uart_putc('\n'); - } + kprintf("Core count: %d\n", max_hart); + + if (max_hart == NCPU) + kprintf("All cores up!\n"); + else + PANIC("Some cores seem to have been enumerated incorrectly!\n"); + spin_unlock(&sl); }