Move debugging messages to appropriate functions.
Move dprintf calls from post() to the function calls that perform the work.
diff --git a/src/ata.c b/src/ata.c
index ab22cc1..62f55d1 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -930,6 +930,7 @@
if (!CONFIG_ATA)
return;
+ dprintf(3, "init hard drives\n");
ata_init();
ata_detect();
diff --git a/src/clock.c b/src/clock.c
index 037d422..aef1be8 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -44,6 +44,7 @@
void
timer_setup()
{
+ dprintf(3, "init timer\n");
pit_setup();
u32 seconds = bcd2bin(inb_cmos(CMOS_RTC_SECONDS));
diff --git a/src/floppy.c b/src/floppy.c
index 9eb7737..1f1c2c5 100644
--- a/src/floppy.c
+++ b/src/floppy.c
@@ -43,6 +43,7 @@
void
floppy_drive_setup()
{
+ dprintf(3, "init floppy drives\n");
u8 type = inb_cmos(CMOS_FLOPPY_DRIVE_TYPE);
u8 out = 0;
u8 num_floppies = 0;
diff --git a/src/kbd.c b/src/kbd.c
index 1f4ea30..fda5847 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -149,6 +149,7 @@
void
kbd_setup()
{
+ dprintf(3, "init keyboard\n");
u16 x = offsetof(struct bios_data_area_s, kbd_buf) - 0x400;
SET_BDA(kbd_mode, 0x10);
SET_BDA(kbd_buf_head, x);
diff --git a/src/post.c b/src/post.c
index 9b54953..718cc2a 100644
--- a/src/post.c
+++ b/src/post.c
@@ -21,6 +21,7 @@
static void
init_bda()
{
+ dprintf(3, "init bda\n");
memset(bda, 0, sizeof(*bda));
int i;
@@ -80,6 +81,7 @@
static void
ram_probe(void)
{
+ dprintf(3, "Find memory size\n");
u32 rs;
if (CONFIG_COREBOOT) {
// XXX - just hardcode for now.
@@ -103,6 +105,7 @@
static void
pic_setup()
{
+ dprintf(3, "init pic\n");
outb(0x11, PORT_PIC1);
outb(0x11, PORT_PIC2);
outb(0x08, PORT_PIC1_DATA);
@@ -121,6 +124,8 @@
static void
init_boot_vectors()
{
+ dprintf(3, "init boot device ordering\n");
+
// Floppy drive
struct ipl_entry_s *ip = &ebda->ipl.table[0];
ip->type = IPL_TYPE_FLOPPY;
@@ -217,22 +222,15 @@
static void
post()
{
- dprintf(3, "init bda\n");
init_bda();
init_ebda();
- dprintf(3, "init timer\n");
timer_setup();
- dprintf(3, "init keyboard\n");
kbd_setup();
- dprintf(3, "init lpt\n");
lpt_setup();
- dprintf(3, "init serial\n");
serial_setup();
- dprintf(3, "init pic\n");
pic_setup();
- dprintf(3, "Find memory size\n");
ram_probe();
dprintf(1, "Scan for VGA option rom\n");
@@ -240,15 +238,11 @@
printf("BIOS - begin\n\n");
- dprintf(3, "rombios32 init\n");
rombios32_init();
- dprintf(3, "init floppy drives\n");
floppy_drive_setup();
- dprintf(3, "init hard drives\n");
hard_drive_setup();
- dprintf(3, "init boot device ordering\n");
init_boot_vectors();
dprintf(1, "Scan for option roms\n");
diff --git a/src/serial.c b/src/serial.c
index f9988a3..5f5afce 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -30,6 +30,7 @@
void
serial_setup()
{
+ dprintf(3, "init serial\n");
u16 count = 0;
count += detect_serial(0x3f8, 0x0a, count);
count += detect_serial(0x2f8, 0x0a, count);
@@ -184,6 +185,7 @@
void
lpt_setup()
{
+ dprintf(3, "init lpt\n");
u16 count = 0;
count += detect_parport(0x378, 0x14, count);
count += detect_parport(0x278, 0x14, count);