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