[OpenBIOS] r355 - in openbios-devel: drivers include/openbios modules

svn at openbios.org svn at openbios.org
Mon Jan 5 21:20:45 CET 2009


Author: blueswirl
Date: 2009-01-05 21:20:45 +0100 (Mon, 05 Jan 2009)
New Revision: 355

Modified:
   openbios-devel/drivers/vga_vbe.c
   openbios-devel/include/openbios/fontdata.h
   openbios-devel/modules/console_common.c
Log:
Define "screen-#columns" and "screen-#rows" in /options (Laurent Vivier)

Modified: openbios-devel/drivers/vga_vbe.c
===================================================================
--- openbios-devel/drivers/vga_vbe.c	2009-01-05 20:16:31 UTC (rev 354)
+++ openbios-devel/drivers/vga_vbe.c	2009-01-05 20:20:45 UTC (rev 355)
@@ -21,7 +21,9 @@
 #include "openbios/bindings.h"
 #include "openbios/pci.h"
 #include "openbios/drivers.h"
+#include "openbios/fontdata.h"
 #include "asm/io.h"
+#include "libc/vsprintf.h"
 #include "video_subr.h"
 
 /* VGA init. We use the Bochs VESA VBE extensions  */
@@ -102,7 +104,8 @@
 void vga_vbe_init(const char *path, uint32_t fb, uint32_t fb_size,
                   unsigned long rom, uint32_t rom_size)
 {
-	phandle_t ph, chosen, aliases;
+	phandle_t ph, chosen, aliases, options;
+	char buf[6];
 
 	vga_vbe_set_mode(800, 600, 8);
 
@@ -122,6 +125,12 @@
 	aliases = find_dev("/aliases");
 	set_property(aliases, "screen", path, strlen(path) + 1);
 
+	options = find_dev("/options");
+	snprintf(buf, sizeof(buf), "%d", 800 / FONT_WIDTH);
+	set_property(options, "screen-#columns", buf, strlen(buf) + 1);
+	snprintf(buf, sizeof(buf), "%d", 600 / FONT_HEIGHT);
+	set_property(options, "screen-#rows", buf, strlen(buf) + 1);
+
 	if (rom_size >= 8) {
                 const char *p;
 		int size;

Modified: openbios-devel/include/openbios/fontdata.h
===================================================================
--- openbios-devel/include/openbios/fontdata.h	2009-01-05 20:16:31 UTC (rev 354)
+++ openbios-devel/include/openbios/fontdata.h	2009-01-05 20:20:45 UTC (rev 355)
@@ -15,4 +15,14 @@
 
 extern const unsigned char fontdata_8x16[FONTDATAMAX_8X16];
 
+#if defined(CONFIG_FONT_8X8)
+#define fontdata fontdata_8x8
+#define FONT_HEIGHT FONT_HEIGHT_8X8
+#define FONT_WIDTH FONT_WIDTH_8X8
+#elif defined(CONFIG_FONT_8X16)
+#define fontdata fontdata_8x16
+#define FONT_HEIGHT FONT_HEIGHT_8X16
+#define FONT_WIDTH FONT_WIDTH_8X16
+#endif
+
 #endif /* OPENBIOS_FONTDATA_H */

Modified: openbios-devel/modules/console_common.c
===================================================================
--- openbios-devel/modules/console_common.c	2009-01-05 20:16:31 UTC (rev 354)
+++ openbios-devel/modules/console_common.c	2009-01-05 20:20:45 UTC (rev 355)
@@ -17,20 +17,6 @@
 #include "openbios/fontdata.h"
 #include "video_subr.h"
 
-#if !defined(fontdata)
-#if defined(CONFIG_FONT_8X8)
-#define fontdata fontdata_8x8
-#define FONT_HEIGHT FONT_HEIGHT_8X8
-#define FONT_WIDTH FONT_WIDTH_8X8
-#elif defined(CONFIG_FONT_8X16)
-#define fontdata fontdata_8x16
-#define FONT_HEIGHT FONT_HEIGHT_8X16
-#define FONT_WIDTH FONT_WIDTH_8X16
-#else
-#error no font selected
-#endif
-#endif
-
 #define FONT_ADJ_HEIGHT	 (FONT_HEIGHT + 2)
 #define NCOLS	80
 #define NROWS	48




More information about the OpenBIOS mailing list