All of lore.kernel.org
 help / color / mirror / Atom feed
* status of VGA terminal
@ 2007-10-19 22:35 Robert Millan
  2007-10-20  7:37 ` Vesa Jääskeläinen
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2007-10-19 22:35 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]


Hi,

Anyone knows what's the status of vga.c ?  It's currently disabled in the build
system.  I reenabled and got it to build again (see attached patch), but it
just displays garbage.

Is it intended to be integrated with gfxterm?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

[-- Attachment #2: vga.diff --]
[-- Type: text/x-diff, Size: 4212 bytes --]

diff -x '*.mk' -ur grub2/conf/i386-pc.rmk grub2.vga/conf/i386-pc.rmk
--- grub2/conf/i386-pc.rmk	2007-10-01 17:50:34.000000000 +0200
+++ grub2.vga/conf/i386-pc.rmk	2007-10-20 00:24:50.000000000 +0200
@@ -129,7 +129,7 @@
 # Modules.
 pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \
 	_multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod	\
-	vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
+	vga.mod vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
 	videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod
 
 # For _chain.mod.
@@ -191,6 +191,11 @@
 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For vga.mod.
+vga_mod_SOURCES = term/i386/pc/vga.c
+vga_mod_CFLAGS = $(COMMON_CFLAGS)
+vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For vbe.mod.
 vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \
 		  video/i386/pc/vbefill.c video/i386/pc/vbeutil.c
diff -x '*.mk' -ur grub2/term/i386/pc/vga.c grub2.vga/term/i386/pc/vga.c
--- grub2/term/i386/pc/vga.c	2007-10-03 22:11:57.000000000 +0200
+++ grub2.vga/term/i386/pc/vga.c	2007-10-20 00:32:44.000000000 +0200
@@ -25,6 +25,7 @@
 #include <grub/normal.h>
 #include <grub/font.h>
 #include <grub/arg.h>
+#include <grub/cpu/io.h>
 
 #define DEBUG_VGA	0
 
@@ -175,7 +176,7 @@
 }
 
 static int
-get_vga_glyph (grub_uint32_t code, unsigned char bitmap[32], unsigned *width)
+get_vga_glyph (grub_uint32_t code, int fill_bitmap, grub_font_glyph_t glyph)
 {
   if (code > 0x7f)
     {
@@ -214,14 +215,14 @@
 	  break;
 
 	default:
-	  return grub_font_get_glyph (code, bitmap, width);
+	  return grub_font_get_glyph (code, glyph);
 	}
     }
 
-  if (bitmap)
-    grub_memcpy (bitmap, vga_font + code * CHAR_HEIGHT, CHAR_HEIGHT);
+  if (fill_bitmap)
+    grub_memcpy (glyph->bitmap, vga_font + code * CHAR_HEIGHT, CHAR_HEIGHT);
   
-  *width = 1;
+  glyph->width = 1;
   return 1;
 }
 
@@ -257,8 +258,7 @@
 write_char (void)
 {
   struct colored_char *p = text_buf + xpos + ypos * TEXT_WIDTH;
-  unsigned char bitmap[32];
-  unsigned width;
+  grub_font_glyph_t glyph;
   unsigned char *mem_base;
   unsigned plane;
 
@@ -266,7 +266,7 @@
 	      ypos * CHAR_HEIGHT * TEXT_WIDTH + PAGE_OFFSET (page)) - p->index;
   p -= p->index;
 
-  if (! get_vga_glyph (p->code, bitmap, &width))
+  if (! get_vga_glyph (p->code, 1, glyph))
     invalidate_char (p);
   
   for (plane = 0x01; plane <= 0x08; plane <<= 1)
@@ -283,12 +283,12 @@
 	{
 	  unsigned i;
 
-	  for (i = 0; i < width && offset < 32; i++)
+	  for (i = 0; i < glyph->width && offset < 32; i++)
 	    {
 	      unsigned char fg_mask, bg_mask;
 	      
-	      fg_mask = (p->fg_color & plane) ? bitmap[offset] : 0;
-	      bg_mask = (p->bg_color & plane) ? ~(bitmap[offset]) : 0;
+	      fg_mask = (p->fg_color & plane) ? glyph->bitmap[offset] : 0;
+	      bg_mask = (p->bg_color & plane) ? ~(glyph->bitmap[offset]) : 0;
 	      offset++;
 
 	      if (check_vga_mem (mem + i))
@@ -393,36 +393,36 @@
     }
   else
     {
-      unsigned width;
+      grub_font_glyph_t glyph;
       struct colored_char *p;
       
-      get_vga_glyph (c, 0, &width);
+      get_vga_glyph (c, 0, glyph);
 
-      if (xpos + width > TEXT_WIDTH)
+      if (xpos + glyph->width > TEXT_WIDTH)
 	grub_putchar ('\n');
 
       p = text_buf + xpos + ypos * TEXT_WIDTH;
       p->code = c;
       p->fg_color = fg_color;
       p->bg_color = bg_color;
-      p->width = width - 1;
+      p->width = glyph->width - 1;
       p->index = 0;
 
-      if (width > 1)
+      if (glyph->width > 1)
 	{
 	  unsigned i;
 
-	  for (i = 1; i < width; i++)
+	  for (i = 1; i < glyph->width; i++)
 	    {
 	      p[i].code = ' ';
-	      p[i].width = width - 1;
+	      p[i].width = glyph->width - 1;
 	      p[i].index = i;
 	    }
 	}
 	  
       write_char ();
   
-      xpos += width;
+      xpos += glyph->width;
       if (xpos >= TEXT_WIDTH)
 	{
 	  xpos = 0;
@@ -454,12 +454,12 @@
 static grub_ssize_t
 grub_vga_getcharwidth (grub_uint32_t c)
 {
-  unsigned width;
+  grub_font_glyph_t glyph;
   
-  if (! get_vga_glyph (c, 0, &width))
+  if (! get_vga_glyph (c, 0, glyph))
     return 0;
 
-  return width;
+  return glyph->width;
 }
 
 static grub_uint16_t

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

* Re: status of VGA terminal
  2007-10-19 22:35 status of VGA terminal Robert Millan
@ 2007-10-20  7:37 ` Vesa Jääskeläinen
  2007-10-20 19:26   ` Robert Millan
  0 siblings, 1 reply; 5+ messages in thread
From: Vesa Jääskeläinen @ 2007-10-20  7:37 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan wrote:
> Hi,
> 
> Anyone knows what's the status of vga.c ?  It's currently disabled in the build
> system.  I reenabled and got it to build again (see attached patch), but it
> just displays garbage.
> 
> Is it intended to be integrated with gfxterm?

If you want to make video driver for it then and keep it up-to-date,
otherwise no. Personally I have no intention to work on it. It displays
garbage because font system has changed... and will be changed again in
future once there is vector font support. For that I think font blitter
goes away and new bitmap blitter (or old one) is used.

Question how to scale to different display sizes hasn't been solved
either... This is the main reason for vector fonts, scaling bitmap fonts
just gets really ugly.



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

* Re: status of VGA terminal
  2007-10-20  7:37 ` Vesa Jääskeläinen
@ 2007-10-20 19:26   ` Robert Millan
  2007-10-20 19:33     ` Vesa Jääskeläinen
  2007-10-21 10:26     ` Marco Gerards
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Millan @ 2007-10-20 19:26 UTC (permalink / raw)
  To: The development of GRUB 2

On Sat, Oct 20, 2007 at 10:37:16AM +0300, Vesa Jääskeläinen wrote:
> Robert Millan wrote:
> > Hi,
> > 
> > Anyone knows what's the status of vga.c ?  It's currently disabled in the build
> > system.  I reenabled and got it to build again (see attached patch), but it
> > just displays garbage.
> > 
> > Is it intended to be integrated with gfxterm?
> 
> If you want to make video driver for it then and keep it up-to-date,
> otherwise no. Personally I have no intention to work on it. It displays
> garbage because font system has changed... and will be changed again in
> future once there is vector font support. For that I think font blitter
> goes away and new bitmap blitter (or old one) is used.
> 
> Question how to scale to different display sizes hasn't been solved
> either... This is the main reason for vector fonts, scaling bitmap fonts
> just gets really ugly.

Ok, when I have some time I'll try making it a video driver then.

In the meantime, should we remove it from CVS ?  It will have to be removed
anyway since video drivers don't belong in term/.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



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

* Re: status of VGA terminal
  2007-10-20 19:26   ` Robert Millan
@ 2007-10-20 19:33     ` Vesa Jääskeläinen
  2007-10-21 10:26     ` Marco Gerards
  1 sibling, 0 replies; 5+ messages in thread
From: Vesa Jääskeläinen @ 2007-10-20 19:33 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan wrote:
> On Sat, Oct 20, 2007 at 10:37:16AM +0300, Vesa Jääskeläinen wrote:
>> Robert Millan wrote:
>>> Hi,
>>>
>>> Anyone knows what's the status of vga.c ?  It's currently disabled in the build
>>> system.  I reenabled and got it to build again (see attached patch), but it
>>> just displays garbage.
>>>
>>> Is it intended to be integrated with gfxterm?
>> If you want to make video driver for it then and keep it up-to-date,
>> otherwise no. Personally I have no intention to work on it. It displays
>> garbage because font system has changed... and will be changed again in
>> future once there is vector font support. For that I think font blitter
>> goes away and new bitmap blitter (or old one) is used.
>>
>> Question how to scale to different display sizes hasn't been solved
>> either... This is the main reason for vector fonts, scaling bitmap fonts
>> just gets really ugly.
> 
> Ok, when I have some time I'll try making it a video driver then.
> 
> In the meantime, should we remove it from CVS ?  It will have to be removed
> anyway since video drivers don't belong in term/.

Well it is vga terminal :). Implements terminal interface at the moment.
Just being a bit rotten... That is the reason why it is disabled. That
being said, if there would be really a vga video driver then that would
definitely need to be placed elsewhere. If you just remove it from CVS
it will most likely be forgotten and base code will be "lost".

You are of course free to do as you wish with vga terminal. I have no
objections on its removal.




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

* Re: status of VGA terminal
  2007-10-20 19:26   ` Robert Millan
  2007-10-20 19:33     ` Vesa Jääskeläinen
@ 2007-10-21 10:26     ` Marco Gerards
  1 sibling, 0 replies; 5+ messages in thread
From: Marco Gerards @ 2007-10-21 10:26 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan <rmh@aybabtu.com> writes:

[...]

> Ok, when I have some time I'll try making it a video driver then.
>
> In the meantime, should we remove it from CVS ?  It will have to be removed
> anyway since video drivers don't belong in term/.

Please do not remove it before the video driver has been committed.

--
Marco




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

end of thread, other threads:[~2007-10-21 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 22:35 status of VGA terminal Robert Millan
2007-10-20  7:37 ` Vesa Jääskeläinen
2007-10-20 19:26   ` Robert Millan
2007-10-20 19:33     ` Vesa Jääskeläinen
2007-10-21 10:26     ` Marco Gerards

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.