All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix serial output for OpenBSD current
@ 2014-02-02 10:48 Markus Müller
  2014-02-03 17:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Müller @ 2014-02-02 10:48 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

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

[-- Attachment #2: grub.diff --]
[-- Type: text/x-patch, Size: 1357 bytes --]

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
 {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Fix serial output for OpenBSD current
  2014-02-02 10:48 Fix serial output for OpenBSD current Markus Müller
@ 2014-02-03 17:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-02-04 22:46   ` Markus Müller
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-02-03 17:03 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

On 02.02.2014 11:48, Markus Müller wrote:
> 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?
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index ea0edfa..19985f0 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.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;
     }
diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h
index 01ca486..9ebe6b4 100644
--- a/include/grub/i386/openbsd_bootarg.h
+++ b/include/grub/i386/openbsd_bootarg.h
@@ -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

> Regards,
> Markus
> 
> 
> [1] http://marc.info/?l=openbsd-cvs&m=138340457301045
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 274 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Fix serial output for OpenBSD current
  2014-02-03 17:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-02-04 22:46   ` Markus Müller
  2014-02-04 22:50     ` SevenBits
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Müller @ 2014-02-04 22:46 UTC (permalink / raw)
  To: grub-devel

Am Montag, den 03.02.2014, 18:03 +0100 schrieb Vladimir
'φ-coder/phcoder' Serbinenko:
> On 02.02.2014 11:48, Markus Müller wrote:
> > 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix serial output for OpenBSD current
  2014-02-04 22:46   ` Markus Müller
@ 2014-02-04 22:50     ` SevenBits
  0 siblings, 0 replies; 4+ messages in thread
From: SevenBits @ 2014-02-04 22:50 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

On Feb 4, 2014, at 5:46 PM, Markus Müller <mmu@grummel.net> wrote:

> Am Montag, den 03.02.2014, 18:03 +0100 schrieb Vladimir
> 'φ-coder/phcoder' Serbinenko:
>> On 02.02.2014 11:48, Markus Müller wrote:
>>> 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.

I’ve never had any problems either.

> 
> Regards,
> Markus
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 535 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-04 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-02 10:48 Fix serial output for OpenBSD current Markus Müller
2014-02-03 17:03 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-02-04 22:46   ` Markus Müller
2014-02-04 22:50     ` SevenBits

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.