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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
<year>1997</year><year>2009</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>VxWorks</title>
<prepared>Patrik Winroth</prepared>
<responsible></responsible>
<docno></docno>
<approved></approved>
<checked></checked>
<date>2000-10-17</date>
<rev></rev>
<file>vxworks.xml</file>
</header>
<p>This chapter describes the OS specific parts of OTP which relate
to VxWorks.
</p>
<section>
<title>Introduction</title>
<p>The Erlang/OTP distribution for VxWorks is limited to what
Switchboard requires (Switchboard is a general purpose
switching hardware developed by Ericsson).
</p>
<p>Please consult the README file, included at root level in the
installation, for latest information on the distribution.
</p>
</section>
<section>
<title>Memory Usage</title>
<p>Memory required is 32 Mbyte.
</p>
</section>
<section>
<title>Disk Usage</title>
<p>The disk space required is 22 Mbyte, the documentation included.
</p>
</section>
<section>
<title>Installation</title>
<p>OTP/VxWorks is supplied in a distribution file named
<c><![CDATA[<PREFIX>.tar.gz]]></c>; i.e. a tar archive that is
compressed with gzip. <c><![CDATA[<PREFIX>]]></c> represents the
name of the release,
e.g. <c>otp_LXA12345_vxworks_cpu32_R42A</c>. Assuming you are
installing to a Solaris file system, the installation is
performed by following these steps: <
</p>
<p></p>
<list type="bulleted">
<item>Change to the directory where you want to install
OTP/VxWorks (<c><![CDATA[<ROOTDIR>]]></c>): <c><![CDATA[cd <ROOTDIR>]]></c></item>
<item>Make a directory to put OTP/VxWorks in: <c>mkdir otp_vxworks_cpu32</c> (or whatever you want to call it)</item>
<item>Change directory to the newly created one: <c>cd otp_vxworks_cpu32</c></item>
<item>Copy the distribution file there from where it is located
(<c><![CDATA[<RELDIR>]]></c>): <c><![CDATA[cp <RELDIR>/<PREFIX>.tar.gz .]]></c></item>
<item>Unzip the distribution file: <c><![CDATA[gunzip <PREFIX>.tar.gz]]></c></item>
<item>Untar <c><![CDATA[<PREFIX>.tar]]></c>: <c><![CDATA[tar xvf <PREFIX>.tar]]></c></item>
<item>Create a bin directory: <c>mkdir bin</c></item>
<item>Copy the VxWorks Erlang/OTP start-up script to the bin directory:
<c>cp erts-Vsn/bin/erl bin/.</c></item>
<item>Copy the example start scripts to the bin directory:
<c>cp releases/R42A/*.boot bin/.</c></item>
</list>
<p>If you use VxWorks nfs mounting facility to mount the Solaris
file system, this installation may be directly used. An other
possibility is to copy the installation to a local VxWorks DOS
file system, from where it is used.
</p>
</section>
<section>
<title>OS Specific Functionality/Information</title>
<p>There are a couple of files that are unique to the VxWorks
distribution of Erlang/OTP, these files are described here.
</p>
<list type="bulleted">
<item>README - this files has some information on VxWorks
specifics that you are advised to consult. This includes the
latest information on what parts of OTP are included in the
VxWorks distribution of Erlang/OTP. If you want us to
include more parts, please contact us to discuss
this.</item>
<item>erts-Vsn/bin/resolv.conf - A resolver configuration EXAMPLE file.
You have to edit this file.</item>
<item>erts-Vsn/bin/erl - This is an EXAMPLE start script for VxWorks.
You have to edit this file to suit your needs.</item>
<item>erts-Vsn/bin/erl_io - One possible solution to the problem
of competing Erlang and VxWorks shell. Contains the function
'start_erl' called by the erl script. Also contains the
function 'to_erl' to be used when connecting to the Erlang
shell from VxWorks' shell.</item>
<item>erts-Vsn/bin/erl_exec - Rearranges command line arguments
and starts Erlang.</item>
<item>erts-Vsn/bin/vxcall - Allows spawning of standard VxWorks
shell functions (which is just about any function in the
system...) from open_port/2. E.g. open_port({spawn, 'vxcall
func arg1 arg2'}, []) will cause the output that 'func arg1,
arg2' would have given in the shell to be received from the
port.</item>
<item>erts-Vsn/bin/rdate - Set the time from a networked host,
like the SunOS command. Nothing Erlang-specific, but nice
if you want date/0 and time/0 to give meaningful values (you
also need a TIMEZONE environment setting if GMT isn't
acceptable). For example: <c>putenv "TIMEZONE=CET::-60:033002:102603"</c> sets central european
time.</item>
<item>erts-Vsn/src - Contains source for the above files, and
additionally config.c, driver.h, preload.c and
reclaim.h. Reclaim.h defines the interface to a simple
mechanism for "resource reclamation" that is part of the
Erlang runtime system - may be useful to "port program" writers (and
possibly others). Take careful note of the caveats listed in
the file!</item>
</list>
</section>
<section>
<title>Starting Erlang</title>
<p>Start (and restart) of the system depends on what file system
is used. To be able to start the system from a nfs mounted
file system you can use VxWorks start script facility to run a
start script similar to the example below. Note that the
Erlang/OTP start-up script is run at the end of this script.
</p>
<code type="none"><![CDATA[
# start.script v1.0 1997/09/08 patrik
#
# File name: start.script
# Purpose: Starting the VxWorks/cpu32 erlang/OTP
# Author: [email protected]
# Resides in: ~tornado/wind/target/config/ads360/
#
# Set shell prompt
#
shellPromptSet("sauron-> ")
#
# Set default gateway
#
hostAdd "router-20","150.236.20.251"
routeAdd "0","router-20"
#
# Mount /home from gandalf
#
hostAdd "gandalf","150.236.20.16"
usergroup=10
nfsAuthUnixSet("gandalf", 452, 10, 1, &usergroup)
nfsMount("gandalf", "/export/home", "/home")
#
# Load and run rdate.o to set correct date on the target
#
ld < /home/gandalf/tornado/wind/target/config/ads360/rdate.o
rdate("gandalf")
#
# Setup timezone information (Central European time)
#
putenv "TIMEZONE=CET::-60:033002:102603"
#
# Run the Erlang/OTP start script
#
cd "/home/gandalf/tornado/wind/target/erlang_cpu32_R42A/bin"
<erl
]]></code>
</section>
</chapter>
|