[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bochs-cvs
Subject:    [Bochs-cvs] CVS: bochs .bochsrc,1.86,1.87 config.cc,1.7,1.8
From:       Volker Ruppert <vruppert () users ! sourceforge ! net>
Date:       2004-07-28 19:36:44
Message-ID: E1BpuEG-0003HC-Ia () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/bochs/bochs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12500

Modified Files:
	.bochsrc config.cc 
Log Message:
- support for serial port modes added. The mode defines what to do with the
  data written to the port and where to get the data read from it. Available
  modes are 'null' (no input/output), 'file' (output to a file specified as
  the 'dev' parameter), 'term' (serial terminal) and 'raw' (use the real serial
  port - under construction for win32).
- descriptions for serial and parallel options in bochsrc sample updated


Index: .bochsrc
===================================================================
RCS file: /cvsroot/bochs/bochs/.bochsrc,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- .bochsrc	29 Jun 2004 19:24:17 -0000	1.86
+++ .bochsrc	28 Jul 2004 19:36:41 -0000	1.87
@@ -370,21 +370,29 @@
 debugger_log: -
 
 #=======================================================================
-# COM1:
-# This defines a serial port (UART type 16550A). You can specify a device
-# to use as com1. This can be a real serial line, or a pty.  To use a pty
-# (under X/Unix), create two windows (xterms, usually).  One of them will
+# COM1, COM2, COM3, COM4:
+# This defines a serial port (UART type 16550A). In the 'term' you can specify
+# a device to use as com1. This can be a real serial line, or a pty.  To use
+# a pty (under X/Unix), create two windows (xterms, usually).  One of them will
 # run bochs, and the other will act as com1. Find out the tty the com1
 # window using the `tty' command, and use that as the `dev' parameter.
 # Then do `sleep 1000000' in the com1 window to keep the shell from
 # messing with things, and run bochs in the other window.  Serial I/O to
 # com1 (port 0x3f8) will all go to the other window.
+# Other serial modes are 'null' (no input/output), 'file' (output to a file
+# specified as the 'dev' parameter) and 'raw' (use the real serial port - under
+# construction for win32).
+#
+# Examples:
+#   com1: enabled=1, mode=null
+#   com2: enabled=1, mode=file, dev=serial.out
+#   com3: enabled=1, mode=raw, dev=com1
 #=======================================================================
-#com1: enabled=1, dev=/dev/ttyp9
+#com1: enabled=1, mode=term, dev=/dev/ttyp9
 
 
 #=======================================================================
-# PARPORT1:
+# PARPORT1, PARPORT2:
 # This defines a parallel (printer) port. When turned on and an output file is
 # defined the emulated printer port sends characters printed by the guest OS
 # into the output file. On some platforms a device filename can be used to
@@ -393,7 +401,7 @@
 #
 # Examples:
 #   parport1: enabled=1, file="parport.out"
-#   parport1: enabled=1, file="/dev/lp0"
+#   parport2: enabled=1, file="/dev/lp0"
 #   parport1: enabled=0
 #=======================================================================
 parport1: enabled=1, file="parport.out"

Index: config.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/config.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- config.cc	18 Jul 2004 17:18:19 -0000	1.7
+++ config.cc	28 Jul 2004 19:36:42 -0000	1.8
@@ -843,6 +843,14 @@
         *par_ser_ptr++ = bx_options.par[i].Ooutfile;
   }
 
+  static char *serial_mode_list[] = {
+    "null",
+    "file",
+    "term",
+    "raw",
+    NULL
+  };
+
   // serial ports
   for (i=0; i<BX_N_SERIAL_PORTS; i++) {
         // options for COM port
@@ -853,6 +861,15 @@
                 strdup(name), 
                 strdup(descr), 
                 (i==0)?1 : 0);  // only enable the first by default
+        sprintf (name, "I/O mode of the serial device for COM%d", i+1);
+        sprintf (descr, "The mode can be one these: 'null', 'file', 'term', 'raw'");
+        bx_options.com[i].Omode = new bx_param_enum_c (
+                BXP_COMx_MODE(i+1),
+                strdup(name), 
+                strdup(descr), 
+                serial_mode_list,
+                0,
+                0);
         sprintf (name, "Pathname of the serial device for COM%d", i+1);
         sprintf (descr, "The path can be a real serial device or a pty (X/Unix only)");
         bx_options.com[i].Odev = new bx_param_filename_c (
@@ -860,11 +877,13 @@
                 strdup(name), 
                 strdup(descr), 
                 "", BX_PATHNAME_LEN);
-        deplist = new bx_list_c (BXP_NULL, 1);
+        deplist = new bx_list_c (BXP_NULL, 2);
+        deplist->add (bx_options.com[i].Omode);
         deplist->add (bx_options.com[i].Odev);
         bx_options.com[i].Oenabled->set_dependent_list (deplist);
         // add to menu
         *par_ser_ptr++ = bx_options.com[i].Oenabled;
+        *par_ser_ptr++ = bx_options.com[i].Omode;
         *par_ser_ptr++ = bx_options.com[i].Odev;
   }
 
@@ -1688,6 +1707,7 @@
   // standard ports
   for (i=0; i<BX_N_SERIAL_PORTS; i++) {
     bx_options.com[i].Oenabled->reset();
+    bx_options.com[i].Omode->reset();
     bx_options.com[i].Odev->reset();
     }
   for (i=0; i<BX_N_PARALLEL_PORTS; i++) {
@@ -2480,6 +2500,11 @@
       if (!strncmp(params[i], "enabled=", 8)) {
         bx_options.com[0].Oenabled->set (atol(&params[i][8]));
         }
+      else if (!strncmp(params[i], "mode=", 5)) {
+        if (!bx_options.com[0].Omode->set_by_name (strdup(&params[i][5])))
+          PARSE_ERR(("%s: serial port mode '%s' not available", context, strdup(&params[i][5])));
+        bx_options.com[0].Oenabled->set (1);
+        }
       else if (!strncmp(params[i], "dev=", 4)) {
         bx_options.com[0].Odev->set (&params[i][4]);
         bx_options.com[0].Oenabled->set (1);
@@ -2494,6 +2519,11 @@
       if (!strncmp(params[i], "enabled=", 8)) {
         bx_options.com[1].Oenabled->set (atol(&params[i][8]));
         }
+      else if (!strncmp(params[i], "mode=", 5)) {
+        if (!bx_options.com[1].Omode->set_by_name (strdup(&params[i][5])))
+          PARSE_ERR(("%s: serial port mode '%s' not available", context, strdup(&params[i][5])));
+        bx_options.com[1].Oenabled->set (1);
+        }
       else if (!strncmp(params[i], "dev=", 4)) {
         bx_options.com[1].Odev->set (&params[i][4]);
         bx_options.com[1].Oenabled->set (1);
@@ -2508,6 +2538,11 @@
       if (!strncmp(params[i], "enabled=", 8)) {
         bx_options.com[2].Oenabled->set (atol(&params[i][8]));
         }
+      else if (!strncmp(params[i], "mode=", 5)) {
+        if (!bx_options.com[2].Omode->set_by_name (strdup(&params[i][5])))
+          PARSE_ERR(("%s: serial port mode '%s' not available", context, strdup(&params[i][5])));
+        bx_options.com[2].Oenabled->set (1);
+        }
       else if (!strncmp(params[i], "dev=", 4)) {
         bx_options.com[2].Odev->set (&params[i][4]);
         bx_options.com[2].Oenabled->set (1);
@@ -2522,6 +2557,11 @@
       if (!strncmp(params[i], "enabled=", 8)) {
         bx_options.com[3].Oenabled->set (atol(&params[i][8]));
         }
+      else if (!strncmp(params[i], "mode=", 5)) {
+        if (!bx_options.com[3].Omode->set_by_name (strdup(&params[i][5])))
+          PARSE_ERR(("%s: serial port mode '%s' not available", context, strdup(&params[i][5])));
+        bx_options.com[3].Oenabled->set (1);
+        }
       else if (!strncmp(params[i], "dev=", 4)) {
         bx_options.com[3].Odev->set (&params[i][4]);
         bx_options.com[3].Oenabled->set (1);
@@ -3436,6 +3476,7 @@
 {
   fprintf (fp, "com%d: enabled=%d", n, opt->Oenabled->get ());
   if (opt->Oenabled->get ()) {
+    fprintf (fp, ", mode=\"%s\"", opt->Omode->get_choice(opt->Omode->get()));
     fprintf (fp, ", dev=\"%s\"", opt->Odev->getptr ());
   }
   fprintf (fp, "\n");



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic