Skip to contentSkip to conversation

Fix serial output for OpenBSD current

PATCH Markus Müller 3 participants 4 messages Feb 2, 2014 – Feb 4, 2014

lore
Share & tools
lore
#0 lore raw

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

grub-core/loader/i386/bsd.c +2 -0
index ea0edfa..c1d2856 100644
@@ -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;
     }
include/grub/i386/openbsd_bootarg.h +5 -3
index 01ca486..0166e3f 100644
@@ -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
 {
#1 lore raw
Quoted 8 lines · Markus Müller

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.

Could you try this patch instead?

grub-core/loader/i386/bsd.c +2 -0
index ea0edfa..19985f0 100644
@@ -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.addr = grub_ns8250_hw_get_port (port);
          
       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.addr = 0xffffffff;
       grub_bsd_add_meta (OPENBSD_BOOTARG_CONSOLE, &serial, sizeof (serial));
       bootflags &= ~OPENBSD_RB_SERCONS;
     }
include/grub/i386/openbsd_bootarg.h +2 -0
index 01ca486..9ebe6b4 100644
@@ -75,6 +75,8 @@ struct grub_openbsd_bootarg_console
 {
   grub_uint32_t device;
   grub_uint32_t speed;
+  grub_uint32_t addr;
+  grub_uint32_t frequency;
 };
 
 struct grub_openbsd_bootarg_pcibios
Quoted 13 lines

Regards,
Markus

[1] http://marc.info/?l=openbsd-cvs&m=138340457301045

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

Am Montag, den 03.02.2014, 18:03 +0100 schrieb Vladimir 'φ-coder/phcoder' Serbinenko:

Quoted 10 lines · Markus Müller
Quoted 8 lines

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.

Could you try this patch instead?

Seems to be working fine. I'm getting serial output with all releases and custom kernels I've tested before.

Regards,
Markus

#3 lore raw
Quoted 11 lines · Markus Müller

Am Montag, den 03.02.2014, 18:03 +0100 schrieb Vladimir 'φ-coder/phcoder' Serbinenko:

Quoted 9 lines · Markus Müller
Quoted 8 lines

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.

Quoted 4 lines
Quoted 1 line

Could you try this patch instead?

Seems to be working fine. I'm getting serial output with all releases and custom kernels I've tested before.

I’ve never had any problems either.

Quoted 9 lines

Regards,
Markus

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel