From 84adefa331c4159d432d22840663c38f155cd4c1 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 20 Nov 2009 14:54:40 +0000 Subject: The R13B03 release. --- system/doc/embedded/Makefile | 103 +++++ system/doc/embedded/book.xml | 43 ++ system/doc/embedded/embedded_nt.xml | 84 ++++ system/doc/embedded/embedded_solaris.xml | 734 +++++++++++++++++++++++++++++++ system/doc/embedded/intro.xml | 95 ++++ system/doc/embedded/make.dep | 14 + system/doc/embedded/note.gif | Bin 0 -> 1539 bytes system/doc/embedded/part.xml | 50 +++ system/doc/embedded/starting.xml | 249 +++++++++++ system/doc/embedded/target.xml | 414 +++++++++++++++++ system/doc/embedded/vme_problems.xml | 61 +++ system/doc/embedded/vxworks.xml | 193 ++++++++ system/doc/embedded/warning.gif | Bin 0 -> 1498 bytes system/doc/embedded/xmlfiles.mk | 22 + system/doc/embedded/xntp.xml | 75 ++++ 15 files changed, 2137 insertions(+) create mode 100644 system/doc/embedded/Makefile create mode 100644 system/doc/embedded/book.xml create mode 100644 system/doc/embedded/embedded_nt.xml create mode 100644 system/doc/embedded/embedded_solaris.xml create mode 100644 system/doc/embedded/intro.xml create mode 100644 system/doc/embedded/make.dep create mode 100644 system/doc/embedded/note.gif create mode 100644 system/doc/embedded/part.xml create mode 100644 system/doc/embedded/starting.xml create mode 100644 system/doc/embedded/target.xml create mode 100644 system/doc/embedded/vme_problems.xml create mode 100644 system/doc/embedded/vxworks.xml create mode 100644 system/doc/embedded/warning.gif create mode 100644 system/doc/embedded/xmlfiles.mk create mode 100644 system/doc/embedded/xntp.xml (limited to 'system/doc/embedded') diff --git a/system/doc/embedded/Makefile b/system/doc/embedded/Makefile new file mode 100644 index 0000000000..5e68917fc2 --- /dev/null +++ b/system/doc/embedded/Makefile @@ -0,0 +1,103 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2009. All Rights Reserved. +# +# 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. +# +# %CopyrightEnd% +# +# +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include $(ERL_TOP)/erts/vsn.mk +#VSN=$(SYSTEM_VSN) + +APPLICATION=otp-system-documentation +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/doc/embedded + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- +XML_PART_FILES = part.xml + +include xmlfiles.mk + +XML_CHAPTER_FILES=$(EMBEDDED_CHAPTER_FILES) + +TOPDOCDIR=.. + +BOOK_FILES = book.xml + +GIF_FILES = + +PS_FILES = + +XML_FILES = \ + $(BOOK_FILES) $(XML_CHAPTER_FILES) \ + $(XML_PART_FILES) + +# ---------------------------------------------------- + +HTML_FILES = \ + $(XML_PART_FILES:%.xml=%.html) + +HTMLDIR = ../html/embedded + + +HTML_UG_FILE = $(HTMLDIR)/users_guide.html + + +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- +XML_FLAGS += +DVIPS_FLAGS += + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- +docs: html + +local_docs: PDFDIR=../../pdf + +html: $(GIF_FILES) $(HTML_UG_FILE) + +debug opt: + +clean clean_docs: + rm -rf $(HTMLDIR) + rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) + rm -f errs core *~ + +# ---------------------------------------------------- +# Release Target +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_docs_spec: docs +# $(INSTALL_DIR) $(RELEASE_PATH)/pdf +# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf + $(INSTALL_DIR) $(RELSYSDIR) + $(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \ + $(RELSYSDIR) + +release_spec: + + diff --git a/system/doc/embedded/book.xml b/system/doc/embedded/book.xml new file mode 100644 index 0000000000..7dc43e36bf --- /dev/null +++ b/system/doc/embedded/book.xml @@ -0,0 +1,43 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Embedded Systems + Kenneth Lundin + + + + +
+ + + Embedded Systems + + + + + + + + +
+ diff --git a/system/doc/embedded/embedded_nt.xml b/system/doc/embedded/embedded_nt.xml new file mode 100644 index 0000000000..8e594b1951 --- /dev/null +++ b/system/doc/embedded/embedded_nt.xml @@ -0,0 +1,84 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Windows NT + Kenneth Lundin + Kenneth Lundin + + + + 1997-11-25 + PA2 + embedded_nt.xml +
+

This chapter describes the OS specific parts of OTP which relate + to Windows NT. +

+ +
+ Introduction +

A normal installation of NT 4.0, with service pack 4 or later, + is required for an embedded Windows NT running OTP.

+
+ +
+ Memory Usage +

RAM memory of 96 MBytes is recommended to run OTP on NT. + A system with less than 64 Mbytes of RAM is not recommended.

+
+ +
+ Disk Space Usage +

A minimum NT installation with networking needs 250 MB, and + an additional 130 MB for the swap file.

+
+ +
+ Installation +

Normal NT installation is performed. No additional application + programs are needed, such as Internet explorer or web server. Networking + with TCP/IP is required.

+ + Service pack 4 or later must be installed.

+ +
+ Hardware Watchdog +

For Windows NT running on standard PCs with ISA and/or PCI bus + there is a possibility to install an extension card with a hardware + watchdog. +

+

See also the heart(3) reference manual page in + Kernel. +

+
+
+ +
+ Starting Erlang +

On an embedded system, the erlsrv module should be used, + to install the erlang process as a Windows system service. + This service can start + after NT has booted. See documentation for erlsrv.

+
+
+ diff --git a/system/doc/embedded/embedded_solaris.xml b/system/doc/embedded/embedded_solaris.xml new file mode 100644 index 0000000000..93532da8e6 --- /dev/null +++ b/system/doc/embedded/embedded_solaris.xml @@ -0,0 +1,734 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Embedded Solaris + Fredrik Tillman + + ETX/B/SFP/TILLMAN:96-001 + + + 2000-10-17 + B + embedded_solaris.xml +
+

This chapter describes the OS specific parts of OTP which relate + to Solaris. +

+ +
+ Memory Usage +

Solaris takes about 17 Mbyte of RAM on a system with 64 Mbyte of + total RAM. This leaves about 47 Mbyte for the applications. If + the system utilizes swapping, these figures cannot be improved + because unnecessary daemon processes are swapped out. However, + if swapping is disabled, or if the swap space is of limited + resource in the system, it becomes necessary to kill off + unnecessary daemon processes. +

+
+ +
+ Disk Space Usage +

The disk space required by Solaris can be minimized by using the + Core User support installation. It requires about 80 Mbyte of + disk space. This installs only the minimum software required to + boot and run Solaris. The disk space can be further reduced by + deleting unnecessary individual files. However, unless disk + space is a critical resource the effort required and the risks + involved may not be justified.

+
+ +
+ Installation +

This section is about installing an embedded system. + The following topics are considered, +

+ + +

Creation of user and installation directory,

+
+ +

Installation of embedded system,

+
+ +

Configuration for automatic start at reboot,

+
+ +

Making a hardware watchdog available,

+
+ +

Changing permission for reboot,

+
+ +

Patches,

+
+ +

Configuration of the OS_Mon application.

+
+
+

Several of the procedures described below require expert + knowledge of the Solaris 2 operating system. For most of them + super user privilege is needed. +

+ +
+ Creation of User and Installation Directory +

It is recommended that the Embedded Environment is run by an + ordinary user, i.e. a user who does not have super user + privileges. +

+

Throughout this section we assume that the user name is + otpuser, and that the home directory of that user is, +

+
+        /export/home/otpuser
+

Furthermore, we assume that in the home directory of + otpuser, there is a directory named otp, the + full path of which is, +

+
+        /export/home/otpuser/otp
+

This directory is the installation directory of the + Embedded Environment. +

+
+ +
+ Installation of an Embedded System +

The procedure for installation of an embedded system does + not differ from that of an ordinary system (see the + Installation Guide), + except for the following: +

+ + +

the (compressed) tape archive file should be + extracted in the installation directory as defined above, + and,

+
+ +

there is no need to link the start script to a + standard directory like /usr/local/bin.

+
+
+
+ +
+ Configuration for Automatic Start at Boot +

A true embedded system has to start when the system + boots. This section accounts for the necessary configurations + needed to achieve that. +

+

The embedded system and all the applications will start + automatically if the script file shown below is added to the + /etc/rc3.d directory. The file must be owned and + readable by root, and its name cannot be arbitrarily + assigned. The following name is recommended, +

+
+        S75otp.system
+

For further details on initialization (and termination) + scripts, and naming thereof, see the Solaris documentation. +

+
+#!/bin/sh
+#  
+#  File name:  S75otp.system
+#  Purpose:    Automatically starts Erlang and applications when the 
+#              system starts
+#  Author:     janne@erlang.ericsson.se
+#  Resides in: /etc/rc3.d
+#
+
+if [ ! -d /usr/bin ]
+then                    # /usr not mounted
+        exit
+fi
+
+killproc() {            # kill the named process(es)
+        pid=`/usr/bin/ps -e |
+             /usr/bin/grep -w $1 |
+             /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
+        [ "$pid" != "" ] && kill $pid
+}
+
+# Start/stop processes required for Erlang
+
+case "$1" in
+'start')
+        # Start the Erlang emulator
+        #
+        su - otpuser -c "/export/home/otpuser/otp/bin/start" &
+        ;;
+'stop')
+        killproc beam
+        ;;
+*)
+        echo "Usage: $0 { start | stop }"
+        ;;
+esac
+

The file /export/home/otpuser/otp/bin/start referred to + in the above script, is precisely the script start + described in the section Starting Erlang below. The + script variable OTP_ROOT in that start script + corresponds to the example path +

+
+        /export/home/otpuser/otp
+

used in this section. The start script should be edited + accordingly. +

+

Use of the killproc procedure in the above script could + be combined with a call to erl_call, e.g. +

+
+        $SOME_PATH/erl_call -n Node init stop
+

In order to take Erlang down gracefully see the + erl_call(1) reference manual page for further details + on the use of erl_call. That however requires that + Erlang runs as a distributed node which is not always the + case. +

+

The killproc procedure should not be removed: the + purpose is here to move from run level 3 (multi-user mode with + networking resources) to run level 2 (multi-user mode without + such resources), in which Erlang should not run. +

+
+ +
+ Hardware Watchdog +

For Solaris running on VME boards from Force Computers, + there is a possibility to activate the onboard hardware + watchdog, provided a VME bus driver is added to the operating + system (see also Installation Problems below). +

+

See also the heart(3) reference manual page in + Kernel. +

+
+ +
+ Changing Permissions for Reboot +

If the HEART_COMMAND environment variable is to be set + in the start script in the section, Starting Erlang, and if the value shall be set to the + path of the Solaris reboot command, i.e. +

+
+        HEART_COMMAND=/usr/sbin/reboot
+

the ownership and file permissions for /usr/sbin/reboot + must be changed as follows, +

+
+        chown 0 /usr/sbin/reboot
+        chmod 4755 /usr/sbin/reboot
+

See also the heart(3) reference manual page in + Kernel. +

+
+ +
+ The TERM Environment Variable +

When the Erlang runtime system is automatically started from the + S75otp.system script the TERM environment + variable has to be set. The following is a minimal setting, +

+
+        TERM=sun
+

which should be added to the start script described in + the section. +

+
+ +
+ Patches +

For proper functioning of flushing file system data to disk on + Solaris 2.5.1, the version specific patch with number + 103640-02 must be added to the operating system. There may be + other patches needed, see the release README file + /README]]>. +

+
+ +
+ Installation of Module os_sup in Application OS_Mon +

The following four installation procedures require super user + privilege. +

+ +
+ Installation + + +

Make a copy the Solaris standard configuration file for syslogd.

+ + +

Make a copy the Solaris standard configuration + file for syslogd. This file is usually named + syslog.conf and found in the /etc + directory.

+
+ +

The file name of the copy must be + syslog.conf.ORIG but the directory location + is optional. Usually it is /etc. +

+

A simple way to do this is to issue the command

+ +cp /etc/syslog.conf /etc/syslog.conf.ORIG +
+
+
+ +

Make an Erlang specific configuration file for syslogd.

+ + +

Make an edited copy of the back-up copy previously + made.

+
+ +

The file name must be syslog.conf.OTP and the + path must be the same as the back-up copy.

+
+ +

The format of the configuration file is found in the + man page for syslog.conf(5), by issuing the + command man syslog.conf.

+
+ +

Usually a line is added which should state:

+ + +

which types of information that will be + supervised by Erlang,

+
+ +

the name of the file (actually a named pipe) + that should receive the information.

+
+
+
+ +

If e.g. only information originating from the + unix-kernel should be supervised, the line should + begin with kern.LEVEL (for the possible + values of LEVEL see syslog.conf(5)).

+
+ +

After at least one tab-character, the line added + should contain the full name of the named pipe where + syslogd writes its information. The path must be the + same as for the syslog.conf.ORIG and + syslog.conf.OTP files. The file name must be + syslog.otp.

+
+ +

If the directory for the syslog.conf.ORIG and + syslog.conf.OTP files is /etc the line + in syslog.conf.OTP will look like:

+ +kern.LEVEL /etc/syslog.otp +
+
+
+ +

Check the file privileges of the configuration files.

+ + +

The configuration files should have rw-r--r-- + file privileges and be owned by root.

+
+ +

A simple way to do this is to issue the commands

+ +chmod 644 /etc/syslog.conf +chmod 644 /etc/syslog.conf.ORIG +chmod 644 /etc/syslog.conf.OTP +
+ +

Note: If the syslog.conf.ORIG and + syslog.conf.OTP files are not in the + /etc directory, the file path in the second + and third command must be modified.

+
+
+
+ +

Modify file privileges and ownership of the mod_syslog utility.

+ + +

The file privileges and ownership of the + mod_syslog utility must be modified.

+
+ +

The full name of the binary executable file is + derived from the position of the os_mon + application if the file system by adding + /priv/bin/mod_syslog. The generic full name + of the binary executable file is thus

+ /lib/os_mon-/priv/bin/mod_syslog]]> +

Example: If the path to the otp-root is + /usr/otp, thus the path to the os_mon + application is /usr/otp/lib/os_mon-1.0 + (assuming revision 1.0) and the full name of the + binary executable file is + /usr/otp/lib/os_mon-1.0/priv/bin/mod_syslog.

+
+ +

The binary executable file must be owned by root, + have rwsr-xr-x file privileges, in particular + the setuid bit of user must be set. +

+
+ +

A simple way to do this is to issue the commands

+ /lib/os_mon-/priv/bin/mod_syslog +chmod 4755 mod_syslog +chown root mod_syslog]]> +
+
+
+
+
+ +
+ Testing the Application Configuration File +

The following procedure does not require root privilege. +

+ + +

Ensure that the configuration parameters for the + os_sup module in the os_mon application + are correct.

+
+ +

Browse the application configuration file (do + not edit it). The full name of the application + configuration file is derived from the position of the + OS_Mon application if the file system by adding + /ebin/os_mon.app. +

+

The generic full name of the file is thus

+ /lib/os_mon-/ebin/os_mon.app.]]> +

Example: If the path to the otp-root is + /usr/otp, thus the path to the os_mon + application is /usr/otp/lib/os_mon-1.0 (assuming + revision 1.0) and the full name of the binary executable + file is /usr/otp/lib/os_mon-1.0/ebin/os_mon.app.

+
+ +

Ensure that the following configuration parameters are + bound to the correct values.

+
+
+ + + Parameter + Function + Standard value + + + start_os_sup + Specifies if os_sup will be started or not. + truefor the first instance on the hardware; falsefor the other instances. + + + os_sup_own + The directory for (1)the back-up copy, (2) the Erlang specific configuration file for syslogd. + "/etc" + + + os_sup_syslogconf + The full name for the Solaris standard configuration file for syslogd + "/etc/syslog.conf" + + + error_tag + The tag for the messages that are sent to the error logger in the Erlang runtime system. + std_error + + Configuration Parameters +
+

If the values listed in the os_mon.app do not suit + your needs, you should not edit that file. Instead + you should override values in a system configuration file, the full pathname of which is given + on the command line to erl. +

+

Example: The following is an example of the + contents of an application configuration file.

+

+
+          [{os_mon, [{start_os_sup, true}, {os_sup_own, "/etc"}, 
+          {os_sup_syslogconf, "/etc/syslog.conf"}, {os_sup_errortag, std_error}]}].
+
+ +
+ Related Documents +

See also the os_mon(3), application(3) and + erl(1) reference manual pages.

+
+
+ +
+ Installation Problems +

The hardware watchdog timer which is controlled by the + heart port program requires the FORCEvme + package, which contains the VME bus driver, to be + installed. This driver, however, may clash with the Sun + mcp driver and cause the system to completely refuse to + boot. To cure this problem, the following lines should be + added to /etc/system: +

+ + exclude: drv/mcp + exclude: drv/mcpzsa + exclude: drv/mcpp + + +

It is recommended that these lines be added to avoid the + clash described, which may make it completely impossible to + boot the system.

+
+
+
+ +
+ Starting Erlang +

This section describes how an embedded system is started. There + are four programs involved, and they all normally reside in the + directory /bin]]>. The only exception is + the program start, which may be located anywhere, and + also is the only program that must be modified by the user. +

+

In an embedded system there usually is no interactive shell. + However, it is possible for an operator to attach to the Erlang + system by giving the command to_erl. He is then + connected to the Erlang shell, and may give ordinary Erlang + commands. All interaction with the system through this shell is + logged in a special directory. +

+

Basically, the procedure is as follows. The program + start is called when the machine is started. It calls + run_erl, which sets things up so the operator can attach + to the system. It calls start_erl which calls the + correct version of erlexec (which is located in + /erts-EVsn/bin]]>) with the correct + boot and config files. +

+
+ +
+ Programs + +
+ start +

This program is called when the machine is started. It may + be modified or re-written to suit a special system. By + default, it must be called start and reside in + /bin]]>. Another start program can be + used, by using the configuration parameter start_prg in + the application sasl.

+

The start program must call run_erl as shown below. + It must also take an optional parameter which defaults to + /releases/start_erl.data]]>. +

+

This program should set static parameters and environment + variables such as -sname Name and HEART_COMMAND + to reboot the machine. +

+

The ]]> directory is where new release packets + are installed, and where the release handler keeps information + about releases. See release_handler(3) in the + application sasl for further information. +

+

The following script illustrates the default behaviour of the + program. +

+ /dev/null 2>&1 &]]> +

The following script illustrates a modification where the node + is given the name cp1, and the environment variables + HEART_COMMAND and TERM have been added to the + above script. +

+ /dev/null 2>&1 &]]> +

If a diskless and/or read-only client node is about to start the + start_erl.data file is located in the client directory at + the master node. Thus, the START_ERL_DATA line should look + like: +

+ +CLIENTDIR=$ROOTDIR/clients/clientname +START_ERL_DATA=${1:-$CLIENTDIR/bin/start_erl.data} +
+ +
+ run_erl +

This program is used to start the emulator, but you will not + be connected to the shell. to_erl is used to connect to + the Erlang shell. +

+ +Usage: run_erl pipe_dir/ log_dir "exec command [parameters ...]" +

Where pipe_dir/ should be /tmp/ (to_erl + uses this name by default) and log_dir is where the log + files are written. command [parameters] is executed, + and everything written to stdin and stdout is logged in the + log_dir. +

+

In the log_dir, log files are written. Each logfile + has a name of the form: erlang.log.N where N is a + generation number, ranging from 1 to 5. Each logfile holds up + to 100kB text. As time goes by the following logfiles will be + found in the logfile directory

+ +erlang.log.1 +erlang.log.1, erlang.log.2 +erlang.log.1, erlang.log.2, erlang.log.3 +erlang.log.1, erlang.log.2, erlang.log.3, erlang.log.4 +erlang.log.2, erlang.log.3, erlang.log.4, erlang.log.5 +erlang.log.3, erlang.log.4, erlang.log.5, erlang.log.1 +... +

with the most recent logfile being the right most in each row + of the above list. That is, the most recent file is the one + with the highest number, or if there are already four files, + the one before the skip. +

+

When a logfile is opened (for appending or created) a time + stamp is written to the file. If nothing has been written to + the log files for 15 minutes, a record is inserted that says + that we're still alive. +

+
+ +
+ to_erl +

This program is used to attach to a running Erlang runtime + system, started with run_erl. +

+ +Usage: to_erl [pipe_name | pipe_dir] +

Where pipe_name defaults to /tmp/erlang.pipe.N. +

+

To disconnect from the shell without exiting the Erlang + system, type Ctrl-D. +

+
+ +
+ start_erl +

This program starts the Erlang emulator with parameters + -boot and -config set. It reads data about + where these files are located from a file called + start_erl.data which is located in the ]]>. + Each new release introduces a new data file. This file is + automatically generated by the release handler in Erlang. +

+

The following script illustrates the behaviour of the + program. +

+ +#!/bin/sh +# +# This program is called by run_erl. It starts +# the Erlang emulator and sets -boot and -config parameters. +# It should only be used at an embedded target system. +# +# Usage: start_erl RootDir RelDir DataFile [ErlFlags ...] +# +ROOTDIR=$1 +shift +RELDIR=$1 +shift +DataFile=$1 +shift + +ERTS_VSN=`awk '{print $1}' $DataFile` +VSN=`awk '{print $2}' $DataFile` + +BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin +EMU=beam +PROGNAME=`echo $0 | sed 's/.*\\///'` +export EMU +export ROOTDIR +export BINDIR +export PROGNAME +export RELDIR + +exec $BINDIR/erlexec -boot $RELDIR/$VSN/start -config $RELDIR/$VSN/sys $* +

If a diskless and/or read-only client node with the + sasl configuration parameter static_emulator set + to true is about to start the -boot and + -config flags must be changed. As such a client cannot + read a new start_erl.data file (the file is not + possible to change dynamically) the boot and config files are + always fetched from the same place (but with new contents if + a new release has been installed). The release_handler + copies this files to the bin directory in the client + directory at the master nodes whenever a new release is made + permanent. +

+

Assuming the same CLIENTDIR as above the last line + should look like: +

+ +exec $BINDIR/erlexec -boot $CLIENTDIR/bin/start \\ + -config $CLIENTDIR/bin/sys $* +
+
+
+ diff --git a/system/doc/embedded/intro.xml b/system/doc/embedded/intro.xml new file mode 100644 index 0000000000..3eafffd6fa --- /dev/null +++ b/system/doc/embedded/intro.xml @@ -0,0 +1,95 @@ + + + + +
+ + 1997 + 2007 + Ericsson AB, All Rights Reserved + + + 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. + + The Initial Developer of the Original Code is Ericsson AB. + + + Erlang on embedded systems + Fredrik Tillman + + ETX/B/SFP/TILLMAN:96-001 + + + 1997-11-12 + PA1 + intro.sgml +
+

This manual is a complement to the other manuals and describes how + to install, run and maintain Erlang on an embedded system. +

+

For more informaton about how to install and start Erlang read + XXXXXXXX. +

+ +
+ Memory Usage +

Solaris takes about 17 Mbyte of RAM on a system with 64 Mbyte of + total RAM. This leaves about 47 Mbyte for the applications. If + the system utilizes swapping, these figures cannot be improved + because unnecessary daemon processes are swapped out. However, + if swapping is disabled, or if the swap space is a precious + resource in the system, it becomes necessary to kill off + unnecessary daemon processes. +

+

The following start-scripts can be deleted to + prevent unnecessary daemons from starting: +

+ + /etc/rc2.d/S72autoinstall + /etc/rc2.d/S74autofs + /etc/rc2.d/S76nscd + /etc/rc2.d/S80PRESERVE + /etc/rc2.d/S80lp + /etc/rc2.d/S88sendmail + /etc/rc2.d/S92volmgt + /etc/rc2.d/S93cacheos.finish + /etc/rc3.d/S15nfs.server + +

More information is expected from Sun on how to modify the + kernel in order to reduce the memory consumption. This will be + performed by modifying the /etc/system file.

+
+ +
+ Disk Space Usage +

The disk space required by Solaris can be minimized by using the + Core User support installation. It requires about 80 Mbyte of + disk space. This installs only the minimum software required to + boot and run Solaris. The disk space can be further reduced by + deleting unnecessary individual files. However, unless disk + space is a critical resource the effort required and the risks + involved may not be justified.

+
+ +
+ Other Issues +

Future releases of OTP will include more information on how + Solaris can be configured for use with embedded systems to get + maximum performance. Issues which will be investigated include: +

+ + how disabling swapping affects the system + how locking processes in memory may yield performance benefits. + +
+
+ diff --git a/system/doc/embedded/make.dep b/system/doc/embedded/make.dep new file mode 100644 index 0000000000..9949a3ac96 --- /dev/null +++ b/system/doc/embedded/make.dep @@ -0,0 +1,14 @@ +# ---------------------------------------------------- +# >>>> Do not edit this file <<<< +# This file was automaticly generated by +# /home/otp/bin/docdepend +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# TeX files that the DVI file depend on +# ---------------------------------------------------- + +book.dvi: book.tex embedded_nt.tex embedded_solaris.tex \ + part.tex vxworks.tex + diff --git a/system/doc/embedded/note.gif b/system/doc/embedded/note.gif new file mode 100644 index 0000000000..6fffe30419 Binary files /dev/null and b/system/doc/embedded/note.gif differ diff --git a/system/doc/embedded/part.xml b/system/doc/embedded/part.xml new file mode 100644 index 0000000000..abedce46d6 --- /dev/null +++ b/system/doc/embedded/part.xml @@ -0,0 +1,50 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Embedded Systems User's Guide + Kenneth Lundin, Fredrik Tillman + UAB/F (Kenneth Lundin) + + UAB/F (Kenneth Lundin) + + 2000-10-17 + C + +
+ +

This manual describes the issues that are specific + for running Erlang on an embedded system. + It describes the differences in installing and starting + Erlang compared to how it is done for a non-embedded system. +

+

Note that this is a supplementary document. You still need to + read the Installation Guide. +

+

There is also target architecture specific information in + the top level README file of the Erlang distribution.

+
+ + + +
+ diff --git a/system/doc/embedded/starting.xml b/system/doc/embedded/starting.xml new file mode 100644 index 0000000000..ddeaeb8bdf --- /dev/null +++ b/system/doc/embedded/starting.xml @@ -0,0 +1,249 @@ + + + + +
+ + 19962009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Starting an Embedded System + Martin Björklund + Bjarne Däcker + + Bjarne Däcker + + 1997-10-17 + D + starting.sgml +
+ +
+ Introduction +

This chapter describes how an embedded system is started. + There are four programs involved, and they all normally reside + in the directory /bin]]>. The only + exception is the program start, which may be located + anywhere, and also is the only program that must be modified by + the user. +

+

In an embedded system there usually is no interactive shell. + However, it is possible for an operator to attach to the + Erlang runtime system by giving the command to_erl. He is + then connected to the Erlang shell, and may give ordinary Erlang + commands. All interaction with the system through this shell is + logged in a special directory. +

+

Basically, the procedure is as follows. The program + start is called when the machine is started. It calls + run_erl, which sets things up so the operator can attach + to the system. It calls start_erl which calls the + correct version of erlexec (which is located in + /erts-EVsn/bin]]>) with the correct + boot and config files. +

+
+ +
+ Programs + +
+ start +

This program is called when the machine is started. It may + be modified or re-written to suit a special system. By + default, it must be called start and reside in + /bin]]>. Another start program can be + used, by using the configuration parameter start_prg in + the application sasl.

+

The start program must call run_erl as shown below. + It must also take an optional parameter which defaults to + /bin/start_erl.data]]>. +

+

This program should set static parameters and environment + variables such as -sname Name and HEART_COMMAND + to reboot the machine. +

+

The ]]> directory is where new release packets + are installed, and where the release handler keeps information + about releases. See release_handler(3) in the + application sasl for further information. +

+

The following script illustrates the default behaviour of the + program. +

+ /dev/null 2>&1 &]]> +

The following script illustrates a modification where the + node is given the name cp1, and the environment variables + HEART_COMMAND and TERM have been added to the + above script. +

+ /dev/null 2>&1 &]]> +

If a diskless and/or read-only client node is about to start the + start_erl.data file is located in the client directory at + the master node. Thus, the START_ERL_DATA line should look + like: +

+ +CLIENTDIR=$ROOTDIR/clients/clientname +START_ERL_DATA=${1:-$CLIENTDIR/bin/start_erl.data} +
+ +
+ run_erl +

This program is used to start the emulator, but you will not + be connected to the shell. to_erl is used to connect to the + Erlang shell. +

+ +Usage: run_erl pipe_dir/ log_dir "exec command [parameters ...]" +

Where pipe_dir/ should be /tmp/ + (to_erl uses this name by default) and log_dir is + where the log files are written. command [parameters] is + executed, and everything written to stdin and stdout is logged in + the log_dir. +

+

In the log_dir, log files are written. Each logfile + has a name of the form: erlang.log.N where N is a + generation number, ranging from 1 to 5. Each logfile holds up to + 100kB text. As time goes by the following logfiles will be found + in the logfile directory

+ +erlang.log.1 +erlang.log.1, erlang.log.2 +erlang.log.1, erlang.log.2, erlang.log.3 +erlang.log.1, erlang.log.2, erlang.log.3, erlang.log.4 +erlang.log.2, erlang.log.3, erlang.log.4, erlang.log.5 +erlang.log.3, erlang.log.4, erlang.log.5, erlang.log.1 +... +

with the most recent logfile being the right most in each row + of the above list. That is, the most recent file is the one with + the highest number, or if there are already four files, the one + before the skip. +

+

When a logfile is opened (for appending or created) a time + stamp is written to the file. If nothing has been written to + the log files for 15 minutes, a record is inserted that says + that we're still alive. +

+
+ +
+ to_erl +

This program is used to attach to a running Erlang runtime system, + started with run_erl. +

+ +Usage: to_erl [pipe_name | pipe_dir] +

Where pipe_name defaults to /tmp/erlang.pipe.N. +

+

To disconnect from the shell without exiting the Erlang + runtime system, type Ctrl-D. +

+
+ +
+ start_erl +

This program starts the Erlang emulator with parameters + -boot and -config set. It reads data about where + these files are located from a file called start_erl.data + which is located in the ]]>. Each new release + introduces a new data file. This file is automatically + generated by the release handler in Erlang. +

+

The following script illustrates the behaviour of the + program.

+ +#!/bin/sh +# +# This program is called by run_erl. It starts +# the Erlang emulator and sets -boot and -config parameters. +# It should only be used at an embedded target system. +# +# Usage: start_erl RootDir RelDir DataFile [ErlFlags ...] +# +ROOTDIR=$1 +shift +RELDIR=$1 +shift +DataFile=$1 +shift + +ERTS_VSN=`awk '{print $1}' $DataFile` +VSN=`awk '{print $2}' $DataFile` + +BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin +EMU=beam +PROGNAME=`echo $0 | sed 's/.*\\///'` +export EMU +export ROOTDIR +export BINDIR +export PROGNAME +export RELDIR + +exec $BINDIR/erlexec -boot $RELDIR/$VSN/start -config $RELDIR/$VSN/sys $* +

If a diskless and/or read-only client node with the sasl + configuration parameter static_emulator set to true + is about to start the -boot and -config flags must be + changed. As such a client can not read a new start_erl.data + file (the file is not possible to change dynamically) the boot and + config files is always fetched from the same place (but with a new + contents if a new release has been installed). The + release_handler copies this files to the bin directory + in the client directory at the master nodes whenever a new release + is made permanent. +

+

Assuming the same CLIENTDIR as above the last line should + look like:

+ +exec $BINDIR/erlexec -boot $CLIENTDIR/bin/start @@@ + -config $CLIENTDIR/bin/sys $* +
+
+
+ diff --git a/system/doc/embedded/target.xml b/system/doc/embedded/target.xml new file mode 100644 index 0000000000..4408e6ee48 --- /dev/null +++ b/system/doc/embedded/target.xml @@ -0,0 +1,414 @@ + + + + +
+ + 19962009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + Installation of Embedded Environment + Peter Högfeldt + Peter Högfeldt + + (Peter Högfeldt + + 1997-05-26 + C + target.sgml +
+

This chapter is about installing a Embedded Environment. Solaris + 2.5.1 is the only UNIX operating system supported for embedded systems. + The following topics are considered,

+ + +

Creation of user and installation directory,

+
+ +

Installation of Embedded Environment,

+
+ +

Configuration for automatic start at reboot,

+
+ +

Making a hardware watchdog available,

+
+ +

Changing permission for reboot,

+
+ +

Patches for Solaris 2.5.1,

+
+ +

Configuration of the os_mon application.

+
+
+

Several of the procedures described below require expert knowledge of + the Solaris 2 operating system. For most of them super user privilege is + needed.

+ +
+ Creation of user and installation directory +

It is recommended that the Embedded Environment is run by an ordinary + user, i.e. a user which does not have super user privileges.

+

Throughout this chapter we assume that the user name is otpuser, + and that the home directory of that user is,

+
+/export/home/otpuser    
+

Furthermore, we assume that in the home directory of otpuser, + there is a directory named otp, the full path of which is,

+
+/export/home/otpuser/otp    
+

This directory is the installation directory of the Embedded + Environment.

+
+ +
+ Installation of Embedded Environment +

The procedure for installation of a Embedded Environment does not differ + from that of a Development Environment (see the chapter Installation of Development Environment), except for the following,

+ + +

the (compressed) tape archive file should be extracted in + the installation directory as defined above, and,

+
+ +

there is no need to link the start script to a standard directory + like /usr/local/bin.

+
+
+

The details for extracting the tape archive file is not repeated here.

+
+ +
+ Configuration for Automatic Start at Boot +

A true Embedded Environment has to start when the system boots. This + section accounts for the necessary configurations needed to achieve + that.

+

The embedded environment and all the applications will start automatically + if the script file shown below is added to the /etc/rc3.d directory. + The file must be owned and readable by root, and its name cannot + be arbitrarily assigned. The following name is recommended,

+
+S75otp.system    
+

For further details on initialization (and termination) scripts, and + naming thereof, see the file /etc/init.d/README on a Solaris + 2.5.1 system.

+
+#!/bin/sh
+#  
+#  File name:  S75otp.system
+#  Purpose:    Automatically starts Erlang and applications when the 
+#              system starts
+#  Author:     janne@erlang.ericsson.se
+#  Resides in: /etc/rc3.d
+#
+
+if [ ! -d /usr/bin ]
+then                    # /usr not mounted
+        exit
+fi
+
+killproc() {            # kill the named process(es)
+        pid=`/usr/bin/ps -e |
+             /usr/bin/grep -w $1 |
+             /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
+        [ "$pid" != "" ] && kill $pid
+}
+
+# Start/stop processes required for Erlang
+
+case "$1" in
+'start')
+        # Start the Erlang emulator
+        #
+        su - otpuser -c "/export/home/otpuser/otp/bin/start" &
+        ;;
+'stop')
+        killproc beam
+        ;;
+*)
+        echo "Usage: $0 { start | stop }"
+        ;;
+esac    
+

The file /export/home/otpuser/otp/bin/start referred to in the + above script, is precisely the script start described in the next + chapter of this guide, Starting an Embedded System. The script + variable OTP_ROOT in that start script corresponds to + the example path

+
+/export/home/otpuser/otp    
+

used in this section. The start script should be edited + accordingly.

+

Use of the killproc procedure in the above script could + be combined with a call to erl_call, e.g.

+
+  $SOME_PATH/erl_call -n Node init stop    
+

in order to take Erlang down gracefully (see the erl_call(1) + reference manual page for further details on the use of erl_call). + That however requires that Erlang runs as a distributed node which is + not always the case.

+

The killproc procedure should not be removed: the purpose is + here to move from run level 3 (multi-user mode with networking resources) + to run level 2 (multi-user mode without such resources), in which Erlang + should not run.

+
+ +
+ Hardware Watchdog +

For Solaris 2.5.1 running on VME boards from Force Computers, there + is a possibility to activate the onboard hardware watchdog, provided a + VME bus driver is added to the operating system. For further details + see the Embedded Systems documentation.

+

See also the heart(3) reference manual page in Kernel.

+
+ +
+ Changing permissions for reboot +

If the HEART_COMMAND environment variable is to be set in + the start script of the next chapter, Starting an Embedded System, and if the value shall be set to the path of the Solaris + reboot command, i.e.

+
+HEART_COMMAND=/usr/sbin/reboot    
+

the ownership and file permissions for /usr/sbin/reboot must + be changed as follows,

+
+chown 0 /usr/sbin/reboot
+chmod 4755 /usr/sbin/reboot    
+

See also the heart(3) reference manual page in Kernel.

+
+ +
+ The TERM environment variable +

When the Erlang runtime system is automatically started from the + S75otp.system script the TERM environment variable + has to be set. The following is a minimal setting,

+
+TERM=sun    
+

which should be added to the start script described in the + next chapter.

+
+ +
+ Patches for Solaris 2.5.1 +

For proper functioning of flushing file system data to disk, the + Solaris 2.5.1 specific patch with number 103640-02 must be added + to the operating system.

+
+ +
+ Installation of module os_sup in application os_mon +

The following four installation procedures requires superuser privilege.

+ +
+ Installation + + +

Make a copy the Solaris standard configuration file for syslogd.

+ + +

Make a copy the Solaris standard configuration file for syslogd. + This file is usually named syslog.conf and found in the /etc + directory.

+
+ +

The file name of the copy must be syslog.conf.ORIG but the + directory location is optional. Usually it is /etc. +

+

A simple way to do this is to issue the command

+ + cp /etc/syslog.conf /etc/syslog.conf.ORIG +
+
+
+ +

Make an Erlang specific configuration file for syslogd.

+ + +

Make an edited copy of the back-up copy previously made.

+
+ +

The file name must be syslog.conf.OTP and the path + must be the same as the back-up copy.

+
+ +

The format of the configuration file is found in the man page for + syslog.conf(5), by issuing the command man syslog.conf.

+
+ +

Usually a line is added which should state:

+ + +

which types of information that will be supervised by Erlang,

+
+ +

the name of the file (actually a named pipe) that should receive + the information.

+
+
+
+ +

If e.g. only information originating from the unix-kernel should + be supervised, the line should begin with kern.LEVEL (for the + possible values of LEVEL see syslog.conf(5)).

+
+ +

After at least one tab-character, the line added should contain + the full name of the named pipe where syslogd writes its information. The + path must be the same as for the syslog.conf.ORIG and + syslog.conf.OTP files. The file name must be syslog.otp.

+
+ +

If the directory for the syslog.conf.ORIG and + syslog.conf.OTP files is /etc the line in + syslog.conf.OTP will look like:

+ + kern.LEVEL /etc/syslog.otp +
+
+
+ +

Check the file privileges of the configuration files.

+ + +

The configuration files should have rw-r--r-- file + privileges and be owned by root.

+
+ +

A simple way to do this is to issue the commands

+ + chmod 644 /etc/syslog.conf + chmod 644 /etc/syslog.conf.ORIG + chmod 644 /etc/syslog.conf.OTP +
+ +

Note: If the syslog.conf.ORIG and + syslog.conf.OTP files are not in the /etc directory, + the file path in the second and third command must be modified.

+
+
+
+ +

Modify file privileges and ownership of the mod_syslog utility.

+ + +

The file privileges and ownership of the mod_syslog utility + must be modified.

+
+ +

The full name of the binary executable file is derived from the + position of the os_mon application if the file system by adding + /priv/bin/mod_syslog. The generic full name of the binary executable + file is thus

+ /lib/os_mon-/priv/bin/mod_syslog ]]> +

Example: If the path to the otp-root is + /usr/otp, thus the path to the os_mon application is + /usr/otp/lib/os_mon-1.0 (assuming revision 1.0) and the full name + of the binary executable file is + /usr/otp/lib/os_mon-1.0/priv/bin/mod_syslog.

+
+ +

The binary executable file must be owned by root, have + rwsr-xr-x file privileges, in particular the setuid bit of + user must be set.

+
+ +

A simple way to do this is to issue the commands

+ /lib/os_mon-/priv/bin/mod_syslog + chmod 4755 mod_syslog + chown root mod_syslog ]]> +
+
+
+
+
+ +
+ Testing the application configuration file +

The following procedure does not require root privilege.

+ + +

Ensure that the configuration parameters for the os_sup + module in the os_mon application are correct.

+
+ +

Browse the application configuration file (do not edit + it). The full name of the application configuration file is derived + from the position of the os_mon-application if the file system by adding + /ebin/os_mon.app.

+

The generic full name of the file is thus

+ /lib/os_mon-/ebin/os_mon.app. ]]> +

Example: If the path to the otp-root is /usr/otp, + thus the path to the os_mon application is /usr/otp/lib/os_mon-1.0 (assuming revision 1.0) and the full name of the binary executable file + is /usr/otp/lib/os_mon-1.0/ebin/os_mon.app.

+
+ +

Ensure that the following configuration parameters are bound to + the correct values.

+
+
+ + + Parameter + Function + Standard value + + + start_os_sup + Specifies if os_sup will be started or not. + truefor the first instance on the hardware; falsefor the other instances. + + + os_sup_own + The directory for (1)the back-up copy, (2) the Erlang specific configuration file for syslogd. + "/etc" + + + os_sup_syslogconf + The full name for the Solaris standard configuration file for syslogd + "/etc/syslog.conf" + + + error_tag + The tag for the messages that are sent to the error logger in the Erlang runtime system. + std_error + + Configuration Parameters +
+

If the values listed in the os_mon.app does not suite your + needs, you should not edit that file. Instead you should + override values in a system configuration file, the + full pathname of which is given on the command line to erl.

+

Example: The following is an example of the contents of an + application configuration file.

+

+
+[{os_mon, [{start_os_sup, true}, {os_sup_own, "/etc"}, 
+ {os_sup_syslogconf, "/etc/syslog.conf"}, {os_sup_errortag, std_error}]}].      
+
+ +
+ Related documents +

See also the os_mon(3), application(3) and erl(1) + reference manual pages.

+
+
+
+ diff --git a/system/doc/embedded/vme_problems.xml b/system/doc/embedded/vme_problems.xml new file mode 100644 index 0000000000..7f9b929875 --- /dev/null +++ b/system/doc/embedded/vme_problems.xml @@ -0,0 +1,61 @@ + + + + +
+ + 1997 + 2007 + Ericsson AB, All Rights Reserved + + + 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. + + The Initial Developer of the Original Code is Ericsson AB. + + + VME Bus Driver + Fredrik Tillman + + ETX/B/SFP/TILLMAN:96-002 + + + 1996-10-29 + PA1 + vme_problems.sgml +
+

This chapter describes the OS specific parts of OTP which relate to + the VME Bus Driver. +

+ +
+ Installation Problems +

The hardware watchdog timer which is controlled by the + heart port program requires the FORCEvme package, + which contains the VME bus driver, to be installed. This driver, + however, might clash with the Sun mcp driver and cause + the system to completely refuse to boot. To cure this problem, + the following lines should be added to /etc/system: +

+ + exclude: drv/mcp + exclude: drv/mcpzsa + exclude: drv/mcpp + + +

It is recommended that these lines be added to avoid the + clash described, which may make it completely impossible to boot + the system.

+
+
+
+ diff --git a/system/doc/embedded/vxworks.xml b/system/doc/embedded/vxworks.xml new file mode 100644 index 0000000000..52143a42e3 --- /dev/null +++ b/system/doc/embedded/vxworks.xml @@ -0,0 +1,193 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + 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. + + + + VxWorks + Patrik Winroth + + + + + 2000-10-17 + + vxworks.xml +
+

This chapter describes the OS specific parts of OTP which relate + to VxWorks. +

+ +
+ Introduction +

The Erlang/OTP distribution for VxWorks is limited to what + Switchboard requires (Switchboard is a general purpose + switching hardware developed by Ericsson). +

+

Please consult the README file, included at root level in the + installation, for latest information on the distribution. +

+
+ +
+ Memory Usage +

Memory required is 32 Mbyte. +

+
+ +
+ Disk Usage +

The disk space required is 22 Mbyte, the documentation included. +

+
+ +
+ Installation +

OTP/VxWorks is supplied in a distribution file named + .tar.gz]]>; i.e. a tar archive that is + compressed with gzip. ]]> represents the + name of the release, + e.g. otp_LXA12345_vxworks_cpu32_R42A. Assuming you are + installing to a Solaris file system, the installation is + performed by following these steps: < +

+

+ + Change to the directory where you want to install + OTP/VxWorks (]]>): ]]> + Make a directory to put OTP/VxWorks in: mkdir otp_vxworks_cpu32 (or whatever you want to call it) + Change directory to the newly created one: cd otp_vxworks_cpu32 + Copy the distribution file there from where it is located + (]]>): /.tar.gz .]]> + Unzip the distribution file: .tar.gz]]> + Untar .tar]]>: .tar]]> + Create a bin directory: mkdir bin + Copy the VxWorks Erlang/OTP start-up script to the bin directory: + cp erts-Vsn/bin/erl bin/. + Copy the example start scripts to the bin directory: + cp releases/R42A/*.boot bin/. + +

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. +

+
+ +
+ OS Specific Functionality/Information +

There are a couple of files that are unique to the VxWorks + distribution of Erlang/OTP, these files are described here. +

+ + 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. + erts-Vsn/bin/resolv.conf - A resolver configuration EXAMPLE file. + You have to edit this file. + erts-Vsn/bin/erl - This is an EXAMPLE start script for VxWorks. + You have to edit this file to suit your needs. + 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. + erts-Vsn/bin/erl_exec - Rearranges command line arguments + and starts Erlang. + 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. + 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: putenv "TIMEZONE=CET::-60:033002:102603" sets central european + time. + 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! + +
+ +
+ Starting Erlang +

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. +

+ ") + +# +# 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" + +
+
+ diff --git a/system/doc/embedded/warning.gif b/system/doc/embedded/warning.gif new file mode 100644 index 0000000000..96af52360e Binary files /dev/null and b/system/doc/embedded/warning.gif differ diff --git a/system/doc/embedded/xmlfiles.mk b/system/doc/embedded/xmlfiles.mk new file mode 100644 index 0000000000..2bdc34ae28 --- /dev/null +++ b/system/doc/embedded/xmlfiles.mk @@ -0,0 +1,22 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 2009. All Rights Reserved. +# +# 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. +# +# %CopyrightEnd% +# +EMBEDDED_CHAPTER_FILES = \ + embedded_solaris.xml \ + embedded_nt.xml \ + vxworks.xml diff --git a/system/doc/embedded/xntp.xml b/system/doc/embedded/xntp.xml new file mode 100644 index 0000000000..564b63fc7d --- /dev/null +++ b/system/doc/embedded/xntp.xml @@ -0,0 +1,75 @@ + + + + +
+ + 1997 + 2007 + Ericsson AB, All Rights Reserved + + + 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. + + The Initial Developer of the Original Code is Ericsson AB. + + + XNTP (Network Time Protocol) + ETX/B/SFP Kenneth Lundin + + 1 + ETX/B/SFP (Kenneth Lundin) + + 1996-11-20 + A + xntp.sgml +
+

This chapter describes the OS specific part of OTP that relates + to the Network Time Protocol (XNTP). +

+ +
+ XNTP for Sunos5 +

XNTP maintains a Unix system time-of-day which conforms with + the Internet standard time servers. XNTP is a complete + implementation of the Network Time Protocol, version 3 + specification as defined in RFC 1305. +

+

XNTP for use in an embedded system running Sunos5 is + delivered with OTP. The XNTP is delivered as a separate + tar file which also includes extensive documentation and + installation instructions. +

+

The following section of the introductory documentation is + included in the distribution: +

+ +

The Network Time Protocol (NTP) is used to synchronize the + time of a computer client or server to another server or + reference time source, such as a radio or satellite receiver + or modem. It provides client accuracies typically within a + millisecond on LANs and up to a few tens of milliseconds on + WANs relative to a primary server synchronized to Coordinated + Universal Time (UTC) via a Global Positioning Service (GPS) + receiver, for example. Typical NTP configurations utilize + multiple redundant servers and diverse network paths, in order + to achieve high accuracy and reliability. ...

+
+

The XNTP software is supplied without charge under the + conditions set forth in the Copyright Notice provided within the + distribution. +

+

(© David L. Mills 1992, 1993, 1994, 1995, 1996) +

+
+
+ -- cgit v1.2.3