Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst/arch/i386 Default console device and speed ...



details:   https://anonhg.NetBSD.org/src/rev/ed50080e1068
branches:  trunk
changeset: 323206:ed50080e1068
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jun 03 14:38:28 2018 +0000

description:
Default console device and speed to that used by syinst

diffstat:

 usr.sbin/sysinst/arch/i386/md.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r e16240558971 -r ed50080e1068 usr.sbin/sysinst/arch/i386/md.c
--- a/usr.sbin/sysinst/arch/i386/md.c   Sun Jun 03 13:41:30 2018 +0000
+++ b/usr.sbin/sysinst/arch/i386/md.c   Sun Jun 03 14:38:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.9 2018/06/03 13:16:30 martin Exp $ */
+/*     $NetBSD: md.c,v 1.10 2018/06/03 14:38:28 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -317,6 +317,19 @@
        struct termios t;
        dev_t condev;
 
+       /*
+        * Get console device, should either be ttyE0 or tty0n.
+        * Too hard to double check, so just 'know' the device numbers.
+        */
+       len = sizeof condev;
+       if (sysctl(conmib, __arraycount(conmib), &condev, &len, NULL, 0) != -1
+           && (condev & ~3) == 0x800) {
+               /* Motherboard serial port */
+               boottype.bp_consdev = (condev & 3) + 1;
+               /* Defaulting the baud rate to that of stdin should suffice */
+               if (tcgetattr(0, &t) != -1)
+                       boottype.bp_conspeed = t.c_ispeed;
+
        if (pm == NULL || !pm->no_part) {
                /*
                 * Get console device, should either be ttyE0 or tty0n.



Home | Main Index | Thread Index | Old Index