Skip to contentSkip to conversation

Multiboot video support

PATCH In review Vladimir 'φ-coder/phcoder' Serbinenko 3 participants 10 messages Jan 14, 2010 – Jan 25, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Multiboot video support

Signature · 3 lines
-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== added file 'ChangeLog.mbivid'

ChangeLog.mbivid +24 -0
@@ -0,0 +1,24 @@
+2010-01-14  Vladimir Serbinenko  <[email protected]>
+
+	Video multiboot support.
+
+	* include/grub/multiboot.h (grub_multiboot_set_accepts_video):
+	New prototype.
+	* include/grub/video.h (grub_video_driver_id): New type.
+	(grub_video_adapter): New member 'id'. All users updated.
+	(grub_video_get_driver_id): New proto.
+	* include/multiboot.h: Resynced with multiboot specification.
+	* include/multiboot2.h: Likewise.
+	* loader/i386/multiboot.c (UNSUPPORTED_FLAGS): Support video flags.
+	(grub_multiboot): Parse MULTIBOOT_VIDEO_MODE fields.
+	* loader/i386/multiboot_mbi.c (DEFAULT_VIDEO_MODE): New constant.
+	(HAS_VGA_TEXT): Likewise.
+	(HAS_VBE): Likewise.
+	(accepts_video): New variable.
+	(grub_multiboot_set_accepts_video): New function.
+	(grub_multiboot_get_mbi_size): Account for video structures.
+	(set_video_mode): New function.
+	(fill_vbe_info) [HAS_VBE]: Likewise.
+	(retrieve_video_parameters): Likewise.
+	(grub_multiboot_make_mbi): Fill video fields.
+	* video/video.c (grub_video_get_driver_id): New function.

=== modified file 'include/grub/multiboot.h'

grub/multiboot.h +2 -0
@@ -35,6 +35,8 @@
 void grub_multiboot (int argc, char *argv[]);
 void grub_module (int argc, char *argv[]);
 
+void grub_multiboot_set_accepts_video (int val);
+
 grub_size_t grub_multiboot_get_mbi_size (void);
 grub_err_t grub_multiboot_make_mbi (void *orig, grub_uint32_t dest,
 				    grub_off_t buf_off, grub_size_t bufsize);

=== modified file 'include/grub/video.h'

grub/video.h +12 -0
@@ -159,10 +159,19 @@
   grub_uint8_t a; /* Reserved bits value (0-255).  */
 };
 
+typedef enum grub_video_driver_id
+  {
+    GRUB_VIDEO_DRIVER_NONE,
+    GRUB_VIDEO_DRIVER_VBE,
+    GRUB_VIDEO_DRIVER_EFI_UGA,
+    GRUB_VIDEO_DRIVER_EFI_GOP
+  } grub_video_driver_id_t;
+
 struct grub_video_adapter
 {
   /* The video adapter name.  */
   const char *name;
+  grub_video_driver_id_t id;
 
   /* Initialize the video adapter.  */
   grub_err_t (*init) (void);
@@ -310,4 +319,7 @@
 				int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p,
 							      struct grub_video_mode_info *mode_info));
 
+grub_video_driver_id_t
+grub_video_get_driver_id (void);
+
 #endif /* ! GRUB_VIDEO_HEADER */

=== modified file 'include/multiboot.h'

multiboot.h +37 -1
@@ -85,10 +85,12 @@
 #define MULTIBOOT_INFO_APM_TABLE		0x00000400
 
 /* Is there video information?  */
-#define MULTIBOOT_INFO_VIDEO_INFO		0x00000800
+#define MULTIBOOT_INFO_VBE_INFO		        0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO	        0x00001000
 
 #ifndef ASM_FILE
 
+typedef unsigned char		multiboot_uint8_t;
 typedef unsigned short		multiboot_uint16_t;
 typedef unsigned int		multiboot_uint32_t;
 typedef unsigned long long	multiboot_uint64_t;
@@ -187,9 +189,43 @@
   multiboot_uint16_t vbe_interface_seg;
   multiboot_uint16_t vbe_interface_off;
   multiboot_uint16_t vbe_interface_len;
+
+  multiboot_uint64_t framebuffer_addr;
+  multiboot_uint32_t framebuffer_pitch;
+  multiboot_uint32_t framebuffer_width;
+  multiboot_uint32_t framebuffer_height;
+  multiboot_uint8_t framebuffer_bpp;
+  multiboot_uint8_t framebuffer_type;
+  union
+  {
+    struct
+    {
+      multiboot_uint32_t framebuffer_palette_addr;
+      multiboot_uint16_t framebuffer_palette_num_colors;
+    };
+    struct
+    {
+      multiboot_uint8_t framebuffer_red_field_position;
+      multiboot_uint8_t framebuffer_red_mask_size;
+      multiboot_uint8_t framebuffer_green_field_position;
+      multiboot_uint8_t framebuffer_green_mask_size;
+      multiboot_uint8_t framebuffer_blue_field_position;
+      multiboot_uint8_t framebuffer_blue_mask_size;
+    };
+  };
 };
 typedef struct multiboot_info multiboot_info_t;
 
+struct multiboot_color
+{
+  multiboot_uint8_t red;
+  multiboot_uint8_t green;
+  multiboot_uint8_t blue;
+};
+
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB     1
+
 struct multiboot_mmap_entry
 {
   multiboot_uint32_t size;

=== modified file 'include/multiboot2.h'

multiboot2.h +37 -1
@@ -85,10 +85,12 @@
 #define MULTIBOOT_INFO_APM_TABLE		0x00000400
 
 /* Is there video information?  */
-#define MULTIBOOT_INFO_VIDEO_INFO		0x00000800
+#define MULTIBOOT_INFO_VBE_INFO		        0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO	        0x00001000
 
 #ifndef ASM_FILE
 
+typedef unsigned char		multiboot_uint8_t;
 typedef unsigned short		multiboot_uint16_t;
 typedef unsigned int		multiboot_uint32_t;
 typedef unsigned long long	multiboot_uint64_t;
@@ -187,9 +189,43 @@
   multiboot_uint16_t vbe_interface_seg;
   multiboot_uint16_t vbe_interface_off;
   multiboot_uint16_t vbe_interface_len;
+
+  multiboot_uint64_t framebuffer_addr;
+  multiboot_uint32_t framebuffer_pitch;
+  multiboot_uint32_t framebuffer_width;
+  multiboot_uint32_t framebuffer_height;
+  multiboot_uint8_t framebuffer_bpp;
+  multiboot_uint8_t framebuffer_type;
+  union
+  {
+    struct
+    {
+      multiboot_uint32_t framebuffer_palette_addr;
+      multiboot_uint16_t framebuffer_palette_num_colors;
+    };
+    struct
+    {
+      multiboot_uint8_t framebuffer_red_field_position;
+      multiboot_uint8_t framebuffer_red_mask_size;
+      multiboot_uint8_t framebuffer_green_field_position;
+      multiboot_uint8_t framebuffer_green_mask_size;
+      multiboot_uint8_t framebuffer_blue_field_position;
+      multiboot_uint8_t framebuffer_blue_mask_size;
+    };
+  };
 };
 typedef struct multiboot_info multiboot_info_t;
 
+struct multiboot_color
+{
+  multiboot_uint8_t red;
+  multiboot_uint8_t green;
+  multiboot_uint8_t blue;
+};
+
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB     1
+
 struct multiboot_mmap_entry
 {
   multiboot_uint32_t size;

=== modified file 'loader/i386/multiboot.c'

i386/multiboot.c +29 -4
@@ -20,7 +20,6 @@
 /*
  *  FIXME: The following features from the Multiboot specification still
  *         need to be implemented:
- *  - VBE support
  *  - symbol table
  *  - drives table
  *  - ROM configuration table
@@ -28,13 +27,11 @@
  */
 
 /* The bits in the required part of flags field we don't support.  */
-#define UNSUPPORTED_FLAGS			0x0000fffc
+#define UNSUPPORTED_FLAGS			0x0000fff8
 
 #include <grub/loader.h>
 #include <grub/machine/loader.h>
 #include <grub/multiboot.h>
-#include <grub/machine/init.h>
-#include <grub/machine/memory.h>
 #include <grub/cpu/multiboot.h>
 #include <grub/elf.h>
 #include <grub/aout.h>
@@ -232,6 +229,34 @@
   else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE)
     goto fail;
 
+  if (header->flags & MULTIBOOT_VIDEO_MODE)
+    {
+      switch (header->mode_type)
+	{
+	case 1:
+	  grub_env_set ("gfxpayload", "text");
+	  break;
+
+	case 0:
+	  {
+	    char buf[sizeof ("XXXXXXXXXXxXXXXXXXXXXxXXXXXXXXXX,XXXXXXXXXXxXXXXXXXXXX,auto")];
+	    if (header->depth && header->width && header->height)
+	      grub_sprintf (buf, "%dx%dx%d,%dx%d,auto", header->width,
+			    header->height, header->depth, header->width,
+			    header->height);
+	    else if (header->width && header->height)
+	      grub_sprintf (buf, "%dx%d,auto", header->width, header->height);
+	    else
+	      grub_sprintf (buf, "auto");
+
+	    grub_env_set ("gfxpayload", buf);
+	    break;
+	  }
+	}
+    }
+
+  grub_multiboot_set_accepts_video (!!(header->flags & MULTIBOOT_VIDEO_MODE));
+
   grub_multiboot_set_bootdev ();
 
   grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 0);

=== modified file 'loader/i386/multiboot_mbi.c'

i386/multiboot_mbi.c +193 -1

230 lines not on this page · raw message

=== modified file 'video/efi_gop.c'

efi_gop.c +1 -0
@@ -353,6 +353,7 @@
 static struct grub_video_adapter grub_video_gop_adapter =
   {
     .name = "EFI GOP driver",
+    .id = GRUB_VIDEO_DRIVER_EFI_GOP,
 
     .init = grub_video_gop_init,
     .fini = grub_video_gop_fini,

=== modified file 'video/efi_uga.c'

efi_uga.c +1 -0
@@ -300,6 +300,7 @@
 static struct grub_video_adapter grub_video_uga_adapter =
   {
     .name = "EFI UGA driver",
+    .id = GRUB_VIDEO_DRIVER_EFI_UGA,
 
     .init = grub_video_uga_init,
     .fini = grub_video_uga_fini,

=== modified file 'video/i386/pc/vbe.c'

i386/pc/vbe.c +1 -0
@@ -557,6 +557,7 @@
 static struct grub_video_adapter grub_video_vbe_adapter =
   {
     .name = "VESA BIOS Extension Video Driver",
+    .id = GRUB_VIDEO_DRIVER_VBE,
 
     .init = grub_video_vbe_init,
     .fini = grub_video_vbe_fini,

=== modified file 'video/video.c'

video.c +8 -0
@@ -93,6 +93,14 @@
   return grub_video_adapter_active->get_info (mode_info);
 }
 
+grub_video_driver_id_t
+grub_video_get_driver_id (void)
+{
+  if (! grub_video_adapter_active)
+    return GRUB_VIDEO_DRIVER_NONE;
+  return grub_video_adapter_active->id;
+}
+
 /* Get information about active video mode.  */
 grub_err_t
 grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
#1 lore raw

Added EGA text support

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== added file 'ChangeLog.mbivid'

ChangeLog.mbivid +24 -0
@@ -0,0 +1,24 @@
+2010-01-14  Vladimir Serbinenko  <[email protected]>
+
+	Video multiboot support.
+
+	* include/grub/multiboot.h (grub_multiboot_set_accepts_video):
+	New prototype.
+	* include/grub/video.h (grub_video_driver_id): New type.
+	(grub_video_adapter): New member 'id'. All users updated.
+	(grub_video_get_driver_id): New proto.
+	* include/multiboot.h: Resynced with multiboot specification.
+	* include/multiboot2.h: Likewise.
+	* loader/i386/multiboot.c (UNSUPPORTED_FLAGS): Support video flags.
+	(grub_multiboot): Parse MULTIBOOT_VIDEO_MODE fields.
+	* loader/i386/multiboot_mbi.c (DEFAULT_VIDEO_MODE): New constant.
+	(HAS_VGA_TEXT): Likewise.
+	(HAS_VBE): Likewise.
+	(accepts_video): New variable.
+	(grub_multiboot_set_accepts_video): New function.
+	(grub_multiboot_get_mbi_size): Account for video structures.
+	(set_video_mode): New function.
+	(fill_vbe_info) [HAS_VBE]: Likewise.
+	(retrieve_video_parameters): Likewise.
+	(grub_multiboot_make_mbi): Fill video fields.
+	* video/video.c (grub_video_get_driver_id): New function.

=== modified file 'include/grub/multiboot.h'

grub/multiboot.h +2 -0
@@ -35,6 +35,8 @@
 void grub_multiboot (int argc, char *argv[]);
 void grub_module (int argc, char *argv[]);
 
+void grub_multiboot_set_accepts_video (int val);
+
 grub_size_t grub_multiboot_get_mbi_size (void);
 grub_err_t grub_multiboot_make_mbi (void *orig, grub_uint32_t dest,
 				    grub_off_t buf_off, grub_size_t bufsize);

=== modified file 'include/grub/video.h'

grub/video.h +12 -0
@@ -159,10 +159,19 @@
   grub_uint8_t a; /* Reserved bits value (0-255).  */
 };
 
+typedef enum grub_video_driver_id
+  {
+    GRUB_VIDEO_DRIVER_NONE,
+    GRUB_VIDEO_DRIVER_VBE,
+    GRUB_VIDEO_DRIVER_EFI_UGA,
+    GRUB_VIDEO_DRIVER_EFI_GOP
+  } grub_video_driver_id_t;
+
 struct grub_video_adapter
 {
   /* The video adapter name.  */
   const char *name;
+  grub_video_driver_id_t id;
 
   /* Initialize the video adapter.  */
   grub_err_t (*init) (void);
@@ -310,4 +319,7 @@
 				int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p,
 							      struct grub_video_mode_info *mode_info));
 
+grub_video_driver_id_t
+grub_video_get_driver_id (void);
+
 #endif /* ! GRUB_VIDEO_HEADER */

=== modified file 'include/multiboot.h'

multiboot.h +37 -1
@@ -85,10 +85,12 @@
 #define MULTIBOOT_INFO_APM_TABLE		0x00000400
 
 /* Is there video information?  */
-#define MULTIBOOT_INFO_VIDEO_INFO		0x00000800
+#define MULTIBOOT_INFO_VBE_INFO		        0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO	        0x00001000
 
 #ifndef ASM_FILE
 
+typedef unsigned char		multiboot_uint8_t;
 typedef unsigned short		multiboot_uint16_t;
 typedef unsigned int		multiboot_uint32_t;
 typedef unsigned long long	multiboot_uint64_t;
@@ -187,9 +189,43 @@
   multiboot_uint16_t vbe_interface_seg;
   multiboot_uint16_t vbe_interface_off;
   multiboot_uint16_t vbe_interface_len;
+
+  multiboot_uint64_t framebuffer_addr;
+  multiboot_uint32_t framebuffer_pitch;
+  multiboot_uint32_t framebuffer_width;
+  multiboot_uint32_t framebuffer_height;
+  multiboot_uint8_t framebuffer_bpp;
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB     1
+#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT	2
+  multiboot_uint8_t framebuffer_type;
+  union
+  {
+    struct
+    {
+      multiboot_uint32_t framebuffer_palette_addr;
+      multiboot_uint16_t framebuffer_palette_num_colors;
+    };
+    struct
+    {
+      multiboot_uint8_t framebuffer_red_field_position;
+      multiboot_uint8_t framebuffer_red_mask_size;
+      multiboot_uint8_t framebuffer_green_field_position;
+      multiboot_uint8_t framebuffer_green_mask_size;
+      multiboot_uint8_t framebuffer_blue_field_position;
+      multiboot_uint8_t framebuffer_blue_mask_size;
+    };
+  };
 };
 typedef struct multiboot_info multiboot_info_t;
 
+struct multiboot_color
+{
+  multiboot_uint8_t red;
+  multiboot_uint8_t green;
+  multiboot_uint8_t blue;
+};
+
 struct multiboot_mmap_entry
 {
   multiboot_uint32_t size;

=== modified file 'include/multiboot2.h'

multiboot2.h +37 -1
@@ -85,10 +85,12 @@
 #define MULTIBOOT_INFO_APM_TABLE		0x00000400
 
 /* Is there video information?  */
-#define MULTIBOOT_INFO_VIDEO_INFO		0x00000800
+#define MULTIBOOT_INFO_VBE_INFO		        0x00000800
+#define MULTIBOOT_INFO_FRAMEBUFFER_INFO	        0x00001000
 
 #ifndef ASM_FILE
 
+typedef unsigned char		multiboot_uint8_t;
 typedef unsigned short		multiboot_uint16_t;
 typedef unsigned int		multiboot_uint32_t;
 typedef unsigned long long	multiboot_uint64_t;
@@ -187,9 +189,43 @@
   multiboot_uint16_t vbe_interface_seg;
   multiboot_uint16_t vbe_interface_off;
   multiboot_uint16_t vbe_interface_len;
+
+  multiboot_uint64_t framebuffer_addr;
+  multiboot_uint32_t framebuffer_pitch;
+  multiboot_uint32_t framebuffer_width;
+  multiboot_uint32_t framebuffer_height;
+  multiboot_uint8_t framebuffer_bpp;
+#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
+#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB     1
+#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT	2
+  multiboot_uint8_t framebuffer_type;
+  union
+  {
+    struct
+    {
+      multiboot_uint32_t framebuffer_palette_addr;
+      multiboot_uint16_t framebuffer_palette_num_colors;
+    };
+    struct
+    {
+      multiboot_uint8_t framebuffer_red_field_position;
+      multiboot_uint8_t framebuffer_red_mask_size;
+      multiboot_uint8_t framebuffer_green_field_position;
+      multiboot_uint8_t framebuffer_green_mask_size;
+      multiboot_uint8_t framebuffer_blue_field_position;
+      multiboot_uint8_t framebuffer_blue_mask_size;
+    };
+  };
 };
 typedef struct multiboot_info multiboot_info_t;
 
+struct multiboot_color
+{
+  multiboot_uint8_t red;
+  multiboot_uint8_t green;
+  multiboot_uint8_t blue;
+};
+
 struct multiboot_mmap_entry
 {
   multiboot_uint32_t size;

=== modified file 'loader/i386/multiboot.c'

i386/multiboot.c +29 -6
@@ -20,7 +20,6 @@
 /*
  *  FIXME: The following features from the Multiboot specification still
  *         need to be implemented:
- *  - VBE support
  *  - symbol table
  *  - drives table
  *  - ROM configuration table
@@ -28,13 +27,11 @@
  */
 
 /* The bits in the required part of flags field we don't support.  */
-#define UNSUPPORTED_FLAGS			0x0000fffc
+#define UNSUPPORTED_FLAGS			0x0000fff8
 
 #include <grub/loader.h>
 #include <grub/machine/loader.h>
 #include <grub/multiboot.h>
-#include <grub/machine/init.h>
-#include <grub/machine/memory.h>
 #include <grub/cpu/multiboot.h>
 #include <grub/elf.h>
 #include <grub/aout.h>
@@ -90,8 +87,6 @@
   if (err)
     return err;
 
-  grub_video_set_mode ("text", NULL);
-
   grub_relocator32_boot (grub_multiboot_payload_orig,
 			 grub_multiboot_payload_dest,
 			 state);
@@ -235,6 +230,34 @@
   else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE)
     goto fail;
 
+  if (header->flags & MULTIBOOT_VIDEO_MODE)
+    {
+      switch (header->mode_type)
+	{
+	case 1:
+	  grub_env_set ("gfxpayload", "text");
+	  break;
+
+	case 0:
+	  {
+	    char buf[sizeof ("XXXXXXXXXXxXXXXXXXXXXxXXXXXXXXXX,XXXXXXXXXXxXXXXXXXXXX,auto")];
+	    if (header->depth && header->width && header->height)
+	      grub_sprintf (buf, "%dx%dx%d,%dx%d,auto", header->width,
+			    header->height, header->depth, header->width,
+			    header->height);
+	    else if (header->width && header->height)
+	      grub_sprintf (buf, "%dx%d,auto", header->width, header->height);
+	    else
+	      grub_sprintf (buf, "auto");
+
+	    grub_env_set ("gfxpayload", buf);
+	    break;
+	  }
+	}
+    }
+
+  grub_multiboot_set_accepts_video (!!(header->flags & MULTIBOOT_VIDEO_MODE));
+
   grub_multiboot_set_bootdev ();
 
   grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 0);

=== modified file 'loader/i386/multiboot_mbi.c'

i386/multiboot_mbi.c +222 -1

259 lines not on this page · raw message

=== modified file 'video/efi_gop.c'

efi_gop.c +1 -0
@@ -353,6 +353,7 @@
 static struct grub_video_adapter grub_video_gop_adapter =
   {
     .name = "EFI GOP driver",
+    .id = GRUB_VIDEO_DRIVER_EFI_GOP,
 
     .init = grub_video_gop_init,
     .fini = grub_video_gop_fini,

=== modified file 'video/efi_uga.c'

efi_uga.c +1 -0
@@ -300,6 +300,7 @@
 static struct grub_video_adapter grub_video_uga_adapter =
   {
     .name = "EFI UGA driver",
+    .id = GRUB_VIDEO_DRIVER_EFI_UGA,
 
     .init = grub_video_uga_init,
     .fini = grub_video_uga_fini,

=== modified file 'video/i386/pc/vbe.c'

i386/pc/vbe.c +1 -0
@@ -557,6 +557,7 @@
 static struct grub_video_adapter grub_video_vbe_adapter =
   {
     .name = "VESA BIOS Extension Video Driver",
+    .id = GRUB_VIDEO_DRIVER_VBE,
 
     .init = grub_video_vbe_init,
     .fini = grub_video_vbe_fini,

=== modified file 'video/video.c'

video.c +8 -0
@@ -93,6 +93,14 @@
   return grub_video_adapter_active->get_info (mode_info);
 }
 
+grub_video_driver_id_t
+grub_video_get_driver_id (void)
+{
+  if (! grub_video_adapter_active)
+    return GRUB_VIDEO_DRIVER_NONE;
+  return grub_video_adapter_active->id;
+}
+
 /* Get information about active video mode.  */
 grub_err_t
 grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
#2 lore raw
Quoted 2 lines · Vladimir 'phi-coder/phcoder' Serbinenko

Added EGA text support

Non-VBE parts reviewed and comitted. Resending VBE parts.

Quoted 2 lines
Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== added file 'ChangeLog.mbivid'

ChangeLog.mbivid +9 -0
@@ -0,0 +1,9 @@
+2010-01-14  Vladimir Serbinenko  <[email protected]>
+
+	VBE multiboot support.
+
+	* loader/i386/multiboot_mbi.c (HAS_VBE): New constant.
+	(grub_multiboot_get_mbi_size) [HAS_VBE]: Account for VBE structures.
+	(grub_multiboot_make_mbi) [HAS_VBE]: Likewise.
+	(fill_vbe_info) [HAS_VBE]: New function.
+	(retrieve_video_parameters) [HAS_VBE]: Call fill_vbe_info.

=== modified file 'loader/i386/multiboot.c'

i386/multiboot.c +0 -1
@@ -20,7 +20,6 @@
 /*
  *  FIXME: The following features from the Multiboot specification still
  *         need to be implemented:
- *  - VBE support
  *  - symbol table
  *  - drives table
  *  - ROM configuration table

=== modified file 'loader/i386/multiboot_mbi.c'

i386/multiboot_mbi.c +94 -0

135 lines not on this page · raw message

#3 lore raw
Quoted 4 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines · Vladimir 'phi-coder/phcoder' Serbinenko

Added EGA text support

Non-VBE parts reviewed and comitted. Resending VBE parts.

This is vetoed (in both trunk and experimental) unless someone provides a very good reason to provide it.

Signature · 3 lines
Robert Millan

  "Be the change you want to see in the world" -- Gandhi
#4 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko

Shouldn't the structure also include the framebuffer orientation?

If framebuffer transform support is included in grub it would be good to pass the orientation the user specified for grub graphics output to the OS so that the OS console output is displayed the same way automatically.

Thanks

Michal

#5 lore raw
Quoted 6 lines · Michal Suchanek

Shouldn't the structure also include the framebuffer orientation?

If framebuffer transform support is included in grub it would be good to pass the orientation the user specified for grub graphics output to the OS so that the OS console output is displayed the same way automatically.

Makes sense. Can you draft a proposal?

Signature · 3 lines
Robert Millan

  "Be the change you want to see in the world" -- Gandhi
#6 lore raw
Quoted 4 lines · Robert Millan
Quoted 2 lines · Michal Suchanek

Shouldn't the structure also include the framebuffer orientation?

Quoted 9 lines
Quoted 5 lines

If framebuffer transform support is included in grub it would be good to pass the orientation the user specified for grub graphics output to the OS so that the OS console output is displayed the same way automatically.

Makes sense. Can you draft a proposal?

There is a big difference between orientation and the rest of fields:
orientation is configuration variable whereas other fields are a hardware information. We need to draw aline of what we want and what we don't want to pass, otherwise, we may end up passing font, background images and even logos.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#7 lore raw

2010/1/24 Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>:

Quoted 11 lines
Quoted 10 lines · Robert Millan
Quoted 7 lines · Michal Suchanek

Shouldn't the structure also include the framebuffer orientation?

If framebuffer transform support is included in grub it would be good to pass the orientation the user specified for grub graphics output to the OS so that the OS console output is displayed the same way automatically.

Quoted 9 lines
Quoted 3 lines

Makes sense.  Can you draft a proposal?

There is a big difference between orientation and the rest of fields:
orientation is configuration variable whereas other fields are a hardware information. We need to draw aline of what we want and what we don't want to pass, otherwise, we may end up passing font, background images and even logos.

Unlike font, background image or logos the orientation of the screen is hardware property. Unfortunately, few screens allow determining this property in software so you have to rely on user input in most cases.

Have you looked at the patch?

The framebuffer transform is represented as a bit field which could be added to the mode flags.

I am not sure if that is the best approach, though. OSes might refuse modes with unknown flags and this is not really mode specific so perhaps separate flags would be better.

Thanks

Michal

#8 lore raw
Quoted 7 lines · Michal Suchanek

2010/1/24 Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>:

Quoted 3 lines

There is a big difference between orientation and the rest of fields:
orientation is configuration variable whereas other fields are a hardware information. [...]

Unlike font, background image or logos the orientation of the screen is hardware property.

I think nobody wants font, background image or logos to be part of the transferred data, as it's clearly overkill.

As for orientation of a screen, I don't know if you'd call this hardware information, but if a screen is physically rotated, it's clearly not software.

Signature · 3 lines
Robert Millan

  "Be the change you want to see in the world" -- Gandhi
#9 lore raw

2010/1/25 Robert Millan <[email protected]>:

Quoted 11 lines · Michal Suchanek
Quoted 7 lines

2010/1/24 Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]>:

Quoted 3 lines

There is a big difference between orientation and the rest of fields:
orientation is configuration variable whereas other fields are a hardware information. [...]

Unlike font, background image or logos the orientation of the screen is hardware property.

I think nobody wants font, background image or logos to be part of the transferred data, as it's clearly overkill.

Well, it would be actually nice if people with specific needs (such as large high-contrast fonts) could set this once for good. This would improve usability greatly for them. However, propagating such setting throughout the system is somewhat unrealistic given the multitude of UI toolkits involved. Even if that was solved (or left to integrators who want to support this feature) the problem is that in a complex theme (which are planned for grub) you can no longer point at particular font size, color and background color and say with confidence this is what the user wants. We would be in the same boat as Mozilla trying to determine "system colors" from the current GTK theme and failing for odd themes (like a theme using black text and background color and relying on background bitmap). Also there are going to be multiple styles in a layout and it is not obvious which to choose.

Thanks

Michal