Hi all,

attached is a patch that fixes serial console output with OpenBSD
current (will be 5.5). Grub uses an old struct for providing the kernel
with information about the serial console that is now gone [1]. Since
the new way is in OpenBSD since 5.2, even older versions are still
supported with this patch.

Regards,
Markus


[1] http://marc.info/?l=openbsd-cvs&m=138340457301045
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index ea0edfa..c1d2856 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -1646,6 +1646,7 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
 
       serial.device = (GRUB_OPENBSD_COM_MAJOR << 8) | port;
       serial.speed = speed;
+      serial.address = -1;
 	  
       grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial));
       bootflags |= OPENBSD_RB_SERCONS;
@@ -1656,6 +1657,7 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
 
       grub_memset (&serial, 0, sizeof (serial));
       serial.device = (GRUB_OPENBSD_VGA_MAJOR << 8);
+      serial.address = -1;
       grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial));
       bootflags &= ~OPENBSD_RB_SERCONS;
     }
diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h
index 01ca486..0166e3f 100644
--- a/include/grub/i386/openbsd_bootarg.h
+++ b/include/grub/i386/openbsd_bootarg.h
@@ -73,9 +73,11 @@ struct grub_openbsd_bootargs
 
 struct grub_openbsd_bootarg_console
 {
-  grub_uint32_t device;
-  grub_uint32_t speed;
-};
+  grub_int32_t device;
+  grub_int32_t speed;
+  grub_int32_t address;
+  grub_int32_t frequency;
+} GRUB_PACKED;
 
 struct grub_openbsd_bootarg_pcibios
 {
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to