On Tue, May 26, 2009 at 03:02:08PM +0200, Luc Verhaegen wrote:
Since i have some spare time on my hands now (;)) and because ruik tickled me, i dusted off some native VGA code i had sitting around since 2007.
This is only part of the solution, as the complete thing adds full native vga textmodeset support for the VIA CLE266. But i am still trying to track down an issue there.
Part of the explanation of this patch is of course in the diff header, so read that first, then read on here.
Issue: kernel calls int10 set video mode, and (unless provided by something else) consequently assumes that since this hook isn't implemented it must be talking to a CGA device. So a message appears that the vt is a CGA 80x25, and the character height is assumed to be 8. The real character height is 16 though, but the only effect is that you have the cursor floating halfway the character, everything else is just fine.
Usage: Here is a snippet of the code in my northbridge/via/vt8623/unichrome.c .init hook:
+#if CONFIG_VGA == 1
- /* Now set up the VGA console */
- vga_io_init(); /* Enable full IO access */
- unichrome_vga_init(dev);
- vga_textmode_init();
+#if CONFIG_CONSOLE_VGA == 1
- vga_console_init();
+#endif
- printk_info("UniChrome VGA Textmode initialized.\n");
+#if CONFIG_CONSOLE_VGA == 0
- /* if we don't have console, at least print something... */
- vga_line_write(0, "UniChrome VGA Textmode initialized.");
+#endif
+#endif /* CONFIG_VGA */
TODO's in the vga console code will be dealt with. Right now i want to reduce my diff and make the whole more manageable.
Luc Verhaegen.
Implement native VGA Support.
This code brings a rather complete set of VGA IO routines for whoever wants it. These consist of the by now familiar read/write/mask sets. Due to the crazy nature of VGA, an ancient standard with bits all over the place, it makes no sense to define individual registers. You need a vga register spec at hand if you want to do anything anyway. These IO routines are always exposed.
It also provides code to natively set up a 640x400 VGA textmode with an 8x16 font. The native VGA mode code is behind the OPTION_VGA option, as the font really adds to the size of the compiled/compressed rom. The font is the one also present in the linux kernel, but this file is unlicensed. Another copy of this is also present in coreboot in the deprecated console/btext code.
The vga console code has been cleaned up, but it still has some TODO's left open, but that's for when i finally have found the remaining issue with the epia-m. Right now, it is important to get parts of my work out already and to make the remainder managable again.
Signed-off-by: Luc Verhaegen libv@skynet.be
No takers?
Luc Verhaegen.