From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Subject: status of VGA terminal
Date: Sat, 20 Oct 2007 00:35:33 +0200 [thread overview]
Message-ID: <20071019223533.GA29164@thorin> (raw)
[-- 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
next reply other threads:[~2007-10-19 22:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-19 22:35 Robert Millan [this message]
2007-10-20 7:37 ` status of VGA terminal 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071019223533.GA29164@thorin \
--to=rmh@aybabtu.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.