Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kernel][cmds] Enhance kernel, vi and sh on serial ports #553

Merged
merged 3 commits into from
Apr 15, 2020
Merged

[kernel][cmds] Enhance kernel, vi and sh on serial ports #553

merged 3 commits into from
Apr 15, 2020

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Apr 14, 2020

Lots of changes to allow vi and sh to work on variable-sized serial consoles (using a terminal emulator for access to ELKS /dev/ttyS0). Changing window size while vi is running is not supported.

  • Add ANSI DSR (device status report) cursor location handler to direct console driver.
  • Implement tty/serial VTIME timeout processing for received characters.
  • Don't update serial divisor latch unless changed for TCSET ioctl.
  • Enhance vi and sh (linenoise) to use DSR sequence to determine console size/width.
  • Allows running serial console of any size and proper operation of vi, providing terminal emulator implements DSR response (ESC [ 6 n).
  • Enhance linenoise to use VTIME timeout when reading DSR response.
  • Enhance linenoise to only check console width once.
  • Linenoise ^C operation identical to ^U (clear input line).
  • Match getty line settings to default tty values, ECHONL default off.
  • Revise QEMU defaults in serial driver. QEMU has serious serial port emulation problems and continues to drop input characters.

Please test operation of vi on real serial port. Hopefully running vi multiple times works perfectly when reading DSR response to find window size, unlike QEMU which loses character input data regularly with no overrun or other UART error bit.

@ghaerr ghaerr mentioned this pull request Apr 15, 2020
@ghaerr
Copy link
Owner Author

ghaerr commented Apr 15, 2020

Rewrote tty/serial read routine to fill buffer with as much data as is available up to requested length, rather than returning immediately after VTIME timeout or VMIN characters. This will improve kernel -> user data throughput greatly for any serial input.

All four combinations of VMIN and VTIME line settings are now implemented. (See http://unixwiz.net/techtips/termios-vmin-vtime.html for details).

@ghaerr ghaerr merged commit 3b404e4 into ghaerr:master Apr 15, 2020
@ghaerr ghaerr deleted the vmin branch April 16, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant