Skip to contentSkip to conversation

Fix for vga terminal

PATCH In review Vesa Jääskeläinen 2 participants 3 messages Nov 10, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for vga terminal

Hi All,

Here is patch for fixing vga terminal. At least it worked fine on qemu. Now it uses only font system to get fonts so you need to load font module and use fonts. See gfxterm section on the wiki on how to do that.

I had to edit patch by hand as 64bit patch is still pending and I need that to compile my codes. But it should still apply nicely to current CVS.

Thanks,
Vesa Jääskeläinen

Index: ChangeLog
===================================================================
RCS file: /sources/grub/grub2/ChangeLog,v
retrieving revision 1.438

ChangeLog +20 -0
diff -u -r1.438 ChangeLog
@@ -1,3 +1,23 @@
+2007-11-10  Vesa Jaaskelainen  <[email protected]>
+
+	* conf/i386-pc.rmk (pkgdata_MODULES): Added vga.mod.
+	(vga_mod_SOURCES): Added.
+	(vga_mod_CFLAGS): Likewise.
+	(vga_mod_LDFLAGS): Likewise.
+
+	* term/i386/pc/vga.c (get_map_mask): Switch order of arguments in
+	grub_outb() calls.
+	(set_map_mask): Likewise.
+	(set_read_map): Likewise.
+	(set_read_address): Likewise.
+	(vga_font): Removed variable.
+	(get_vga_glyph): Removed function.
+	(invalidate_char): Likewise.
+	(write_char): Changed to use grub_font_get_glyph() for font
+	information.
+	(grub_vga_putchar): Likewise.
+	(grub_vga_getcharwidth): Likewise.
+
 2007-11-06  Robert Millan  <[email protected]>
 
 	* term/i386/pc/serial.c (serial_hw_put): Switch order of arguments

Index: conf/i386-pc.rmk
===================================================================
RCS file: /sources/grub/grub2/conf/i386-pc.rmk,v
retrieving revision 1.91

i386-pc.rmk +7 -1
diff -u -r1.91 i386-pc.rmk
@@ -129,7 +129,8 @@
 pkgdata_MODULES = biosdisk.mod _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 \
-	videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod ata.mod
+	videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod ata.mod \
+	vga.mod
 
 # For biosdisk.mod.
 biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c
@@ -251,4 +252,9 @@
 ata_mod_CFLAGS = $(COMMON_CFLAGS)
 ata_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)
+
 include $(srcdir)/conf/common.mk

Index: term/i386/pc/vga.c
===================================================================
RCS file: /sources/grub/grub2/term/i386/pc/vga.c,v retrieving revision 1.12

i386/pc/vga.c +32 -106

249 lines not on this page · raw message

#1 lore raw

Vesa Jääskeläinen <[email protected]> writes:

Hi Vesa,

Quoted 6 lines

Here is patch for fixing vga terminal. At least it worked fine on qemu. Now it uses only font system to get fonts so you need to load font module and use fonts. See gfxterm section on the wiki on how to do that.

I had to edit patch by hand as 64bit patch is still pending and I need that to compile my codes. But it should still apply nicely to current CVS.

Great! Thanks for fixing this!

[...]

Quoted 9 lines

+2007-11-10 Vesa Jaaskelainen <[email protected]>

ChangeLog +8 -0
+
+	* conf/i386-pc.rmk (pkgdata_MODULES): Added vga.mod.
+	(vga_mod_SOURCES): Added.
+	(vga_mod_CFLAGS): Likewise.
+	(vga_mod_LDFLAGS): Likewise.
+
+	* term/i386/pc/vga.c (get_map_mask): Switch order of arguments in
+	grub_outb() calls.

ChangeLog line 19

Quoted 10 lines
ChangeLog +10 -0
+	(set_map_mask): Likewise.
+	(set_read_map): Likewise.
+	(set_read_address): Likewise.
+	(vga_font): Removed variable.
+	(get_vga_glyph): Removed function.
+	(invalidate_char): Likewise.
+	(write_char): Changed to use grub_font_get_glyph() for font
+	information.
+	(grub_vga_putchar): Likewise.
+	(grub_vga_getcharwidth): Likewise.

This looks good to me. Feel free to commit this! :-)

--
Marco

#2 lore raw
Quoted 4 lines · Marco Gerards

Vesa Jääskeläinen <[email protected]> writes:

Hi Vesa,

Quoted 8 lines
Quoted 6 lines

Here is patch for fixing vga terminal. At least it worked fine on qemu. Now it uses only font system to get fonts so you need to load font module and use fonts. See gfxterm section on the wiki on how to do that.

I had to edit patch by hand as 64bit patch is still pending and I need that to compile my codes. But it should still apply nicely to current CVS.

This looks good to me. Feel free to commit this! :-)

Done.