Hello. I've made a color-patch for Grub. This makes Grub look a bit 
like OS/2 Boot Manager. The cursor is also turned off in the menu.
Comments?


diff -u4 -r cvsgrub/grub/asmstub.c grub/grub/asmstub.c
--- cvsgrub/grub/asmstub.c      Tue Jun  1 20:17:55 1999
+++ grub/grub/asmstub.c Wed Jun  2 00:35:17 1999
@@ -388,8 +388,14 @@
     clear ();
 #endif
 }
 
+/* Turn off cursor. No-op right now. */
+void
+nocursor (void)
+{
+  ;
+}
 
 /* returns packed values, LSB+1 is x, LSB is y */
 int
 getxy (void)
Only in grub/shared_src: Makefile
diff -u4 -r cvsgrub/shared_src/asm.S grub/shared_src/asm.S
--- cvsgrub/shared_src/asm.S    Wed May 12 04:43:12 1999
+++ grub/shared_src/asm.S       Wed Jun  2 00:27:29 1999
@@ -1136,8 +1136,40 @@
        pop     %eax
        pop     %ebp
        ret
 
+       
+/*
+ * nocursor()
+ * BIOS call "INT 10H Function 01h" to set cursor type
+ *      Call with       %ah = 0x01
+ *                      %ch = cursor starting scanline
+ *                      %cl = cursor ending scanline
+ */
+
+ENTRY(nocursor)
+       push    %ebp
+       push    %eax
+       push    %ebx                    /* save EBX */
+       push    %edx
+
+       call    EXT_C(prot_to_real)
+       .code16
+
+       movw    $0x2000, %cx
+        movb    $0x1, %ah
+        int     $0x10 
+
+       data32
+       call    EXT_C(real_to_prot)
+       .code32
+
+       pop     %edx
+       pop     %ebx
+       pop     %eax
+       pop     %ebp
+       ret
+               
 
 /*
  * getxy()
  * BIOS call "INT 10H Function 03h" to get cursor position
diff -u4 -r cvsgrub/shared_src/shared.h grub/shared_src/shared.h
--- cvsgrub/shared_src/shared.h Tue Jun  1 20:17:57 1999
+++ grub/shared_src/shared.h    Wed Jun  2 00:32:11 1999
@@ -184,10 +184,12 @@
 # define KEY_NPAGE       0x4900
 # define KEY_PPAGE       0x5100
 # define A_NORMAL        0x7
 # define A_REVERSE       0x70
+# define A_BACKGROUND    0x17
 #else
 # include <curses.h>
+# define A_BACKGROUND    0x17
 #endif
 
 /* Special graphics characters for IBM displays. */
 #define DISP_UL         218
@@ -421,8 +423,11 @@
 int getrtsecs (void);
 
 /* Clear the screen. */
 void cls (void);
+
+/* Turn off cursor. */
+void nocursor (void);
 
 /* Get the current cursor position (where 0,0 is the top left hand
    corner of the screen).  Returns packed values, (RET >> 8) is x,
    (RET & 0xff) is y. */
diff -u4 -r cvsgrub/shared_src/stage2.c grub/shared_src/stage2.c
--- cvsgrub/shared_src/stage2.c Tue Jun  1 16:59:50 1999
+++ grub/shared_src/stage2.c    Wed Jun  2 00:31:15 1999
@@ -88,8 +88,14 @@
 print_border(int y, int size)
 {
   int i;
 
+  /* Color the menu. The menu is 75*14 characters */
+    for ( i = 0; i < 1050; i++) 
+      { 
+        gotoxy( (i % 75) + 1, (i / 75) + y); 
+        set_attrib(A_BACKGROUND); 
+      } 
   gotoxy(1, y);
 
   putchar(DISP_UL);
   for (i = 0; i < 73; i++)
@@ -151,8 +157,9 @@
       first_entry++; entryno--;
     }
 
   init_page();
+  nocursor(); 
 
   print_border(3, 12);
 
   printf("\n
@@ -221,9 +228,9 @@
          if ((c == KEY_UP) || (ASCII_CHAR(c) == 16))
            {
              if (entryno > 0)
                {
-                 set_line (4 + entryno, A_NORMAL);
+                 set_line (4 + entryno, A_BACKGROUND);
                  entryno --;
                  set_line (4 + entryno, A_REVERSE);
                }
              else if (first_entry > 0)
@@ -237,9 +244,9 @@
              && (first_entry+entryno+1) < num_entries)
            {
              if (entryno < 11)
                {
-                 set_line (4 + entryno, A_NORMAL);
+                 set_line (4 + entryno, A_BACKGROUND);
                  entryno ++;
                  set_line (4 + entryno, A_REVERSE);
                }
              else if (num_entries > 12+first_entry)
@@ -260,9 +267,9 @@
          else
            {
              if ((c == 'd') || (c == 'o') || (c == 'O'))
                {
-                 set_line (4 + entryno, A_NORMAL);
+                 set_line (4 + entryno, A_BACKGROUND);
                  /* insert after is almost exactly like insert before */
                  if (c == 'o')
                    {
                      entryno++;



/////
 o o
  -... said Peter. 

Reply via email to