Basic Eraser support.
[pintos-anon] / src / misc / bochs-2.1.1-tty-stdout.patch
1 The fourth patch enables the serial device under Solaris and disables
2 tty setup at the same time.  Tty setup is a pain when you want to
3 connect a serial port to stdout and it doesn't work under Solaris
4 anyway.  This patch is useful everywhere with `pintos', but may not be
5 wanted elsewhere.
6
7 diff -urp bochs-2.1.1-upstream/iodev/serial.cc bochs-2.1.1/iodev/serial.cc
8 --- tmp/bochs-2.1.1/iodev/serial.cc     2004-02-11 14:28:54.000000000 -0800
9 +++ bochs-2.1.1/iodev/serial.cc 2005-06-01 20:26:01.000000000 -0700
10 @@ -118,10 +118,11 @@ bx_serial_c::init(void)
11  
12  #ifdef SERIAL_ENABLE
13    if (strlen(bx_options.com[0].Odev->getptr ()) > 0) {
14 -    tty_id = open(bx_options.com[0].Odev->getptr (), O_RDWR|O_NONBLOCK,600);
15 +    tty_id = open(bx_options.com[0].Odev->getptr (), O_RDWR,600);
16      if (tty_id < 0)
17        BX_PANIC(("open of %s (%s) failed\n",
18                  "com1", bx_options.com[0].Odev->getptr ()));
19 +#if 0
20      BX_DEBUG(("tty_id: %d",tty_id));
21      tcgetattr(tty_id, &term_orig);
22      bcopy((caddr_t) &term_orig, (caddr_t) &term_new, sizeof(struct termios));
23 @@ -145,6 +148,7 @@ bx_serial_c::init(void)
24      term_new.c_cc[VTIME] = 0;
25      //term_new.c_iflag |= IXOFF;
26      tcsetattr(tty_id, TCSAFLUSH, &term_new);
27 +#endif
28    }
29  #endif   /* def SERIAL_ENABLE */
30    // nothing for now
31 @@ -955,7 +968,7 @@ bx_serial_c::rx_timer(void)
32      }
33      if (rdy) {
34        chbuf = data;
35 -#elif defined(SERIAL_ENABLE)
36 +#elif 0 && defined(SERIAL_ENABLE)
37      if ((tty_id >= 0) && (select(tty_id + 1, &fds, NULL, NULL, &tval) == 1)) {
38        (void) read(tty_id, &chbuf, 1);
39        BX_DEBUG(("read: '%c'",chbuf));