From 42dd2d07fe194454dbc4027f3c02164f03be9eb4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 8 Aug 2011 20:36:00 +0200 Subject: Let GNU Mach messages appear under Hurd console * console-client/vga-dynafont.c (dynafont_new): Force ASCII glyphs as being always trivially mapped. * console-client/vga-hw.h (VGA_VIDEO_MEM_BASE_ADDR): Set macro to 0x0b8000. * console-client/vga-support.c [!OSKIT_MACH]: Do not include and , remove VIDMMAP_BEGIN, VIDMMAP_SIZE and VIDMMAP_KDOFS macros. (vga_init): Remove code which maps video memory from the kd device. Use VGA_GFX_MISC_B8TOBF instead of VGA_GFX_MISC_A0TOAF or VGA_GFX_MISC_A0TOBF. --- console-client/vga-dynafont.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'console-client/vga-dynafont.c') diff --git a/console-client/vga-dynafont.c b/console-client/vga-dynafont.c index f72e45de..834d0aca 100644 --- a/console-client/vga-dynafont.c +++ b/console-client/vga-dynafont.c @@ -529,6 +529,31 @@ dynafont_new (bdf_font_t font, bdf_font_t font_italic, bdf_font_t font_bold, df->vga_font_last_free_index_lgc = 0; } + /* Ensure that ASCII is always available 1-to-1, for kernel messages. */ + for (int c = ' '; c <= '~'; c++) + { + glyph = bdf_find_glyph (df->font, c, 0); + if (!glyph) + glyph = bdf_find_glyph (df->font, -1, c); + if (glyph) + { + struct mapped_character *chr = &df->charmap_data[c]; + df->vga_font_free_indices--; + chr->refs = 1; + + for (int i = 0; i < ((glyph->bbox.height > 32) + ? 32 : glyph->bbox.height); i++) + df->vga_font[c][i] + = glyph->bitmap[i * ((glyph->bbox.width + 7) / 8)]; + if (glyph->bbox.height < 32) + memset (((char *) df->vga_font[c]) + + glyph->bbox.height, 0, 32 - glyph->bbox.height); + + /* Update the hash table. */ + hurd_ihash_add (&df->charmap, c, chr); + } + } + /* Ensure that we always have the replacement character available. */ { -- cgit v1.2.3