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.
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.
Luc Verhaegen wrote:
Implement native VGA Support.
Looks great! Just one question:
--- src/include/pc80/vga.h (revision 4298) +++ src/include/pc80/vga.h (working copy) @@ -1,228 +1,43 @@ /*
- Copyright (C) 2007-2009 Luc Verhaegen libv@skynet.be
- modified
- by Steve M. Gehlbach steve@kesa.com
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your option)
- any later version.
- Originally from linux/drivers/video/vga16.c by
..
Is all the stuff in vga.h useless? Not used anywhere? Would it make sense to first rm the file and then add your new file instead, for a cleaner commit?
//Peter
On Wed, May 27, 2009 at 08:03:56PM +0200, Peter Stuge wrote:
Luc Verhaegen wrote:
Implement native VGA Support.
Looks great! Just one question:
--- src/include/pc80/vga.h (revision 4298) +++ src/include/pc80/vga.h (working copy) @@ -1,228 +1,43 @@ /*
- Copyright (C) 2007-2009 Luc Verhaegen libv@skynet.be
- modified
- by Steve M. Gehlbach steve@kesa.com
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your option)
- any later version.
- Originally from linux/drivers/video/vga16.c by
..
Is all the stuff in vga.h useless? Not used anywhere? Would it make sense to first rm the file and then add your new file instead, for a cleaner commit?
//Peter
Mostly useless, yes, only the console code used a very minor part of it. It was a direct copy of the code from the kernel, and no code to back it was actually left in the tree.
A cleaner commit would mean a broken state in between, and the resulting vga.h is really rather small and boring. But if a broken in between state is acceptable then sure. If only svn (or whatever - everything has this issue) diff was intelligent enough not to treat "^ *\n" or "^\n" as valid points of comparison, then it would not be an issue here :)
I could also first cut down vga.h until only what the console code uses remains and then apply the other one on top. This will mean the best of both i guess.
Thanks,
Luc Verhaegen.
Luc Verhaegen wrote:
I could also first cut down vga.h
Nah. Go ahead.
Acked-by: Peter Stuge peter@stuge.se
On Thu, May 28, 2009 at 02:22:41AM +0200, Peter Stuge wrote:
Luc Verhaegen wrote:
I could also first cut down vga.h
Nah. Go ahead.
Acked-by: Peter Stuge peter@stuge.se
Thanks, committed as r4321, with one change:
I noticed that the maximum values in the comments of the vga mode set were off and i fixed them.
Thanks!
Luc Verhaegen.