From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::230; helo=mail-pg0-x230.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com [IPv6:2607:f8b0:400e:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CC6F32035522C for ; Wed, 8 Nov 2017 00:41:39 -0800 (PST) Received: by mail-pg0-x230.google.com with SMTP id p9so1315267pgc.8 for ; Wed, 08 Nov 2017 00:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xBnQo4k5F+PuiZpyuJDcy+ah231xZrXQNFj5EETgJmg=; b=gzZzYTNCUjCvpqH6MMTPxngYMvNTZRO+Ab2jkPc4ATwrUM8CdEW1ctgzMedLWDJCMC Duuo4ZgOAEsKkHmoikGRRltiQPButegdoQxfyrQadyCctjFZy/a0igM3S86LDYoOk9Ci LK3N8rk1xDhV731xdQJu2OgLGYULlsdQ4H0Ts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xBnQo4k5F+PuiZpyuJDcy+ah231xZrXQNFj5EETgJmg=; b=DmTKP/Y5qnNqJXlPlhG6W4cD0h2adfAYt4eenuHAd+cNd/Bb5ZAoyar7ltoAG4zLPL e0Vuw4kwI2njuu2uy3pqJ/TtsWkCYo6VKzCslVJ7Jbq9isi2HNvFXMpV/2H7Gj9Hh5wr sS1eWs03dq9F14Ic31bd0JkBSY38ZUtzRwwcbgVAp4lXf1QUeGlocgSBMib6AkUi/KX2 rBsaCTxu0Sah6fvJzeOmJnzgHVsMsUQQMj3sDRsUizlmeTLjiTFGGNIPZ0tmK3J1KMPh +IovYTMcpSixWCMwcbG4lWNetAl8NylD7FC2MsvsKhqSSStA2srm0XzI5EncU92CDVX1 cYTA== X-Gm-Message-State: AJaThX7dqh1d9neChj+ZlR/qI/lrdHW6XcgE/UCjwbP5cO9nzwKCN6Yr FmW0ZhvcLFTMY1khvAuQCuqQGQ== X-Google-Smtp-Source: ABhQp+Ty3B2xkPtacLT/NG/dwMDxsBOpWCM4aFEyNoWgda/3jiYIDdvSWHvIXZVlcSJkUW4j/Bzb8g== X-Received: by 10.99.116.25 with SMTP id p25mr1612355pgc.327.1510130739688; Wed, 08 Nov 2017 00:45:39 -0800 (PST) Received: from [10.189.19.158] ([45.56.152.90]) by smtp.gmail.com with ESMTPSA id i8sm5454902pgq.67.2017.11.08.00.45.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 00:45:39 -0800 (PST) To: "Ni, Ruiyu" , "Zeng, Star" , "edk2-devel@lists.01.org" Cc: "Dong, Eric" References: <1958e840-f0fe-6d8e-44d1-03ff9c9dde7b@linaro.org> <0C09AFA07DD0434D9E2A0C6AEB0483103B9B3162@shsmsx102.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BAB6CB0@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BAB6F41@SHSMSX104.ccr.corp.intel.com> From: Heyi Guo Message-ID: Date: Wed, 8 Nov 2017 16:44:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BAB6F41@SHSMSX104.ccr.corp.intel.com> Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC being pressed? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 08:41:39 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 在 11/8/2017 4:34 PM, Ni, Ruiyu 写道: > No. > Even a terminal tool can recognize F10, it still needs to translate it into "ESC [ V" > and send the three bytes to firmware. Got it. But the 2 seconds timeout is not for this situation, right? If terminal tool could translate and send the key sequence, I think it can complete 3 bytes transfer in a very short time, isn't it? E.g. 9600 baud / 8 = 1200 Bytes/s (ignore control bits). So 2 seconds timeout is still for user to enter the sequence "ESC [ V" manually? Thanks, Heyi > > Thanks/Ray > >> -----Original Message----- >> From: Heyi Guo [mailto:heyi.guo@linaro.org] >> Sent: Wednesday, November 8, 2017 4:31 PM >> To: Ni, Ruiyu ; Zeng, Star ; edk2- >> devel@lists.01.org >> Cc: Dong, Eric >> Subject: Re: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >> being pressed? >> >> >> >> 在 11/8/2017 3:55 PM, Ni, Ruiyu 写道: >>> Heyi, >>> >>> If you check the comments below in TerminalConIn.c: >>> >> https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal >> /C >>> onsole/TerminalDxe/TerminalConIn.c#L1319 >>> >>> TerminalDxe driver needs to determine whether user wants to press ESC >>> alone, or press "ESC [ V" for F10 (PCANSI terminal). >> Do you mean F10 is not directly supported on some terminal tools so that we >> need to press 3 keys "ESC [ V" quickly and continuously to emulate F10? >> >> Thanks, >> >> Heyi >>> So a 2 second timeout is added to wait additional keys. >>> >>> Thanks/Ray >>> >>>> -----Original Message----- >>>> From: Zeng, Star >>>> Sent: Wednesday, November 8, 2017 3:25 PM >>>> To: Heyi Guo ; edk2-devel@lists.01.org >>>> Cc: Ni, Ruiyu ; Dong, Eric ; >>>> Zeng, Star >>>> Subject: RE: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >>>> being pressed? >>>> >>>> Cc Terminal expert Ray to see if any comments on this. >>>> >>>> >>>> Thanks, >>>> Star >>>> -----Original Message----- >>>> From: Heyi Guo [mailto:heyi.guo@linaro.org] >>>> Sent: Wednesday, November 8, 2017 3:04 PM >>>> To: edk2-devel@lists.01.org >>>> Cc: Zeng, Star ; Dong, Eric >>>> >>>> Subject: [MdeModulePkg/TerminalDxe] Why do we delay 2s for ESC >> being >>>> pressed? >>>> >>>> Hi folks, >>>> >>>> We found ESC key responded fairly slow on serial port terminal, and >>>> we think it might be caused by the code in UnicodeToEfiKey in >> TerminalConIn.c: >>>>     if (UnicodeChar == ESC) { >>>>       TerminalDevice->InputState = INPUT_STATE_ESC; >>>>     } >>>> >>>>     if (UnicodeChar == CSI) { >>>>       TerminalDevice->InputState = INPUT_STATE_CSI; >>>>     } >>>> >>>>     if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) { >>>>       Status = gBS->SetTimer( >>>>                       TerminalDevice->TwoSecondTimeOut, >>>>                       TimerRelative, >>>>                       (UINT64)20000000 >>>>                       ); >>>>       ASSERT_EFI_ERROR (Status); >>>>       continue; >>>>     } >>>> >>>> It seems we intentionally add 2 seconds delay for ESC key press. This >>>> provides not so good user experience when we press ESC to exit or >>>> cancel some operation. >>>> >>>> We tried reducing this timeout value to 1 second, then the experience >>>> improved much and we didn't find any issue introduced. >>>> >>>> What's the reason for this timeout value and is there any improvement? >>>> >>>> Thanks and regards, >>>> >>>> Heyi