[patch] x86: clean up early_printk output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



early_printk() starts output on the second screen line and doesn't
clear the rest of the line when it hits a newline char.  When there
is already a BIOS message there, it becomes hard to read.  Change
this so it starts on the first line and clears to EOL upon hitting
newline.

Signed-off-by: Chuck Ebbert <[email protected]>

--- 2.6.16-rc4-64.orig/arch/x86_64/kernel/early_printk.c
+++ 2.6.16-rc4-64/arch/x86_64/kernel/early_printk.c
@@ -21,7 +21,15 @@
 #define MAX_XPOS	max_xpos
 
 static int max_ypos = 25, max_xpos = 80;
-static int current_ypos = 1, current_xpos = 0; 
+static int current_ypos, current_xpos; /* 0,0 */
+
+static noinline void clear_to_eol(int xpos, int ypos)
+{
+	int i;
+
+	for (i = xpos; i < MAX_XPOS; i++)
+		writew(0x720, VGABASE + 2*(MAX_XPOS*ypos + i));
+}
 
 static void early_vga_write(struct console *con, const char *str, unsigned n)
 {
@@ -37,11 +45,11 @@ static void early_vga_write(struct conso
 					       VGABASE + 2*(MAX_XPOS*j + i));
 				}
 			}
-			for (i = 0; i < MAX_XPOS; i++)
-				writew(0x720, VGABASE + 2*(MAX_XPOS*j + i));
+			clear_to_eol(0, j);
 			current_ypos = MAX_YPOS-1;
 		}
 		if (c == '\n') {
+			clear_to_eol(current_xpos, current_ypos);
 			current_xpos = 0;
 			current_ypos++;
 		} else if (c != '\r')  {
-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux