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

[Minios-devel] [PATCH v3 0/4] mini-os: Enable console to be configured as raw tty



This patch adds minimal TERMIOS support to mini-os consoles, specifically
enabling the console to be set into raw mode.  In raw mode the mini-os
conversion of NL to CRNL is disabled.

The main driver for this change is enabling an IOEMU stubdom to transmit
data sent by a guest unmodified.  Once this change is in mini-os a small
additional change is required to QEMU traditional to enable raw mode.

In principal TERMIOS support could be extended to include additional
TTY settings.

Changes since v1 (thanks Wei Liu):
 - is_raw now bool instead of uint8_t

Changes since v2:
 - toggle raw mode with OPOST not ONLCR
 - additional error checking on parameters to termios funcs

 console/console.c       |    5 +++
 include/console.h       |    3 +
 include/posix/termios.h |    1
 lib/sys.c               |   79 ++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 86 insertions(+), 2 deletions(-)

The patch to QEMU traditional will be submitted separately but is included
below for information.

diff --git a/qemu-char.c b/qemu-char.c
index f62a6af..6495ab8 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1127,12 +1127,19 @@ static CharDriverState *qemu_chr_open_tty(const char 
*filename)
 static CharDriverState *qemu_chr_open_pty(void)
 {
     CharDriverState *chr;
-    int fd;
+    int fd, ret;
+    struct termios ct;

     fd = posix_openpt(O_RDWR|O_NOCTTY);
     if (fd < 0)
         return NULL;

+    ret = tcgetattr(fd, &ct);
+    if (!ret) {
+        cfmakeraw(&ct);
+        (void)tcsetattr(fd, TCSANOW, &ct);
+    }
+
     chr = qemu_chr_open_fd(fd, fd);
     if (!chr) {
         close(fd);


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.