Hi Michael,

Yes we can see terminal input truncated when we use copy-paste to input characters.

I don't quite understand the relationship between SerialInTimeOut and timer event poll rate; and I don't see the periodic timer rate is to be updated later; we are using 0.02ms period all over, aren't we?

If the timer event polls the serial device at a fixed rate, how can we guarantee the FIFO of the device will not overflow during a burst input?

Thanks.

On 11/10/2015 01:25 AM, Kinney, Michael D wrote:
Heyi,

The function TerminalConInTimerHandler () computes a timeout based on the baud 
rate, data bits, and stop bits

       //
       // According to BAUD rate to calculate the timeout value.
       //
       SerialInTimeOut = (1 + Mode->DataBits + Mode->StopBits) * 2 * 1000000 / 
(UINTN) Mode->BaudRate;

The #define is used to set the initial periodic timer rate before the rest of 
the information to compute a timeout is known.

Are you observing an issue?

Mike

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Heyi
Guo
Sent: Monday, November 09, 2015 1:48 AM
To: [email protected]
Cc: Tian, Feng
Subject: [edk2] [RFC] Adaptively set serial terminal input polling interval

Hi All,

In MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf, the
polling interval is fixed by macro:

#define KEYBOARD_TIMER_INTERVAL         200000  // 0.02s

However, this may cause fast input to be truncated on some platform. For
example, we have a serial console with below features:
1. Baud rate: 115200
2. FIFO depth of UART device: 32

If we want to capture all input, we need to poll with the interval of 32
/ (115200 / (8 + 1 + 1)) = 2.8 ms, 8 + 1 + 1 for data bits + start bit +
stop bit.

So, I suppose to use a PCD to set the interval per platform, or
calculate from serial IO protocol IO Mode, which contains FIFO depth and
data bits, etc, and we can use 200000 as the maximum for compatibility,
or default value when fifo depth is 0.

Please let me know your comments.

Thanks.

Heyi
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to