Attached please find a patch for FILO which:

* Swaps the order of the nybbles in the color setting byte to make it
the same as the traditional VGA BIOS color byte.

Signed-off-by: Alex Mauer <[EMAIL PROTECTED]>

Index: main/grub/grub.c
===================================================================
--- main/grub/grub.c	(revision 73)
+++ main/grub/grub.c	(working copy)
@@ -901,8 +901,8 @@
 	endwin();
 	using_grub_interface = 1;
 
-	console_setcolor((COLOR_WHITE << 4) | COLOR_BLACK, 
-			 (COLOR_BLACK << 4) | COLOR_WHITE);
+	console_setcolor((COLOR_BLACK << 4) | COLOR_WHITE,
+			 (COLOR_WHITE << 4) | COLOR_BLACK);
 
 	/* Initialize the kill buffer.  */
 	*kill_buf = 0;
Index: main/grub/char_io.c
===================================================================
--- main/grub/char_io.c	(revision 73)
+++ main/grub/char_io.c	(working copy)
@@ -746,8 +746,8 @@
 
 void console_setcolor(int normal_color, int highlight_color)
 {
-	init_pair(1,(normal_color >> 4) &0xf, normal_color & 0xf);
-	init_pair(2,(highlight_color >> 4) &0xf, highlight_color & 0xf);
+	init_pair(1, normal_color & 0xf, (normal_color >> 4) & 0xf);
+	init_pair(2, highlight_color & 0xf, (highlight_color >> 4) & 0xf);
 
 	/* Make curses update the whole screen */
 	redrawwin(stdscr);
Index: main/grub/builtins.c
===================================================================
--- main/grub/builtins.c	(revision 73)
+++ main/grub/builtins.c	(working copy)
@@ -166,7 +166,7 @@
 
 	auto int color_number(char *str);
 
-	/* Convert the color name STR into the magical number.  */
+	/* Convert the color name STR into a VGA color number.  */
 	auto int color_number(char *str) {
 		char *ptr;
 		int i;
@@ -188,10 +188,10 @@
 			str += 6;
 		}
 
-		/* Search for the color name.  */
+		/* Search for the foreground color name.  */
 		for (i = 0; i < 16; i++)
 			if (strcmp(color_list[i], str) == 0) {
-				color |= (i << 4);
+				color |= i;
 				break;
 			}
 
@@ -201,10 +201,10 @@
 		str = ptr;
 		nul_terminate(str);
 
-		/* Search for the color name.  */
+		/* Search for the background color name.  */
 		for (i = 0; i < 8; i++)
 			if (strcmp(color_list[i], str) == 0) {
-				color |= i;
+				color |= (i <<4);
 				break;
 			}
 

--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to