gplv3/seabios/centos/patches/CGTS-5175-Add-instrumentati...

68 lines
2.1 KiB
Diff

From 7cc3d0e6149ea9276edef25ba85d08879ee40771 Mon Sep 17 00:00:00 2001
From: Jim Gauld <james.gauld@windriver.com>
Date: Thu, 6 Oct 2016 14:18:35 -0400
Subject: [PATCH 1/1] CGTS-5175: Add instrumentation to debug boot failures
from disk
This adds print statements with prefix "Debug:" showing
boot register flags before and after interrupt, etc.
In the case we get instances with "No bootable device", we want
to see more information in the case where retry is not sufficient.
---
src/boot.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/boot.c b/src/boot.c
index 706b7df..c89086b 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -2,6 +2,7 @@
//
// Copyright (C) 2008-2013 Kevin O'Connor <kevin@koconnor.net>
// Copyright (C) 2002 MandrakeSoft S.A.
+// Copyright (C) 2016 Wind River Systems, Inc. All rights reserved.
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
@@ -596,7 +597,7 @@ bcv_prepboot(void)
static void
call_boot_entry(struct segoff_s bootsegip, u8 bootdrv)
{
- dprintf(1, "Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset);
+ printf("Debug: Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset);
struct bregs br;
memset(&br, 0, sizeof(br));
br.flags = F_IF;
@@ -622,9 +623,11 @@ boot_disk(u8 bootdrv, int checksig)
br.ah = 2;
br.al = 1;
br.cl = 1;
+ printf("Debug: boot_disk: pre: br.flags=%04x\n", br.flags);
call16_int(0x13, &br);
if (br.flags & F_CF) {
+ printf("Debug: boot_disk: post: br.flags=%04x, F_CF=%04x\n", br.flags, F_CF);
printf("Boot failed: could not read the boot disk\n\n");
return;
}
@@ -719,6 +722,7 @@ do_boot(int seq_nr)
if (! CONFIG_BOOT)
panic("Boot support not compiled in.\n");
+ printf("Debug: do_boot: seq_nr=%d, BEVCount=%d\n", seq_nr, BEVCount);
if (seq_nr >= BEVCount)
boot_fail();
@@ -748,6 +752,7 @@ do_boot(int seq_nr)
}
// Boot failed: invoke the boot recovery function
+ printf("Debug: do_boot: boot recovery\n");
struct bregs br;
memset(&br, 0, sizeof(br));
br.flags = F_IF;
--
1.9.1