1
0

Store device's names and add more startup messages

This commit is contained in:
Aaron Lindsay 2012-10-07 23:38:37 -04:00
parent d7f354221f
commit a64668b239
6 changed files with 19 additions and 3 deletions

View File

@ -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
};

View File

@ -110,6 +110,7 @@ int mini_uart_putc(char c) {
}
struct serial_dev mini_uart_dev = {
.name = "pi_mini_uart",
.putc = &mini_uart_putc
};

View File

@ -38,6 +38,7 @@ int pl011_putc(char c)
}
struct serial_dev pl011_dev = {
.name = "pl011",
.putc = &pl011_putc
};

View File

@ -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
};

View File

@ -20,11 +20,17 @@
#include <list.h>
#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 */

View File

@ -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)
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));