public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] x86: clean up early_printk output
@ 2006-02-25  0:07 Chuck Ebbert
  2006-02-25  2:07 ` Andrew Morton
  2006-02-25  4:29 ` Andi Kleen
  0 siblings, 2 replies; 4+ messages in thread
From: Chuck Ebbert @ 2006-02-25  0:07 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, linux-kernel, Linus Torvalds

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 <76306.1226@compuserve.com>

--- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [patch] x86: clean up early_printk output
@ 2006-02-25  6:22 Chuck Ebbert
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Ebbert @ 2006-02-25  6:22 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Linus Torvalds, linux-kernel, Andrew Morton

In-Reply-To: <200602250529.11099.ak@suse.de>

On Sat, 25 Feb 2006 at 05:29:10 +0100, Andi Kleen wrote:

> early_printk is designed to do absolutely minimal work to get the 
> message out. Your patch adds too much potential disturbance 
> imho.

You're kidding... right?

early_printk copies the entire screen up, line-by-line, in order to do
scrolling, then blanks the bottom line using the exact code I used to
clear to EOL.  How can that be OK if my fix isn't?

-- 
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-25  6:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-25  0:07 [patch] x86: clean up early_printk output Chuck Ebbert
2006-02-25  2:07 ` Andrew Morton
2006-02-25  4:29 ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-02-25  6:22 Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox