summaryrefslogtreecommitdiff
path: root/lib/ose/doc/src/ose_intro.xml
blob: 0dd3ec409e5d3ed86136f7a4f4f84e23883a6d6b (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>2013</year><year>2014</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      The contents of this file are subject to the Erlang Public License,
      Version 1.1, (the "License"); you may not use this file except in
      compliance with the License. You should have received a copy of the
      Erlang Public License along with this software. If not, it can be
      retrieved online at http://www.erlang.org/.

      Software distributed under the License is distributed on an "AS IS"
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
      the License for the specific language governing rights and limitations
      under the License.

    </legalnotice>

    <title>Introduction</title>
    <prepared>Lukas Larsson</prepared>
    <docno></docno>
    <date>2014-01-08</date>
    <rev>A</rev>
    <file>ose_intro.xml</file>
  </header>

  <section>
    <title>Features</title>
  </section>

  <section>
    <title>Starting Erlang/OTP</title>
    <p>
      Starting Erlang/OTP on OSE is not as simple as on Unix/Windows (yet).
      First of all you have to explicitly use the beam (or beam.smp) executables
      found in erts-X.Y.Z/bin as the load module that you run. This in turn
      means that you have to supply the raw beam arguments to the emulator
      when starting. Fortunately <c>erl</c> on Unix/Windows has a
      undocumented flag called <c>-emu_args_exit</c> that can be used to
      figure out what the arguments to beam look like. For example:</p>
      <code># erl +Mut false +A 10 +S 4:4 +Muycs256 +P 2096 +Q 2096 -emu_args_exit
-Mut
false
-A
10
-S
4:4
-Muycs256
-P
2096
-Q
2096
--
-root
/usr/local/lib/erlang
-progname
erl
--
-home
/home/erlang
--</code>
    <p>
      The arguments are printed on seperate lines to make it possible to know
      what has to be quoted with &quot;. Each line is one quotable unit.
      So taking the arguments above you can supply them to pm_create or
      just execute directly on the command line. For example:</p>
      <code>rtose@acp3400> pm_install erlang /mst/erlang/erts-6.0/bin/beam.smp
rtose@acp3400> pm_create -c ARGV="-Mut false -A 10 -S 4:4 -Muycs256 -P 2096 -Q 2099 -- -root /mst/erlang -progname erl -- -home /mst/erlang --" erlang
pid: 0x110059
rtose@acp3400> pm_start 0x110059</code>
    <p>
      Also note that since we are running erl to figure out the arguments on a
      seperate machine the paths have to be updated. In the example above
      <c>/usr/local/lib/erlang</c> was replaced by <c>/mst/erlang/</c>. The
      goal is to in future releases not have to do the special argument handling
      but for now (17.0-rc2) you have to do it.
    </p>
    <note>
      Because of a limitation in the way the OSE handles stdio when starting
      load modules using pm_install/create the Erlang shell only reads every
      other command from stdin. However if you start Erlang using run_erl
      you do not have this problem. So it is highly recommended that you
      start Erlang using run_erl.
    </note>
  </section>

  <section>
    <title>run_erl and to_erl</title>
    <p>
      In OSE run_erl and to_erl are combined into a single load module called
      run_erl_lm. Installing and starting the load module will add two new
      shell commands called run_erl and to_erl. They work in exactly the same
      way as the unix variants of run_erl and to_erl, except that the read
      and write pipes have to be placed under the /pipe vm. One additional
      option also exists to run_erl on ose:
      <taglist>
	<tag><c>-block Name</c></tag>
	<item>The name of the install handle and block that will be created/used by
	installing and exectuting the first part of the command. If nothing
	if given the basename of the load module will be used for this value.
	Example:
	<code>pm_install erlang /path/to/erlang/vm/beam.smp
run_erl -daemon -block erlang /pipe/ /mst/erlang_logs/ "beam.smp -A 1 -- -root /mst/erlang -- -home /mst --"</code>
	</item>
      </taglist>
      The same argument munching as when starting Erlang/OTP without run_erl
      has to be done. If <c>-daemon</c> is given then all error printouts
      are sent to the ramlog.
      See also
      <seealso marker="erts:run_erl">run_erl</seealso> for more details.
    </p>
    <p>
      Below is an example of how to get started with <c>run_erl_lm</c>.
      <code>rtose@acp3400> pm_install run_erl_lm /mst/erlang/erts-6.0/bin/run_erl_lm
rtose@acp3400> pm_create run_erl_lm
pid: 0x1c005d
rtose@acp3400> pm_start 0x1c005d
rtose@acp3400> mkdir /mst/erlang_log
rtose@acp3400> run_erl -daemon /pipe/ /mst/erlang_log/ "/mst/erlang/erts-6.0/bin/beam.smp -A 1 -- -root /mst/erlang -- -home /mst --"
rtose@acp3400> to_erl
Attaching to /pipe/erlang.pipe.1 (^C to exit)
os:type().
{ose,release}
2>
'to_erl' terminated.</code>
      Note that Ctrl-C is used instead of Ctrl-D to exit the to_erl shell.
    </p>
  </section>

  <section>
    <title>epmd</title>
    <p>
      In OSE epmd will not be started automatically so if you want to use
      Erlang distribution you have to manually start epmd.
    </p>
  </section>

  <section>
    <title>VM Process Priorities</title>
    <p>
      It is possible to set the priorities you want for the OSE processes that
      thr emulator creates in the lmconf. An example of how to do it can be
      found in the default lmconf file in
      $ERL_TOP/erts/emulator/sys/ose/default.lmconf.
    </p>
  </section>

</chapter>