diff --git a/drivers/bcm2835_videocore.c b/drivers/bcm2835_videocore.c index c41f52d..43f113b 100644 --- a/drivers/bcm2835_videocore.c +++ b/drivers/bcm2835_videocore.c @@ -113,6 +113,7 @@ int bcm2835_videocore_init_dev(struct fb *f, unsigned int color_depth) { } struct fb_dev videocore_dev = { + .name ="bcm2835_videocore", .init = &bcm2835_videocore_init_dev }; diff --git a/drivers/pi_mini_uart.c b/drivers/pi_mini_uart.c index 5801d07..7a28a7a 100644 --- a/drivers/pi_mini_uart.c +++ b/drivers/pi_mini_uart.c @@ -110,6 +110,7 @@ int mini_uart_putc(char c) { } struct serial_dev mini_uart_dev = { + .name = "pi_mini_uart", .putc = &mini_uart_putc }; diff --git a/drivers/pl011.c b/drivers/pl011.c index 122f252..b2d68a7 100644 --- a/drivers/pl011.c +++ b/drivers/pl011.c @@ -38,6 +38,7 @@ int pl011_putc(char c) } struct serial_dev pl011_dev = { + .name = "pl011", .putc = &pl011_putc }; diff --git a/drivers/pl111.c b/drivers/pl111.c index e46b18e..0cf6357 100644 --- a/drivers/pl111.c +++ b/drivers/pl111.c @@ -92,6 +92,7 @@ int pl111_init_dev(struct fb *f, unsigned int color_depth) { } struct fb_dev pl111_dev = { + .name = "pl111", .init = &pl111_init_dev }; diff --git a/include/drivers/serial.h b/include/drivers/serial.h index 80da521..edbe34a 100644 --- a/include/drivers/serial.h +++ b/include/drivers/serial.h @@ -20,11 +20,17 @@ #include +#ifndef SERIAL_H +#define SERIAL_H + struct serial_dev { //TODO add more functions and attributes here + char *name; int (*putc)(char); struct dlist_node list; }; int serial_register_device(struct serial_dev *sdev); struct serial_dev *serial_first_device(); + +#endif /* SERIAL_H */ diff --git a/kernel/start_kernel.c b/kernel/start_kernel.c index bf0f679..08fc3a0 100644 --- a/kernel/start_kernel.c +++ b/kernel/start_kernel.c @@ -38,7 +38,7 @@ void print_console_logo() { print_func(&console_putc, " / _ \\ / _ \\/ _` | '__| \\ \\/ /\n"); print_func(&console_putc, " / ___ \\ __/ (_| | | | |> <\n"); print_func(&console_putc, " /_/ \\_\\___|\\__,_|_| |_/_/\\_\\\n\n"); - print_func(&console_putc, " Copyright (C) 2012 - Aaron Lindsay\n"); + print_func(&console_putc, " Copyright (C) 2012 - Aaron Lindsay\n\n\n"); } void video_console_init(void) { @@ -60,13 +60,18 @@ void video_console_init(void) { return; print_console_logo(); + + print_func(&console_putc, "Successfully initialized video console on %s.\n", fbdev->name); } void serial_console_init() { struct serial_dev *sdev = serial_first_device(); - if (sdev) - print_init(sdev->putc); + if (!sdev) + return; + + print_init(sdev->putc); + print("Successfully initialized serial console on %s\n", sdev->name); } void serial_init(); @@ -100,6 +105,7 @@ int main(void) { do { lower = (char *)atags->data.mem.start; upper = lower + atags->data.mem.size - 1; + print("atags: physical memory at %x-%x\n", lower, upper); declare_memory_region(lower, upper); } while (!atags_next_mem_region(&atags));