summaryrefslogtreecommitdiff
path: root/sim/ucsim/docs/mulcons.html
blob: 2f5ca49c57aba0df63e65d7fa03210d6a52d4c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
    <title>&micro;Csim: Multiple Consoles</title>
  </head>
  
  <body bgcolor="white">
    
    <h1>Using multiple consoles</h1>
    
    <h3>Why?</h3>

    Using more than one console can be useful if you want to issue a
    command during the simulated program is executed.

    <h3>How?</h3>

    <p>To get multiple consoles you have to execute the simulator in
    the <i>background</i> like daemons run in UNIX systems. The
      simulator then will listen and wait for network connection
      requests and provide console functions for network connections. </p>

    <p>To run <i>&micro;Csim</i> in the background you have to use
      <a href="invoke.html#ucZoption">-Z</a>
      option for the simulator: </p>

    <pre><font color="blue">pigmy$</font> ucsim_51 -Z 5555 foo.hex
    </pre>

    In this case ucsim_51 runs in foreground in your command interpreters point of
    view. Of course you can run the program really in the background:

    <pre><font color="blue">pigmy$</font> ucsim_51 -Z 5555 foo.hex &amp;
</pre>

The parameter of the <a href="invoke.html#ucZoption">-Z</a> option is a
    port number. This can be number of any unused port of your machine. If the
    specified port is already occupied then following message appears:

<pre><font color="blue">pigmy$</font> ucsim_51 -Z 5555
<font color="red">bind: Address already in use</font>
</pre>

In this case you have to use an other number.

<p><blockquote><i>Port number for listening incoming connections can
  be specified either by using <a href="invoke.html#ucZoption">-Z</a> or
  <a href="invoke.html#lczoption">-z</a> option. If
  <a href="invoke.html#ucZoption">-Z</a> is used, &micro;Csim will work
  in backgound mode, default console is not opened in stdio.
  If <a href="invoke.html#lczoption">-z</a> is used to specify the port
  number, &micro;Csim will work in foreground mode, default console is
  opened on stdio and other consoles can be accessed by telneting to
  the listening port.
</i></blockquote>
</p>

    <p>Let's suppose you have found a free port number and the
      simulator listens on it. Now go to somewhere else, at least to
      an other window and connect to the simulator: </p>

    <pre><font color="blue">other_machine$</font> telnet pigmy 5555
    </pre>

    First parameter to the telnet command is the name of the machine where
    the simulator is running on. It can be <tt>localhost</tt> if you are on the
    same machine or the fully qualified host name if you are at the other end of
    the world. Second parameter is the number of the port where the simulator is
    listening. It must be the same number which was specified as parameter of
    the <a href="invoke.html#ucZoption">-Z</a> option when the simulator was
    started (see above).

    <p>Connecting to the simulator you get a command console: </p>

    <pre><font color="blue">pigmy$</font> telnet pigmy 5555
<font color="green">Trying 127.0.0.1...
Connected to pigmy.talker.bt.
Escape character is '^]'.
ucsim 0.2.21, Copyright (C) 1997 Daniel Drotos, Talker Bt.
ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
&gt;
</font> 
    </pre>
    
    <h3>What to do with it?</h3>

    Obviously you can telnet into the simulator as many times as many command
    consoles you want. You can start the execution using one console and while
    the program is executed you can, for example, modify ports on the other
    console.

    <h3>Stop</h3>

    Using <a href="cmd.html#q">quit (q)</a> command you can not stop the
    simulator. It just stops the actual console and the simulator continues to
    listen for incoming network connections.

    <p>To stop the simulator completely you have to use <a href="cmd.html#kill">kill</a>
      command. Note that if you stop the simulator (by kill) then all the active
      network connections (all other consoles) will stop. </p>

    <h3>Tricks</h3>

    You can get a console on the terminal where you started the simulator. To do
    this you must explicitly ask the simulator to open a console on the standard
    input/output. You can do this using <a href="invoke.html#lccoption">-c</a>
    option and specify the actual terminal as parameter for it:

    <pre><font color="blue">pigmy$</font> ucsim_51 -Z 5555 foo.hex -c /dev/tty
    </pre>
    
    <hr>
  </body>
</html>