[coreboot] r75 - trunk/filo/main/grub

svn at coreboot.org svn at coreboot.org
Thu Oct 2 09:39:09 CEST 2008


Author: oxygene
Date: 2008-10-02 09:39:09 +0200 (Thu, 02 Oct 2008)
New Revision: 75

Modified:
   trunk/filo/main/grub/builtins.c
   trunk/filo/main/grub/char_io.c
   trunk/filo/main/grub/grub.c
Log:
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 <hawke at hawkesnest.net> 
Acked-by: Patrick Georgi <patrick.georgi at coresystems.de>

Modified: trunk/filo/main/grub/builtins.c
===================================================================
--- trunk/filo/main/grub/builtins.c	2008-10-02 07:38:29 UTC (rev 74)
+++ trunk/filo/main/grub/builtins.c	2008-10-02 07:39:09 UTC (rev 75)
@@ -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;
 			}
 

Modified: trunk/filo/main/grub/char_io.c
===================================================================
--- trunk/filo/main/grub/char_io.c	2008-10-02 07:38:29 UTC (rev 74)
+++ trunk/filo/main/grub/char_io.c	2008-10-02 07:39:09 UTC (rev 75)
@@ -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);

Modified: trunk/filo/main/grub/grub.c
===================================================================
--- trunk/filo/main/grub/grub.c	2008-10-02 07:38:29 UTC (rev 74)
+++ trunk/filo/main/grub/grub.c	2008-10-02 07:39:09 UTC (rev 75)
@@ -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;





More information about the coreboot mailing list