I have changed banner so it makes a uniform width message. It is now
more complex.

ron
Per a request, have the banner print out in a very uniform manner. 

Signed-off-by: Ronald G. Minnich <[EMAIL PROTECTED]>

Index: lib/console.c
===================================================================
--- lib/console.c	(revision 542)
+++ lib/console.c	(working copy)
@@ -46,6 +46,29 @@
 	return i;
 }
 
+/**
+ * Print a nice banner so we know what step we died on. 
+ *
+ * @param level The printk level (e.g. BIOS_EMERG)
+ * @param s String to put in the middle of the banner
+ */
+
+void banner(int level, char *s)
+{
+	int i;
+	/* 10 = signs and a space. */
+	printk(level, "========== ");
+	for(i = 11; *s; i++, s++)
+		printk(level, "%c", *s);
+	/* trailing space */
+	printk(level, " ");
+	i++;
+	/* fill it up to 80 columns */
+	for(;  i < 80; i++)
+		printk(level, "=");
+	printk(level, "\n");
+}
+
 void console_init(void)
 {
 	static const char console_test[] =
@@ -59,9 +82,31 @@
 	printk(BIOS_INFO, console_test);
 }
 
+/**
+ *  Halt and loop due to a fatal error. 
+ *  There have been several iterations of this function. 
+ *  The first simply did a hlt(). Doing a hlt() can make jtag debugging
+ *  very difficult as one can not break into a hlt instruction on some CPUs. 
+ *  Second was to do a console_tx_byte of a NULL character. 
+ *  A number of concerns were raised about doing this idea. 
+ *  Third idea was to do an inb from port 0x80, the POST port. That design 
+ *  makes us very CPU-specific. 
+ *  The fourth idea was just POSTING the same
+ *  code over and over. That would erase the most recent POST code, 
+ *  hindering diagnosis. 
+ *
+ *  For now, for lack of a good alternative, 
+ *  we will continue to call console_tx_byte. We call with a NULL since
+ *  it will clear any FIFOs in the path and won't clutter up the output,
+ *  since NULL doesn't print a visible character on most terminal 
+ *  emulators. 
+ *
+ *  @param str A string to print for the error
+ *
+ */
 void die(const char *str)
 {
 	printk(BIOS_EMERG, str);
 	while (1)
-		hlt();
+		console_tx_byte(0, (void *)0);
 }
-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to