Thu 13 Nov 2014 09:35:59 PM UTC, original submission:
Version: 2.02~beta2-9ubuntu1
OS: Xubuntu 14.04.1 x86 (using their packages)
The serial port in Grub does not support Flow Control (either hardware or software). I have connected a 1997 DEC VT510 serial terminal to a desktop which happened to be old enough to have a serial port. using it from Linux works great. I found out that this terminal really needs flow control, because it displays gibberish when sending enough text fast enough (like scrolling trough man pages) whenever flow control is disabled. Linux (agetty) and the VT510 support flow control, so this issue doesn't really occur there.
Later, I decided that it was boring to look at an empty screen while booting the computer. So I found out that it could display ascii art by using enough echo commands in my grub config. So i edited /etc/grub.d/40_custom and added everything. It seemed to mostly work, but after outputting 1/4th of the logo, a few lines of gibberish would appear instead of the rest of the logo. Not good.
So I rearched for flow control settings. the 'serial' comamnd had options for baud rate, word size, parity, and stop bits. but not flow control. Since there is basically nothing else to check, I concluded that grub2 simply does not support any kind of flow control. Not having flow control is okay when connecting to TTL UART devices like the Raspberry Pi, but not when using actual RS232 like old serial terminals.
When looking for a workaround, I first tried adding 'sleep' commands. Since sleep only works with full seconds, adding sleep every line was too painfully slow. Adding sleep every 8 lines or so worked but showing the ascii art logo in chunks was ugly. Thebn I found out that the play command can also be used as sleep, but it allows smaller durations. I now use 'play 5000 0 1) which sleeps 1/5000th or 12ms after each line. I haven't tested smaller delays, as it is fast enough the way it is now. It sleeps a total of less than 500ms and it works perfectly fine. No gibberish on the terminal and no visible delays or chunks in the output.
Here's a video of the end result with the workaround in place: https://www.youtube.com/watch?v=yMZseIMrvvI
Attached is the relevant bit of my grub config.
But my workaround is mostly an ugly hack and it won't work when the user actually needs real interaction on the terminal.
So the feature request is basically just flow control. Either hardware or software (the VT510 supports both).
|