You are on page 1of 40

2070 Controller

Operating System
Users Guide

December 2004
DISCLAIMER

Data and information in this manual is provided for informational purposes


only. Reference herein to any specific commercial products, process, or service
by trade name, trademark, manufacturer, or otherwise, does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the
California Department of Transportation. The views and opinions of authors
expressed herein do not necessarily state or reflect those of the California
Department of Transportation, and shall not be used for advertising or product
endorsement purposes.

2
Table of Contents

I Introduction

II. Connecting a PC to the 2070 Controller’s OS-9 Operating System

III. File and Disk Structure

IV. Basic Software Commands

V. Example usage of selected OS-9 controller commands

VI. Advanced Shell Topics

VII. Controller Startup Sequence

VIII. Loading and Deleting Controller Software

IX. Using Ethernet

X. OS-9 Error Codes

XI. Glossary

3
I. Introduction
Welcome to the software world of the 2070. Unlike it predecessor, the 170
controller, the 2070 controller uses an operating system which handles software and
hardware interaction and makes manufactures controller hardware virtually transparent to
application developers. This guide is an introduction for new users to the OS-9 operating
system. It is meant to be a primer as to how to use basic operating system commands,
how to load applications and how the controller is configured. Additionally, it also
explains the operating system memory structure and the sequence of events that occur
when the controller starts.

For more information on the Radisys/Microware OS-9 operating system, please


go to www.radisys.com and request an OS-9 evaluation CD, which contains the complete
OS-9 software documentation.

4
II. Connecting a PC to the 2070 Controller’s OS-9 Operating System
General interface with the operating system is by using a direct mode
communication cable (Shown below) running from a host computer on serial port 1 of
you PC to the C50S port of the 2070 and using program terminal emulation software such
as HyperTerminal.

2070 Connection Cable


Title:
Direct Mode DB9 Communications Cable
Between Laptop and 2070 Controller
Date: Page:
Sheet 1 of 1 MAR 2001

Once the cable is properly connected between the 2070 controller and the PC, you
are ready to begin configuring HyperTerminal to communicate between the 2070
Controller’s OS-9 operating system, and your PC.

5
A. Configuring HyperTerminal to communicate with a 2070 controller

1. Using the start menu open the HyperTerminal program

2. Select the “Hyperterm" icon

6
3. Create the name for your connection, and select the icon that you want to
represent that connection.

4. Under the “Connect using” selector, select “Direct to Com1”.

7
5. Select the baud, data bits, parity, stop bits and flow control as shown.

6. You should now be connected to the 2070. Note the lower left hand of the
screen shows “connected”.

8
7. To ensure that HyperTerminal properly displays all 2070 characters, select file
and the properties from the menu

8. After selecting the “Settings Tab”, select the “Windows Keys” functionality,
and set the terminal emulation to VT100.

9
9. Select the “ASCII Setup” button and ensure that the “Wrap lines that exceed
terminal with” is checked. Then select “OK” on the ASCII setup panel to
accept these settings.

10. Select “OK” on the “Settings” panel.

10
11. Upon exiting the program, select yes when you are asked if you want to save
the session. This will allow you to preserve your settings for future sessions.

If you need to use HyperTerminal to connect to a 2070 controller again,


you can select the icon with the name you have previously selected in step 3.

11
Upon restarting a saved session, you will be automatically connected with
the 2070.

Shown below is a typical 2070 boot-up as seen in the HyperTerminal


terminal emulator. Normally, any OS-9 shell command can now be entered at the
“$” prompt. Once communication is established, commands can be entered in a
format similar to MS-DOS.

DANGER
Never enter terminal commands while the controller is controlling an active intersection
as serious damage or injury may result

12
B. Sending files to the 2070 controller using HyperTerminal

1. On the 2070 controller type “chd /r2” to ensure your current data directory
is /r2

2. Type “kermit ri” on the 2070 controller for binary files or “kermit r” for
ASCII files.

3. Using HyperTerminal on your PC select “Transfer” and “Send File” on


the HyperTerminal Menu.

4. Ensure that the transfer protocol is “Kermit”

13
5. Select “browse” in HyperTerminal and find the file that you want to
transfer. After selecting the file, select “Open”.

6. Using HyperTerminal select “Send”.

14
You should now see the file transferring from your PC to the 2070 Controller

15
III. File and Disk Structure

A. Types of memory

The 2070 controller uses 3 different types of computer memory.

FLASH

The first of these is the flash


memory. Flash memory uses a
unique electrical architecture to Three Types of Flash /f0

allow the memory to hold its Memory Application Data


memory state without power. Boot Image

The advantage of this type SRAM /r0


of memory architecture is that it is
Database
non-volatile. This means that even
if power is removed from the Flash Write Backup

memory, stored data will remain


intact. The typical memory DRAM
retention of the flash memory for Free Memory
an un-powered controller is 10
Ramdrive /r2
years. There are unfortunately two
disadvantages to using this type of
memory.

First, although you can read data from the flash memory an infinite
number of times, it is only capable of only about 100,000 write cycles. This
means that after writing approximately 100,000 times to the flash, it will no
longer be able to accurately store new programs.

It is for this reason that we only store applications and support modules on
the flash drive. Image if we logged data to the flash. Even if we just wrote 50
bytes of intersection data just once every 15 minutes. That would mean 96 writes
to the flash drive per day, or 35,040 writes per year. In fact, in just 3 years you
would have over 105,000 writes to the flash, and the flash memory, containing the
traffic application would now be unreliable. Limiting the flash drive to
application data only, greatly increases the useful life of the 2070 Controller

Second, writing to this type of memory is very slow. As a result, a power


loss while writing to this type of memory can cause the controller to be unable to
finish writing all the necessary data before the power is lost. Depending on how
much of the file was written before power was lost, these incompletely written
files can not only cause file system corruption, but may possibly even lead to
corruption of the whole flash disk.

16
So how much flash memory do you get to store your programs? The flash
memory used in the 2070 controller has a memory size of at least 8 megabytes
and is divided into 2 sections. This first section, 1 megabyte in size, is called the
boot area and is where the basic operating system and its support modules are
stored. To eliminate the problem of the user accidentally erasing this area and
rendering the controller unusable, this area is not normally accessible to the user.
The other area of the flash memory, which is available to the user, is a minimum
of 7 megabytes in size and is formatted similar to a computer hard drive. This user
area of memory is accessible through several descriptors named /f0, /f0wp, and
/f0fmt.

/f0wp is by default the drive that the terminal user interface is set to when
the controller boots up. /f0wp means that you are connected to the flash drive in a
write protected mode. You can read everything from the flash drive while you are
in this directory, but any function which requires writing to the drive will fail.

/f0 is the same drive as the /f0wp, but it is not write protected. Using this
descriptor name will allow users to write files to the flash disk, as well as
allowing other functions which require writing to the disk such as renaming files
or changing file attributes.

/f0fmt is the same as the /f0 drive in that you can read and write to the
flash, but this descriptor also gives the additional capability of allowing the user
to be able to reformat the entire /f0 drive. Use of the format command should
only be used when absolutely necessary because reformatting the drive will
destroy any data currently existing on the /f0 drive.

SRAM

The second type of memory used in the controller is Static Random


Access Memory or SRAM. Unlike the flash memory, which can hold its memory
state without additional power, the current memory state of the SRAM is
maintained with power provided by capacitors on both the 2070 CPU board, and
in the power supply. With the CPU not connected to the power supply the
memory in the SRAM will be able to hold its memory state for 7 days. With the
power supply attached to the CPU its memory state will be preserved in excess of
30 days. Depending on the charge of the power supply capacitors the SRAM will
typically hold the memory state in excess of 60 days.

Like the flash memory, the SRAM is divided up into 2 sections. The first
is not accessible to the user and is used by the operating system to reduce the
chance of corruption during a power failure when writing to the flash memory

17
The other area of the SRAM is much like the flash memory formatted as a
user accessible disk drive. It has been given the descriptors of /r0 and /r0fmt.

/r0 is a standard read and write drive of a minimum of 512 kilobytes in


size.

/r0fmt is exactly the same as the /r0 drive, but is format enabled. Just as
with the /f0 drive, reformatting the /r0 drive will destroy any existing data.

DRAM

The last type of memory is DRAM or Dynamic Random Access Memory.


This is the free memory that all the programs are executed in, and is a minimum
of 8 megabytes in size.

In addition, a 1 megabyte section of this memory may be used as the /r2


drive for the purpose of loading programs onto the 2070 controller.

18
B. File Structure

Much like any other computer the 2070 controller uses a specific file
structure. The typical folder structure for the Flash or /f0 drive is shown below.

File Structure of /f0 Drive


(Flash Memory)
/f0
Opexec
Startup

Traffic DAT CMDS ETC SYS


Application
(Optional)

BOOTOBJS

In general only Traffic Applications, Ethernet, Controller Diagnostic Tests


and support software are stored on the flash drive. Therefore, the only time that a
user needs to write to the flash drive is when either a new application or an update
to an existing application needs to be loaded on to the controller. In the field, the
flash drive should be treated as a read only device. This greatly reduces any
chance of file corruption while the controller is in the field.

Traffic application parameters and logging files are stored on the SRAM
because it is much faster than the flash memory and has an unlimited number of
read and write cycles. Additionally, because the memory is held in its present
state for at least 30 days after power loss, there is little fear that even a lengthy
power outage will cause the stored application parameters to be lost.

19
IV. Basic Software Commands
The following is a list of the most commonly operating system commands for the
2070 controller.

attr Sets of displays file attributes


File attributes are:
d = directory
s = Single user file or directory
pe= Public execute permission
pw= Public write permission
pr= Public read permission
e = Owner execute permission
w = Owner write permission
r = Owner read permission

attr FILENAME Displays attributes of a file named FILENAME


attr –r FILENAME Sets the owner read permission of a file named
FILENAME
attr –nr FILENAME Removes the owner read permission of a file
named FILENAME

break Reboots controller


break Will cause controller to reboot

chd Changes current data directory


chd /f0 Changes directory to /f0 – Flash memory drive
chd /f0wp Changes directory to /f0 – Flash memory
drive, write protected mode
chd /r0 Changes directory to /r0 – Static Ram drive
chd /r2 Changes directory to /r2 – dynamic memory
drive

chd /f0/tscp Changes directory to the subfolder name


TSCP on the flash memory drive

copy Copies files from one location to another


copy * -w=/r0 Copies all directory files in the current
data directory to the /r0 directory
copy FILENAME –w=/r0 Copies the file named filename to the /r0
directory

del Delete a file


del FILENAME Deletes the file named FILENAME

20
deldir Deletes a directory
deldir DIRNAME Deletes the directory named DIRNAME

devs Shows the active controller devices


devs Shows the devices active on on the controller

dir Shows file in directory


dir Shows files in current data directory
dir /f0 Shows file in /f0 directory
dir –e Extended display of the current data directory

edt Terminal ASCII file editor


Editor commands space = enter new line
d = delete line
q = save and quit

edt NEW Creates new text file named NEW

format Formats a drive


format /f0fmt Reformats flash memory
format /r0fmt Reformats SRAM memory

ident - m Shows identification information for a module previously loaded


into memory
ident –m kernel Shows information about the module named
‘kernel’ currently located in free memory

iniz Initializes a device


iniz /sp1 Initializes serial port 1

kermit Send files to the controller


kermit ri Send binary files to the controller
kermit r Send ASCII files to the controller

21
kill Kill a running process
kill 7 Kill process number 7. You can find out what process
number a particular application is using by using the
‘procs‘ command

list Lists text file


list NEW lists text file named NEW

load Loads a module from a drive into the free memory


load –d MODULENAME Loads a module into memory from the
current data directory
load –d /f0/TSCP/MODULENAME Loads the module name MODULENAME
into memory from the /f0/TSCP
directory

makdir Makes a directory


makdir DIRNAME Creates the directory named DIRNAME

mdir Shows the modules loaded into the free memory


mdir Shows modules in memory
mdir –e Extended display of all modules in memory

pd Shows what data directory you are currently in


pd Shows current data directory
pd –x Shows current execution directory

procs Shows the process currently running on the controller


procs Shows process numbers of all active programs in the
controller

setime Show or set the current time


setime 05/04/03 10:21:03 Sets the operating system time to
April, 3rd 2005 at 10:21 am and 03 seconds

22
tar File collection utility
tar cvf TARFILE /f0/TARDIRECTORY/* Collects all the files in the
directory named TARDIRECTORY into a single file named TARFILE
in the current data directory
tar cvf TARFILE FILENAME1 FILENAME2 FILENAME3 Collects all three
files in the current data directory named FILENAME1, FILENAME2
and FILENAME3 into a single file named TARFILE in the current
data directory

tar xvpf TARFILE Restores the single tar file to its original
files and file locations.

tmode Shows the current serial port parameters


tmode /sp1 Shows serial port parameters on the current serial
port

xmode Shows other serial port parameters


xmode /sp1 Shows serial port parameters of serial port 1

23
V. Example usage of selected OS-9 controller commands

attr startup

$ attr startup
------wr startup

attr startup -pepre

$ attr startup -pepre


--e-rewr startup

date

$ date
March 2, 2004 Tuesday 4:59:33 pm

deldir
$ dir -e
Directory of . 14:08:23
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
0.0 04/03/01 1403 d-ewrewr 5 64 EXAMPLE

$ deldir example

Deleting directory: example


Delete, List, or Quit (d, l, or q) ? d

$ dir -e
Directory of . 14:08:45
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----

devs

$ devs
McCain 2070-1A/B 68360 OS-9/68K V3.2 (32 devices max)

Device Driver File Mgr Data Ptr Links


---------- ---------- ---------- --------- ------
sp4 scsmc scf $013fd330 2
f0wp rbftl rbf $013fcbd0 3
r0 rbram rbf $01005230 2

24
dir
$ dir
Directory of . 16:55:26
CMDS ETC SYS VAL startenet
startup

dir –e
$ dir -e
Directory of . 17:00:07
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
0.0 04/02/09 1857 d-ewrewr 4E3 1344 CMDS
0.0 04/02/18 2038 d-ewrewr 42 416 ETC
0.0 04/02/18 2038 d-ewrewr 52 96 SYS
0.0 03/09/21 1319 d-ewrewr 9 480 VAL
0.0 03/10/02 1722 ------wr D07 180 startenet
0.0 04/02/06 1232 ------wr 12 34 startup

dir /f0
$ dir /f0

Directory of /f0 17:00:56


CMDS ETC SYS VAL startenet
startup

dir /r0

$ dir /r0
Directory of /r0 17:01:40
KeyTarFile TEST chkmod chkser chktmr
dat.dat daterrorlog

dir –e /r0

$ dir -e /r0

Directory of /r0 17:03:08


Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
0.0 04/02/10 1524 -sew-ewr 10B 80 KeyTarFile
0.0 04/02/06 1754 d-ewrewr D82 128 TEST
0.0 04/02/06 1529 --e-rewr D0F 29076 chkmod
0.0 04/01/23 1821 --e-rewr 5 81920 chkser
0.0 03/09/23 1042 --e-rewr 110 36954 chktmr
0.0 03/10/22 1223 --e-rewr 10E 80 dat.dat

25
format

$ format /r0fmt

Disk Formatter
OS-9/68K V3.2 Econolite 2070-1B(68360) v.20 - 68300
------------ Format Data ------------

Fixed values:
Physical floppy size: 5 1/4"
Sector size: 256
Physical Disk capacity: 3496 sectors
(894976 bytes)
Logical Disk capacity: 0 sectors
(0 bytes)
Sector offset: 0
Track offset: 0
LSN offset: $000000
Minimum sect allocation: 4

Variables:
Recording format: FM
Track density in TPI: 48
Sector interleave offset: 1

Formatting device: /r0fmt


proceed? y
volume name: /r0
verifying media, building media bitmap...
000 020 040 060 080 0a0 0c0 0e0 100 120 140 160 180 1a0 1c0 1e0
200 220 240 260 280 2a0 2c0 2e0 300 320 340 360 380 3a0 3c0 3e0
400 420 440 460 480 4a0 4c0 4e0 500 520 540 560 580 5a0 5c0 5e0
600 620 640 660 680 6a0 6c0 6e0 700 720 740 760 780 7a0 7c0 7e0
800 820 840 860 880 8a0 8c0 8e0 900 920 940 960 980 9a0 9c0 9e0
a00 a20 a40 a60 a80 aa0 ac0 ae0 b00 b20 b40 b60 b80 ba0 bc0 be0
c00 c20 c40 c60 c80 ca0 cc0 ce0 d00 d20 d40 d60 d80 da0
quantity good $00000da8 3496 ( 894976 bytes)
quantity bad $00000000 0 ( 0 bytes)
quantity unusable $00000000 0 ( 0 bytes)
sectors verified $00000da8 3496 ( 894976 bytes)
writing root directory structure

ident –m kernel
$ ident -m kernel
Header for: kernel
Module size: $6AB8 #27320
Owner: 0.0
Module CRC: $45344F Good CRC
Header parity: $1D35 Good parity
Edition: $177 #375
Ty/La At/Rev $C01 $A000
Permission: $555 -----e-r-e-r-e-r
Exec off: $4C #76
68000 System Mod, Object Code, Sharable, System State Process

26
iniz

$ devs
McCain 2070-1A/B 68360 OS-9/68K V3.2 (32 devices max)

Device Driver File Mgr Data Ptr Links


---------- ---------- ---------- --------- ------
sp4 scsmc scf $013fd330 2
f0wp rbftl rbf $013fcbd0 3

$ iniz /r2

$ devs
McCain 2070-1A/B 68360 OS-9/68K V3.2 (32 devices max)

Device Driver File Mgr Data Ptr Links


---------- ---------- ---------- --------- ------
sp4 scsmc scf $013fd330 2
f0wp rbftl rbf $013fcbd0 3
r2 rbram rbf $01005230 1

kill
$ procs
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 0.50k 0 w 0.00 2:19 sysgo <>>>sp4
26 2 0.0 128 8.50k 0 w 0.32 1:40 shell <>>>sp4
47 26 0.0 128 5.00k 0 s 0.00 0:00 chkled <>>>sp4
49 26 0.0 128 19.25k 0 * 0.04 0:00 procs <>>>sp4

$ kill 47

$ procs
-47 Exited with Error #000:228
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 0.50k 0 w 0.00 2:19 sysgo <>>>sp4
26 2 0.0 128 8.50k 0 w 0.34 1:40 shell <>>>sp4
50 26 0.0 128 19.25k 0 * 0.03 0:00 procs <>>>sp4

makdir FILENAME

$ dir
Directory of . 14:03:36

$ makdir EXAMPLE

$ dir
Directory of . 14:03:52
EXAMPLE

$ dir -e
Directory of . 14:03:55
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
0.0 04/03/01 1403 d-ewrewr 5 64 EXAMPLE

27
mdir

$ mdir
Module Directory at 17:01:32

kernel ioman fpu init pit2070


pwr2070 rtc2070 tck2070 z85230 attr
break build cio copy csl
date dcheck deiniz del deldir
devs

mdir -e

mdir -e
Addr Size Owner Perm Type Revs Ed # Lnk Module name
-------- -------- ----------- ---- ---- ---- ----- ----- --------------
01007800 27320 0.0 0555 Sys a000 375 2 kernel
0100e2b8 5660 0.0 0555 Sys a000 37 1 ioman
0100f8d4 12848 0.0 0555 Sys a000 18 1 fpu
01012b04 402 1.0 0555 Sys 8000 51 1 init
01012c96 456 0.0 0555 Sys a000 1 1 pit2070
01012e5e 284 0.0 0555 Sys a000 1 1 pwr2070
01012f7a 1944 0.0 0555 Sys a000 1 1 rtc2070
01013712 304 0.0 0555 Sys a000 1 3 tck2070
01013842 772 0.0 0555 Sys a000 1 1 z85230
01013b46 4838 1.0 0555 Prog c001 39 0 attr
01014e2c 2756 0.0 0555 Prog c001 10 0 break
010158f0 2670 1.0 0555 Prog c001 24 0 build
0101635e 18082 1.0 0555 Trap c009 6 0 cio
0101aa00 9688 1.0 0555 Prog c001 54 0 copy
0101cfd8 47918 1.0 0555 Trap c00a 25 2 csl
01028b06 3172 1.0 0555 Prog c001 23 0 date
0102976a 9544 1.0 0555 Prog c001 35 0 dcheck
0102bcb2 3038 1.0 0555 Prog c001 22 0 deiniz
0102c890 5000 1.0 0555 Prog c001 37 0 del
0102dc18 7310 1.0 0555 Prog c001 41 0 deldir
0102f8a6 3336 1.0 0555 Prog c001 16 0 devs

pd
$ pd
/f0wp

procs

$ procs
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 18.75k 0 w 0.03 0:01 sysgo <>>>sp4
9 2 0.0 128 8.50k 0 w 0.07 0:00 shell <>>>sp4
12 9 0.0 128 19.25k 0 * 0.04 0:00 procs <>>>sp4

28
setime
$ setime
yy/mm/dd hh:mm:ss [am/pm]
Time:
March 2, 2004 Tuesday 5:00:37 pm

setime

$ setime 04/02/26 05:00:00 pm


February 26, 2004 Thursday 5:00:00 pm

tmode

tmode
/sp4
noupc bsb bsl echo lf null=0 nopause pag=24 bsp=08 del=18 eor=0D
eof=1B reprint=04 dup=01 psc=17 abort=03 quit=05 bse=08 bell=07
type=00 (par=none, cs=8, stop=1) baud=9600 xon=00 xoff=00 tabc=09
tabs=4

xmode

$ xmode /sp1
/sp1
noupc bsb bsl noecho lf null=0 nopause pag=24 bsp=08 del=18 eor=0D
eof=1B reprint=04 dup=01 psc=17 abort=03 quit=05 bse=08 bell=07
type=00 (par=none, cs=8, stop=1) baud=1200 xon=11 xoff=13 tabc=09
tabs=4

$ xmode /sp2
/sp2
noupc bsb bsl noecho lf null=0 nopause pag=24 bsp=08 del=18 eor=0D
eof=1B reprint=04 dup=01 psc=17 abort=03 quit=05 bse=08 bell=07
type=00 (par=none, cs=8, stop=1) baud=1200 xon=11 xoff=13 tabc=09
tabs=4

$ xmode /sp3
/sp3
noupc bsb bsl noecho lf null=0 nopause pag=24 bsp=08 del=18 eor=0D
eof=1B reprint=04 dup=01 psc=17 abort=03 quit=05 bse=08 bell=07
type=00 (par=none, cs=8, stop=1) baud=1200 xon=11 xoff=13 tabc=09
tabs=4

29
VI. Advanced shell topics

Running commands sequentially and concurrently


& Concurrent operator
; Sequential operator

Redirecting standard input and output


< Redirect Standard Input
> Redirect Standard Output
>> Redirect Standard Error Output

Commonly used for output redirection and used to create a


terminal shell on another serial port

& is used to allow port to run concurrently with existing


terminal shell

Creating terminal shells on other 2070 controller ports


shell <>>>/sp1 & Creates a terminal shell of serial port 1
shell <>>>/sp2 & Creates a terminal shell of serial port 2
shell <>>>/sp3 & Creates a terminal shell of serial port 3

Send output to a file


chkser >/r0/ser_test_output sends output from chkser program
into the file named ser_test_output
shell >/FILENAME Redirects terminal output to a new file
named FILENAME
shell +>/FILENAME Redirects terminal output to file named
FILENAME by appending data to the end of
the file
shell >/sp4 Redirects terminal output to serial port
4
dir>FILENAME Redirects the directory display to the
file named FILENAME

Most common device descriptors


/sp1 serial port 1
/sp2 serial port 2
/sp3 serial port 3
/sp4 serial port 4
/sp5 serial port 5
/sp6 serial port 6 (Reserved for front panel input and
output)
/sp8 serial port 8
/f0wp flash memory write protected
/f0 flash memory
/f0fmt Flash memory format enabled
/r0 SRAM memory
/r0fmt SRAM memory format enabled
/r2 DRAM memory
enet0 Ethernet

30
VII. Controller Startup Sequence
The 2070 controller, just like any other computer, starts up using a specific startup
sequence. This startup sequence allows programmers to automatically start their
application program anytime the controller is powered up. The startup sequence is shown
in the following series of flowcharts.

2070 Start Up Sequence Flow Chart

Init
Starts This flow chart
describes the
proper
operation to
the Sysgo
Init sets module
execution and data
directory
to /f0wp and sets
SYSGO as the first
Executable module

Sysgo
Starts

Sysgo sets
execution directory
to /f0wp/CMDS

YES Is Datakey NO
Present and
Valid?

Go to Sheet 2 Go to Sheet 4

Sheet 1 of 5

31
2070 Start Up Sequence Flow Chart

This flow chart


From Sheet 1 describes the
proper
operation to
the Sysgo
module

YES Is Datakey NO
Overide Byte
= to 1?

Go to Sheet 3

Sysgo forks a shell


To execute a script
on the Datakey Shell monitored by Sysgo

Sysgo forks
a shell
to /sp4

NO Any Errors YES


Executing
Script?
Is shell
running? NO
Sysgo
exits

Sheet 2 of 5

32
2070 Start Up Sequence Flow Chart

This flow chart


From Sheet 2 describes the
proper
operation to
the Sysgo
module

YES Is Datakey NO
Overide Byte
= to 2?

Go to Sheet 4

Sysgo executes an
executable module
on the Datakey Shell monitored by Sysgo

Sysgo forks
a shell
to /sp4

NO Any Errors YES


Executing
Module?
Is shell
running? NO
Sysgo
exits

Sheet 3 of 5

33
2070 Start Up Sequence Flow Chart

This flow chart


describes the
proper
From Sheet 2 or 3 operation to
the Sysgo
module

YES Is Opexec NO
Present?

Any YES
Shell monitored by Sysgo
Errors running
Opexec?
Sysgo forks
a shell
to /sp4
NO

Sysgo
exits Is shell
running? NO

Go to Sheet 4

Sheet 4 of 5

34
2070 Start Up Sequence Flow Chart

From Sheet 4

Is Startup NO
Shell monitored by Sysgo
Present?

Sysgo forks
a shell
YES to /sp4

Sysgo forks a
shell to
run Startup Is shell
running?

Does Shell monitored by Sysgo


NO YES
Startup have
errors?
Sysgo forks
a shell
to /sp4

Sysgo
exits
Is shell
running?

Sheet 5 of 5

35
As you can see from the flow charts, the startup sequence can be fairly complex.
Essentially, the controller loads a boot image which contains all of the basic operating
system modules and gives the operating system the functionality it will need to run any
other process. An example of an operating system module that it loads into memory is
the ‘dir’ module which allows you to see the files in a directory.

The controller then runs a module named “SYSGO” which is the module that
vendors use to configure how all subsequent programs will be started. When SYSGO
runs, it checks to see if there is a valid Datakey present and if finds a key and determines
that the keys data is valid, it will attempt to load a script file or a module from the key. If
there is no Datakey present, the Datakey is not valid, or there is no script file or module
stored onto the key, SYSGO will then look for a binary module specifically named
“Opexec” loaded in the /f0 directory. If that program is present SYSGO will execute that
program. If that program is not present, SYSGO will then look for and execute an ASCII
script file specifically named “Startup” in the /f0 directory. SYSGO then creates a
terminal shell which gives users the ability to access the operating system if needed.

36
VIII. Loading and Deleting Controller Software

The procedure for loading virtually any application program on the controller is
the same.

a. Connect to the controller

b. Create a directory folder on the flash drive where you want to store your
file by typing “makdir /f0/DIRECTORYNAME”

c. Change your current data directory to /r2 by using the command “chd /r2”

d. Type “kermit ri” and select the binary file or files on your PC that you
wish to transfer to the controller

e. Type “kermit r” and select the ASCII files or files on you PC that you
wish to transfer to the controller

f. Change the attributes of all the files by typing “attr * -pepre”

g. Copy the files to the flash memory by typing


“copy * -w=/f0/DIRECTORYNAME”

h. If you want the application program to start automatically when the


controller boots up, copy the application program’s startup file to the /f0
directory by the typing “copy startup -w=/f0”.

Software Loading Procedure


Flash /f0

Application Data

PC
DRAM /r0
#3 Copy From
Database
/R2 to /F0
#1 Download
From PC to /R2
SRAM
Free Memory

Ramdrive /r2

#2 Set Program(s)
Attributes

37
IX. Using Ethernet
Ethernet, unlike other ports requires the initialization of a variety of different
driver and descriptor modules. In order to facilitate the proper loading of these modules a
script named “startspf” is already loaded on the flash memory under the “SYS” directory.

To load and start Ethernet on the 2070 controller type “/f0/sys/startspf” to start the
startspf script.

Configure Ethernet

View Ethernet Information

$ ifconfig enet0
enet0: flags=8003<UP,BROADCAST,MULTICAST> mtu 1500
inet 255.191.255.222 netmask 0xff72ff47 broadcast 255.191.255.254

Change Ethernet IP address

$ ifconfig enet0 10.0.0.1

$ ifconfig enet0
enet0: flags=8003<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.0.1 netmask 0xff000000 broadcast 10.255.255.255

Change Ethernet Netmask

$ ifconfig enet0 netmask 255.255.0.0

$ ifconfig enet0
enet0: flags=8003<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.0.1 netmask 0xffff0000 broadcast 10.0.255.255

Change Ethernet broadcast address

$ ifconfig enet0 broadcast 255.255.255.0

$ ifconfig enet0
enet0: flags=8003<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.0.1 netmask 0xff000000 broadcast 255.255.255.0

38
X. Operating System Error Codes Most Often Encountered

Error Error Code Error Description


Number Sent
000:001 Process has aborted.
000:002 S$Abort Signal Keyboard quit (^E) typed.
000:003 S$Intrpt Signal Keyboard interrupt (^C) typed.
000:004 S$HangUp Signal Modem hangup.
000:032 E_SIGABRT Abort signal was received.
000:102 E$BusErr A bus trap error occured.
000:103 E$AdrErr An address trap error.
000:104 E$IllIns An illegal instruction exception occurred.
000:166 E$StkOvf System stack overflow.
000:200 E$PthFul The user’s (or system) path table is full.
000:201 E$BPNum Bad path number
000:207 E$MemFul Memory full.
000:208 E$UnkSvc Unknown service code.
000:211 E$EOF The end of file has been reached.
000:214 E$FNA File not accessible.
000:215 E$BPNam Bad pathlist specified.
000:216 E$PNNF File not found.
000:218 E$CEF Tried to create a file name that already exists.
000:221 E$MNF Module not found.
000:224 E$IPrcID Illegal process ID.
000:225 E$Param Bad parameter.
000:228 E$PrcAbt The process has been aborted.
000:232 E$BMCRC Bad module CRC.
000:234 E$NEMod Non executable module.
000:235 E$BNam Bad name.
000:236 E$BMHP Bad module header parity.
000:237 E$NoRAM No RAM available.
000:238 E$DNE The directory is not empty.
000:242 E$WP Media is write protected.
000:243 E$CRC Bad module cyclic redundancy check value.
000:244 E$Read Read error.
000:245 E$Write Write error.
000:246 E$NotRdy Device not ready.
000:247 E$Seek Seek error.
000:248 E$Full Media full.
000:255 E$Format Device is format protected.

39
XI. Glossary
ASCII file A file which uses characters which are printable. If a file can be
opened and read with notepad, it is a ASCII file

Binary file A file which is not readable using a text file editor.

* Wildcard character

Flash Memory Memory which using unique electrical architecture allows the
memory to hold its memory state without power

DRAM Memory Dynamic Random Access Memory

SRAM Memory Static Random Access Memory

Startup file ASCII file which has a series of text commands that are executed
one line at a time. It is the first file that the controller will execute
if there is no Opexec file found on the controller during the startup
sequence.

Opexec Binary file which if installed is the first executable file that the
controller will execute.

Descriptor The operating system name for a particular device. An example of


this is the descriptor for serial port 1 which is /sp1.

40

You might also like