Add patch to support serial terminals under Solaris.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 30 May 2006 20:27:07 +0000 (20:27 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 30 May 2006 20:27:07 +0000 (20:27 +0000)
src/misc/bochs-2.2.6-build.sh
src/misc/bochs-2.2.6-solaris-link.patch [new file with mode: 0644]
src/misc/bochs-2.2.6-solaris-tty.patch [new file with mode: 0644]
src/misc/bochs-2.2.6-solaris.patch [deleted file]
src/misc/bochs-2.2.6.README

index 5b099914458a5f4e2c82d5aef56a656a9925ee31..2878fbd9f626effb42f5085e963aa040f1bf9ce1 100755 (executable)
@@ -18,8 +18,9 @@ cat $PINTOSDIR/src/misc/bochs-2.2.6-ms-extensions.patch | patch -p1
 cat $PINTOSDIR/src/misc/bochs-2.2.6-big-endian.patch | patch -p1
 cat $PINTOSDIR/src/misc/bochs-2.2.6-jitter.patch | patch -p1
 cat $PINTOSDIR/src/misc/bochs-2.2.6-triple-fault.patch | patch -p1
+cat $PINTOSDIR/src/misc/bochs-2.2.6-solaris-tty.patch | patch -p1
 if test "`uname -s`" = "SunOS"; then
-    cat $PINTOSDIR/src/misc/bochs-2.2.6-solaris.patch | patch -p1
+    cat $PINTOSDIR/src/misc/bochs-2.2.6-solaris-link.patch | patch -p1
 fi
 CFGOPTS="--with-x --with-x11 --with-term --with-nogui --prefix=$DSTDIR"
 mkdir plain &&
diff --git a/src/misc/bochs-2.2.6-solaris-link.patch b/src/misc/bochs-2.2.6-solaris-link.patch
new file mode 100644 (file)
index 0000000..5afef49
--- /dev/null
@@ -0,0 +1,11 @@
+--- bochs-2.2.6.orig/Makefile.in       2006-04-03 16:34:51.170387000 -0700
++++ bochs-2.2.6/Makefile.in    2006-04-03 16:34:57.480303000 -0700
+@@ -93,7 +93,7 @@
+ CFLAGS = @CFLAGS@ @GUI_CFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
+ CXXFLAGS = @CXXFLAGS@ @GUI_CXXFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
+-LDFLAGS = @LDFLAGS@
++LDFLAGS = @LDFLAGS@ -lsocket
+ LIBS = @LIBS@
+ # To compile with readline:
+ #   linux needs just -lreadline
diff --git a/src/misc/bochs-2.2.6-solaris-tty.patch b/src/misc/bochs-2.2.6-solaris-tty.patch
new file mode 100644 (file)
index 0000000..a9725dc
--- /dev/null
@@ -0,0 +1,31 @@
+--- bochs-2.2.6/iodev/serial.cc        2005-07-11 09:24:47.000000000 -0700
++++ bochs-2.2.6.patch/iodev/serial.cc  2006-05-28 16:41:33.278938000 -0700
+@@ -245,8 +245,13 @@
+             BX_SER_THIS s[i].io_mode = BX_SER_MODE_TERM;
+             BX_DEBUG(("com%d tty_id: %d", i+1, BX_SER_THIS s[i].tty_id));
+             tcgetattr(BX_SER_THIS s[i].tty_id, &BX_SER_THIS s[i].term_orig);
+-            bcopy((caddr_t) &BX_SER_THIS s[i].term_orig, (caddr_t) &BX_SER_THIS s[i].term_new, sizeof(struct termios));
+-            cfmakeraw(&BX_SER_THIS s[i].term_new);
++            memcpy((caddr_t) &BX_SER_THIS s[i].term_new, (caddr_t) &BX_SER_THIS s[i].term_orig, sizeof(struct termios));
++            BX_SER_THIS s[i].term_new.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
++                                          |INLCR|IGNCR|ICRNL|IXON);
++            BX_SER_THIS s[i].term_new.c_oflag &= ~OPOST;
++            BX_SER_THIS s[i].term_new.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
++            BX_SER_THIS s[i].term_new.c_cflag &= ~(CSIZE|PARENB);
++            BX_SER_THIS s[i].term_new.c_cflag |= CS8;
+             BX_SER_THIS s[i].term_new.c_oflag |= OPOST | ONLCR;  // Enable NL to CR-NL translation
+ #ifndef TRUE_CTLC
+             // ctl-C will exit Bochs, or trap to the debugger
+
+
+--- bochs-2.2.6/iodev/serial.h 2005-07-10 09:51:09.000000000 -0700
++++ bochs-2.2.6.patch/iodev/serial.h   2006-05-28 16:39:03.757839000 -0700
+@@ -40,7 +40,7 @@
+ #define SERIAL_ENABLE
+ #endif
+-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__APPLE__)
++#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__APPLE__) || defined(__sun__)
+ #define SERIAL_ENABLE
+ extern "C" {
+ #include <termios.h>
diff --git a/src/misc/bochs-2.2.6-solaris.patch b/src/misc/bochs-2.2.6-solaris.patch
deleted file mode 100644 (file)
index 5afef49..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- bochs-2.2.6.orig/Makefile.in       2006-04-03 16:34:51.170387000 -0700
-+++ bochs-2.2.6/Makefile.in    2006-04-03 16:34:57.480303000 -0700
-@@ -93,7 +93,7 @@
- CFLAGS = @CFLAGS@ @GUI_CFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
- CXXFLAGS = @CXXFLAGS@ @GUI_CXXFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
--LDFLAGS = @LDFLAGS@
-+LDFLAGS = @LDFLAGS@ -lsocket
- LIBS = @LIBS@
- # To compile with readline:
- #   linux needs just -lreadline
index 1224dd7cef253aea90c8705ca7e580c852452442..301a39c6961504d47739c5d8631a05dfea29c341 100644 (file)
@@ -22,7 +22,12 @@ patches for this version of Bochs are included:
         Needed for Bochs to compile with GCC on some hosts.  Probably
         harmless elsewhere.
 
-    bochs-2.2.6-solaris.patch
+    bochs-2.2.6-solaris-tty.patch
+
+        Needed for Bochs to compile in terminal support on Solaris
+       hosts.  Probably harmless elsewhere.
+
+    bochs-2.2.6-solaris-link.patch
 
         Needed on Solaris hosts.  Do not apply it elsewhere.
 
@@ -31,7 +36,8 @@ To apply all the patches, cd into the Bochs directory, then type
        patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-jitter.patch
        patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-triple-fault.patch
        patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-ms-extensions.patch
-       patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-solaris.patch
+       patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-solaris-tty.patch
+       patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-solaris-link.patch
 You will have to supply the proper $PINTOSDIR, of course.  You can use
 patch's --dry-run option if you want to test whether the patches would
 apply cleanly before trying to apply them.