?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. <html>
  2.   <head>
  3.     <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
  4.     <title>&mu;Csim: Multiple Consoles</title>
  5.   </head>
  6.   <body bgcolor="white">
  7.     <h1>Using multiple consoles</h1>
  8.     <h3>Why?</h3>
  9.     Using more than one console can be useful if you want to issue a
  10.     command during the simulated program is executed.
  11.     <h3>How?</h3>
  12.     <p>To get multiple consoles you have to execute the simulator in the
  13.       <i>background</i> like daemons run in UNIX systems. The simulator
  14.       then will listen and wait for network connection requests and provide
  15.       console functions for network connections.
  16.     </p>
  17.     <p>To run <i>&mu;Csim</i> in the background you have to use <a href="invoke.html#Zoption">-Z</a>
  18.       option for the simulator:
  19.     </p>
  20.     <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex
  21. </pre>
  22.     In this case s51 runs in foreground in your command interpreters point
  23.     of view. Of course you can run the program really in the background:
  24.     <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex &amp;
  25. </pre>
  26.     The parameter of the <a href="invoke.html#Zoption">-Z</a> option is a
  27.     port number. This can be number of any unused port of your machine. If
  28.     the specified port is already occupied then following message appears:
  29.     <pre><font color="blue">pigmy$</font> s51 -Z 5555
  30. <font color="red">bind: Address already in use</font>
  31. </pre>
  32.     In this case you have to use an other number.
  33.     <p>Let's suppose you have found a free port number and the simulator
  34.      listens on it. Now go to somewhere else, at least to an other window
  35.      and connect to the simulator:
  36.    </p>
  37.    <pre><font color="blue">other_machine$</font> telnet pigmy 5555
  38. </pre>
  39.    First parameter to the telnet command is the name of the machine where
  40.    the simulator is running on. It can be <tt>localhost</tt> if you are
  41.    on the same machine or the fully qualified host name if you are at the
  42.    other end of the world. Second parameter is the number of the port
  43.    where the simulator is listening. It must be the same number which was
  44.    specified as parameter of the <a href="invoke.html#Zoption">-Z</a>
  45.    option when the simulator was started (see above).
  46.    <p>Connecting to the simulator you get a command console:
  47.    </p>
  48.    <pre><font color="blue">pigmy$</font> telnet pigmy 5555
  49. <font color="green">Trying 127.0.0.1...
  50. Connected to pigmy.talker.bt.
  51. Escape character is '^]'.
  52. ucsim 0.2.21, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  53. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  54. This is free software, and you are welcome to redistribute it
  55. under certain conditions; type `show c' for details.
  56. &gt;
  57. </font>
  58. </pre>
  59.    <h3>What to do with it?</h3>
  60.    Obviously you can telnet into the simulator as many times as many
  61.    command consoles you want. You can start the execution using one
  62.    console and while the program is executed you can, for example, modify
  63.    ports on the other console.
  64.    <h3>Stop</h3>
  65.    Using <a href="cmd.html#q">quit (q)</a> command you can not stop the
  66.    simulator. It just stops the actual console and the simulator
  67.    continues to listen for incoming network connections.
  68.    <p>To stop the simulator completely you have to use <a href="cmd.html#kill">kill</a>
  69.      command. Note that if you stop the
  70.      simulator then all the active network connections (all other consoles)
  71.      will stop.
  72.    </p>
  73.    <h3>Tricks</h3>
  74.    You can get a console on the terminal where you started the
  75.    simulator. To do this you must explicitly ask the simulator to open a
  76.    console on the standard input/output. You can do this using <a href="invoke.html#coption">-c</a>
  77.    option and specify the actual
  78.    terminal as parameter for it:
  79.    <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex -c /dev/tty
  80. </pre>
  81.    <hr>
  82.  </body>
  83. </html>
  84.