Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand/efiboot During awaitkey(), ...



details:   https://anonhg.NetBSD.org/src/rev/051443602a04
branches:  trunk
changeset: 319102:051443602a04
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed May 16 19:53:54 2018 +0000

description:
During awaitkey(), move the cursor back to the beginning of the
countdown with '\b' only after waiting.

Some UEFI implementations have a destructive/erasing backspace,
and will not show the countdown if we move the cursor back before the
wait.

My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace,
while my Gigabyte Brix GB-BXBT-2807 did not.

Should fix PR #53292.

diffstat:

 sys/arch/i386/stand/efiboot/eficons.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 0222b5233304 -r 051443602a04 sys/arch/i386/stand/efiboot/eficons.c
--- a/sys/arch/i386/stand/efiboot/eficons.c     Wed May 16 19:02:00 2018 +0000
+++ b/sys/arch/i386/stand/efiboot/eficons.c     Wed May 16 19:53:54 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eficons.c,v 1.5 2018/03/27 14:15:05 nonaka Exp $       */
+/*     $NetBSD: eficons.c,v 1.6 2018/05/16 19:53:54 jakllsch Exp $     */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -328,10 +328,10 @@
        char c = 0;
 
        for (;;) {
+               char numbuf[32];
+               int len;
+
                if (tell && timeout) {
-                       char numbuf[32];
-                       int len;
-
                        len = snprintf(numbuf, sizeof(numbuf), "%d seconds. ",
                            timeout);
                        if (len > 0 && len < sizeof(numbuf)) {
@@ -340,7 +340,6 @@
                                printf("%s", numbuf);
                                while (*p)
                                        *p++ = '\b';
-                               printf("%s", numbuf);
                        }
                }
                if (iskey(1)) {
@@ -355,6 +354,8 @@
                        internal_waitforinputevent(10000000);
                else
                        break;
+               if (tell)
+                       printf("%s", numbuf);
        }
 
 out:



Home | Main Index | Thread Index | Old Index