8 Configuration and Startup


Entries in sys_conf.h control many system parameters, and these range from specifying the device drivers that are built into the system to the maximum number of tasks that can be active concurrently. You can easily change the pSOSystem configuration by editing the sys_conf.h file. The sys_conf.h file resides in the application directory. This chapter documents all the system parameters that sys_conf.h controls.

The pSOSystem OS is a scalable operating system, so a large part of its functionality exists in software component building blocks. Not all of the software components are necessarily built into a pSOSystem configuration. This depends on the capabilities you require.

Each software component has its own configuration and startup requirements. By default, the pSOSystem startup code takes care of these requirements. However, because you may want to customize the startup code, this chapter describes configuration and startup elements.

8.1 Overview

Software components are the basic building blocks of the pSOSystem OS. Each component has an associated configuration table, which the component uses to obtain all of its configurable parameters. Figure 8-1 shows the relationships between the various elements that the components use to find their parameters, data areas, and so on.

Figure 8-1 The Node Configuration Table

The Node Anchor is the single, fixed point of reference for all the installed software components in the system. This anchor is a critical link because each component is code and data position-independent and thus depends on the anchor to locate its configuration information.

In the pSOSystem environment, the global symbol anchor serves as the Node Anchor. An anchor is a pointer to the Node configuration table.

The configuration table portion of the pSOSystem Programmer's Reference describes each configuration table entry. Since the pSOSystem startup code sets up these tables, you do not at first need to understand all table entries. However, as you experiment with changing the pSOSystem configuration, the information becomes more useful.

8.1.1 sys_conf.h: the System Configuration File

During system startup, the pSOSystem OS initializes all the required component configuration tables. The code that initializes the configuration tables resides in shared, read-only files in directory PSS_ROOT/configs/std. The source code in these files contains many lines whose compilation depends on values defined in the application's pSOSystem configuration file, sys_conf.h. sys_conf.h determines:

Each of the sample applications supplied with the pSOSystem OS includes a sys_conf.h file that contains configuration values appropriate for that application. Section 8.2, ``sys_conf.h" explains all of the values you must define in sys_conf.h.

8.1.2 Parameter Storage and the Startup Dialog

Sometimes the only differences between pSOSystem configurations are the values of the parameters defined in sys_conf.h. For this reason, the pSOSystem OS allows you to place some of the sys_conf.h parameter values in a dedicated storage area in the target's memory. An optional startup dialogue can be built into the operating system that allows review and possible modification of these parameters when the pSOSystem OS initializes itself. The pSOSystem Boot ROMs are an example of a pSOSystem OS and application that uses the startup dialog.

8.2 sys_conf.h

This section describes all of the parameters that sys_conf.h must supply. Parameter definitions in sys_conf.h have the form of C macro definitions, as in the following example:

#define SC_PROBE         YES    /* pROBE+ processor services) */
#define KC_NTASK         20     /* Max. of 20 active tasks */

You may find it helpful to refer to the example sys_conf.h files in the pSOSystem sample applications while reading this section.

To improve the readability of sys_conf.h, macros should be used to define the values of some of the parameters. The code in sysinit.c (and other files that include sys_conf.h) assumes the use of these macros. Therefore, sys_conf.h should contain the macro definitions in the list that follows before any of the parameter values are defined:

#define        YES     1
#define        NO      0
#define        USE_RARP0
#define        DBG_SA  1
#define        DBG_XS  2
#define        DBG_XN  3
#define        DBG_AP  4
#define        STORAGE 5
#define        SYS_CONF6

8.2.1 Storage and Dialog Parameters

The following four parameters determine the fashion in which many of the other parameters in sys_conf.h are used:

PARAMETER POSSIBLE VALUES
SC_SD_PARAMETERS STORAGE, SYS_CONF
SC_STARTUP_DIALOG NO, YES
SC_BOOT_ROM NO, YES
SD_STARTUP_DELAY any decimal integer
SE_DEBUG_MODE DBG_SA, DBG_XS, DBG_XN, STORAGE, DBG_AP

The values of all of the parameters in sys_conf.h whose names begin with "SD_" can be determined either by the definitions given in sys_conf.h or by the data in the target's parameter storage area. For example, if SC_SD_PARAMETERS is set to SYS_CONF, the values in sys_conf.h are always used for the SD_ parameter values. If SC_SD_PARAMETERS is STORAGE, then the pSOSystem OS attempts to use the values in the target's parameter storage area for the SD_ variables, and the values in sys_conf.h become default values to use if the parameter storage area has either not been initialized or has been corrupted.

If SC_SD_PARAMETERS is defined as STORAGE, you can enable the startup dialog by setting SC_STARTUP_DIALOG to YES. The startup dialog executes on the target system at startup time and allows you to view and optionally change the parameter values in the storage area. If the dialog is enabled, SD_STARTUP_DELAY specifies the number of seconds the dialog waits for input before it boots the system.

SE_DEBUG_MODE determines how the system operates according to the following possible values:

DBG_SA
Boot the pROBE+ debugger in stand-alone mode.
DBG_AP
Boot the pROBE+ debugger in stand-alone mode, and do a silent startup.
DBG_XS
Boot into the pROBE+ debugger and wait for the host debugger through a serial connection.
DBG_XN
Boot into the pROBE+ debugger and wait for the host debugger through a network connection.
STORAGE
Use the mode found in the parameter storage area (DBG_SA, DBG_XS, DBG_XN, or DBG_AP). If a valid mode is not found, use DBG_SA.

8.2.2 Operating System Components

The following parameters indicate which components are in the system:

PARAMETER POSSIBLE VALUES
SC_PSOS YES, NO
SC_PSOSM YES, NO
SC_PROBE YES, NO
SC_PROBE_DISASM YES, NO
SC_PROBE_CIE YES, NO
SC_PROBE_QUERY YES, NO
SC_PROBE_DEBUG YES, NO
SC_PHILE YES, NO
SC_PREPC YES, NO
SC_PNA YES, NO
SC_PRPC YES, NO
SC_PSE YES, NO
SC_PTLI YES, NO
SC_PMONT YES, NO

A component parameter set to YES causes the component to be built into the system. Note that it is erroneous to set both SC_PSOS and SC_PSOSM to YES.

The target-resident pROBE+ debugger consists of five sub-modules, which you may include in the executable image. To include any of these modules, the system must have the processor services module. To include the processor services module, set SC_PROBE to YES. SC_PROBE_DISASM and SC_PROBE_QUERY are the enables for the disassembler and query services, respectively, and both of these are optional. You should set one or both of SC_PROBE_CIE and SC_PROBE_DEBUG to YES. If you plan to use the pROBE+ debugger in console mode, set SC_PROBE_CIE to YES. If you plan to use the pROBE+ debugger as a back-end for the SpOTLIGHT debugger, set SC_PROBE_DEBUG to YES.

8.2.3 Serial Channel Configuration

The designation for each serial channel on a target takes the form of the channel number. Channel numbers start at 1. For example, a target with four serial channels would have channel numbers 1, 2, 3, and 4. The following parameters control the serial channels:

PARAMETER POSSIBLE VALUES
SC_APP_CONSOLE 1, 2, 3, and so on
SD_DEF_BAUD 4800, 9600, 19200, and so on
SC_PROBE_CONSOLE 1, 2, 3, and so on
SC_RBUG_PORT 0,1,2,3, and so on
SC_NumNon_pSOSChan any integer

SC_APP_CONSOLE specifies the serial channel number used for the application's console channel. The console channel can be changed dynamically by making a de_cntrl() call to the serial driver.

When the pSOSystem serial driver (drivers/console.c) is called, the minor device number specifies the serial channel to use. For example, if the major device number specified by SC_DEV_SERIAL is 3, a de_write() call to device 3.3 writes the output on serial channel 3. Minor device number 0 is remapped to the application console channel, whose initial value is specified by SC_APP_CONSOLE. (See Section 8.2.7, ``I/O Devices" for a description of SC_DEV_SERIAL and the pSOSystem Programmer's Reference for information on major device numbers.)

SC_DEF_BAUD specifies the default baud rate for the serial channels. A de_cntrl() call can be used to change the baud rate dynamically.

SC_PROBE_CONSOLE specifies the serial channel number that the pROBE+ debugger should use for its console channel. (The pROBE+ console displays output and receives commands.)

SC_RBUG_PORT specifies the serial channel (starting from 1) that should be used if the pROBE+ debugger will communicate with the SpOTLIGHT host debugger over a serial channel.

Note that the value of SC_APP_CONSOLE and SC_RBUG_PORT should not be the same. If the pROBE+ debugger will communicate with the SpOTLIGHT host debugger over a serial channel (specified by SC_RBUG_PORT), it needs the exclusive use of this channel for this purpose. If SC_APP_CONSOLE is set to the same value as SC_RBUG_PORT, then any de_write() or printf() calls made by the application will disrupt the communication between pROBE+ and SpOTLIGHT. If the target board has only one serial channel that must be multiplexed between application output and pROBE+/SpOTLIGHT communication, the application can use the db_output() command to redirect its output to SpOTLIGHT's IN/OUT window.

SC_NumNon_pSOSChan is the number of non-pSOS users of serial channels. These are users that will be initiated before pSOS, such as pROBE+. Note: These channels will not be closed on a soft reset.

8.2.4 LAN Configuration

The following parameters control the configuration of the LAN interface:

PARAMETER EXPLANATION
SD_LAN1 YES enables the LAN interface, and NO disables it
SD_LAN1_IP IP address to use for LAN interface (alternatively, SD_LAN1_IP can be set to USE_RARP, in which case the pSOSystem OS uses RARP to obtain the IP address)
SD_LAN1_SUBNET_MASK Subnet mask to use for LAN interface, or 0 for none

If the target board has a LAN interface, you can enable it by setting SD_LAN1 to YES. If SD_LAN1 is NO, the values of the other SD_LAN1_* parameters are unused.

8.2.5 Shared Memory Configuration

The following parameters control the configuration of the shared memory network interface:

PARAMETER EXPLANATION
SD_SM_NODE Node number for this node
SD_NISM YES to enable SMNI, otherwise NO
SD_NISM_IP IP address of this node
SD_NISM_DIRADDR Bus (global) address of SMNI directory structure
SC_NISM_BUFFS Number of buffers
SC_NISM_LEVEL 2 for downloaded system, 1 for ROM-resident
SD_NISM_SUBNET_MASK Subnet mask to use for SMNI
SD_KISM ES to enable SMKI, otherwise NO
SD_KISM_DIRADDR Bus (global) address of SMKI directory structure

On systems that support it, you can configure a shared memory network interface (SMNI) for use with the pNA+ network manager and/or a shared memory kernel interface (SMKI) for use with the pSOS+m kernel. In either case, you need to assign a node number to each target board in the system. Node numbers are integers and start at 1. The SD_SM_NODE setting must be the same as the board's node number.

SD_NISM must be either YES or NO. It depends on whether a shared memory network interface is included. If SD_NISM is YES, then SD_NISM_IP, SD_NISM_SUBNET_MASK, and SC_NISM_BUFFS specify the interface's IP address, subnet mask, and number of buffers, just as the corresponding parameters do for the LAN interface.

SD_NISM_DIRADDR is the bus address of a system-wide directory structure which must be accessible to all nodes in the system.

SC_NISM_LEVEL should be set to 2 - with one exception. For the pSOSystem Boot ROMs, it should be 1 to allow a second, downloaded shared memory system to share the same directory structure with the one the Boot ROMs use.

To configure a shared memory kernel interface (SMKI), set SD_KISM to YES and SD_KISM_DIRADDR to the bus address of the system-wide directory structure.

Usually, the directory structures are placed in one of the boards' dual-ported RAM areas. Each pSOSystem board-support package reserves some space for these structures. Refer to Appendix B to find the locations for these structures.

8.2.6 Miscellaneous Parameters

The parameters in the following list do not depend on each other.

PARAMETER EXPLANATION
SC_RAM_SIZE Amount of target memory to use (0 for all)
SD_DEF_GTWY_IP IP address of default gateway node(0 for none)
SD_VME_BASE_ADDR VMEbus address of a board's dual-ported RAM

Normally, the pSOSystem OS uses all of the unassigned memory on a board for dynamic allocation (Region 0). You can override this by setting SC_RAM_SIZE to a nonzero value. If you do, the pSOSystem OS does not touch any memory beyond SC_RAM_SIZE bytes. This is useful when building a Boot ROM because it allows you to make most of the board's RAM available for downloaded code.

SD_DEF_GTWY_IP specifies the default gateway for the pNA+ network manager to use for packet routing. The default gateway is explained in the Boot ROM section of the pSOSystem Programmer's Reference. Note that if SC_PNA is NO, SD_DEF_GTWY_IP is meaningless.

SD_VME_BASE_ADDR specifies the base address of the target board's dual-ported memory on the VMEbus. This parameter is meaningless on non-VME target boards.

8.2.7 I/O Devices

The following parameters control the configuration of the I/O devices:

PARAMETER EXPLANATION
SC_DEV_SERIAL Major device number of serial driver
SC_DEV_TIMER Major dev. number of periodic tick timer
SC_DEV_RAMDISK Major dev. number of RAM disk (0 for none)
SC_DEV_SCSI Major dev. number of SCSI driver (0 for none)
SC_DEV_TFTP Major device number of TFTP pseudo-driver (0 for none)
SC_DEVMAX Maximum major dev. number in system
SC_DEV_SCSI_TAPE Major dev. number for SCSI bus, tape device
SC_DEV_OTCP Major dev. number for TCP/IP for OpEN
SC_IP Major device number for IP for Open
SC_ARP Major device number for ARP for Open
SC_TCP Major device number for TCP for Open
SC_UDP Major device number for UDP for Open
SC_RAW Major device number for RAW for Open
SC_LOOP Major device number for LOOP for Open
SC_DEV_SOSI Major device number for OSI for OpEN

To include a device in the system, you must specify a major device number for it. The major device number determines the device's slot in the pSOS+ I/O switch table. To leave a device driver out of the system, use 0 or NO for the major number.

Note the following:

You should include the following lines in sys_conf.h after the SC_DEV_* definitions:

#define    DEV_SERIAL              (SC_DEV_SERIAL << 16)
#define    DEV_TIMER               (SC_DEV_TIMER << 16)
#define    DEV_RAMDISK             (SC_DEV_RAMDISK << 16)
#define    DEV_SCSI                (SC_DEV_SCSI << 16)
#define    DEV_SCSI_TAPE           (SC_DEV_SCSI_TAPE << 16)
#define    DEV_TFTP                (SC_DEV_TFTP << 16)

8.2.8 Component Configuration Parameters

As explained in Section 8.1, ``Overview", the values of many configuration table entries are controlled by #define statements in sys_conf.h. The forthcoming subsections list the parameters that #define statements can control. The configuration tables section of the pSOSystem Programmer's Reference describes these parameters. (Note that the names of the configuration table entries shown in this Programmer's Reference section are in lower-case, and the corresponding sys_conf.h parameters are in upper-case. For example, fc_nbuf in the pHILE+ configuration table is controlled by FC_NBUF in sys_conf.h.)

Although most of the component configuration table entries are determined by sys_conf.h, others are not because sys_conf.h cannot specify them. For example, kc_code in the pSOS+ configuration table contains the starting address of the pSOS+ kernel, but since this is determined by where the linker places the pSOS+ kernel, sys_conf.h cannot specify the address.

8.2.8.1 pSOS+, pSOS+m Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pSOS+ configuration table:

PARAMETER EXPLANATION
KC_RN0USIZE Region 0 unit size
KC_NTASK Max. number of tasks
KC_NQUEUE Max. number of message queues
KC_NSEMA4 Max. number of semaphores
KC_NMSGBUF Max. number of message buffers
KC_NTIMER Max. number of timers
KC_NLOCOBJ Max. number of local objects
PARAMETER EXPLANATION
KC_TICKS2SEC Clock tick interrupt frequency
KC_TICKS2SLICE Time slice quantum, in ticks
KC_SYSSTK pSOS+ system stack size (bytes)
KC_ROOTSSTK ROOT supervisor stack size
KC_ROOTUSTK ROOT user stack size
KC_ROOTMODE ROOT initial mode
KC_STARTCO Callout at task activation
KC_DELETECO Callout at task deletion
KC_SWITCHCO Callout at task switch
KC_FATAL Fatal error handler address
KC_ROOTPRI ROOT initial priority

The following parameters in sys_conf.h control the values of the corresponding entries in the Multiprocessor configuration table:

PARAMETER EXPLANATION
MC_NGLBOBJ Size of global object table on each node
MC_NAGENT Number of RPC agents in this node
MC_FLAGS Operating mode flags
MC_ROSTER Callout address for user-roster change
MC_KIMAXBUF Maximum length of KI packet buffer
MC_ASYNCERR Error callout address for async. calls

8.2.8.2 pROBE+ Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pROBE+ configuration table:

PARAMETER EXPLANATION
TD_BRKTRAP Instruction break trap number
TD_FLAGS Initial flag settings
TD_DBGPRI Debugger task priority

8.2.8.3 pHILE+ Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pHILE+ configuration table:

PARAMETER EXPLANATION
FC_LOGBSIZE Block size (base-2 exponent)
FC_NBUF Number of cache buffers
FC_NMOUNT Max. number of mounted volumes
FC_NFCB Max. number of opened files per system
FC_NCFILE Max. number of opened files per task
FC_MSDOS MS-DOS volume mount flag

8.2.8.4 pREPC+ Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pREPC+ configuration table:

PARAMETER EXPLANATION
LC_BUFSIZ I/O buffer size
LC_NUMFILES Max. number of open files per task
LC_WAITOPT Wait option for memory allocation
LC_TIMEOPT Timeout option for memory allocation
LC_SSIZE Size of print buffer

8.2.8.5 pNA+ Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pNA+ configuration table:

PARAMETER EXPLANATION
NC_NNI Size of pNA+ NI Table
NC_NROUTE Size of pNA+ Routing Table
NC_NARP Size of pNA+ ARP table
NC_DEFUID Default User ID of a task, used for NFS
NC_DEFGID Default Group ID of a task, used for NFS
NC_HOSTNAME Host name of the node
NC_NHENTRY Number of Host table entries
NC_NSOCKETS Number of sockets on the system
NC_NDESCS Number of socket descriptors/task
NC_MBLKS Number of message blocks on the system
NC_BUFS_0 Number of 0 length buffers
NC_BUFS_128 Number of 128-byte buffers
NC_BUFS_1024 Number of 1k-byte buffers
NC_BUFS_2048 Number of 2k-byte buffers
SE_MAX_PNA_NC_BUFS Maximum number of NC_BUFS types

8.2.8.6 pSE+ Configuration Table Parameters

The following parameters in sys_conf.h control the values of the corresponding entries in the pSE+ configuration table:

PARAMETER EXPLANATION
NBUFS_0 Number of 0 length buffers
NBUFS_32 Number of 32 byte buffers
NBUFS_64 Number of 64 byte buffers
NBUFS_128 Number of 128 byte buffers
NBUFS_256 Number of 256 byte buffers
NBUFS_512 Number of 512 byte buffers
NBUFS_1024 Number of 1K-byte buffers
NBUFS_2048 Number of 2K-byte buffers
NBUFS_4096 Number of 4K-byte buffers
SE_MAX_PSE_STRBUFS Maximum number of stream buffer types
SE_MAX_PSE_MODULES Maximum number of streams modules
SE_DATA_SIZE Size of pSE+ data area (must be at least 3K)
SE_TASK_PRIO Priority for pSE+ task
SE_STACK_SIZE Stack size for pSE+ task
SE_DEF_UID Default user id
SE_DEF_GID Default group id
SE_N_FDS Max. number of system-wide stream descriptors
SE_N_TASKFDS Max. number of per-task stream descriptors
SE_N_LINKS Max. number of multiplexing links
SE_N_TIMEOUTS Max. number of timeout requests
SE_N_BUFCALLS Max. number of bufcall requests
SE_N_QUEUES Number of queues
SE_N_MBLKS Reserved for future use, must be 0

8.2.8.7 OpEN Configuration Table Parameters

The following parameters in sys_conf.h control the configuration values for TCP/IP OpEN:

PARAMETER EXPLANATION
Network Layer (IP):
OTCP_IPMAX Maximum number of open IP device
OTCP_IPNINTERFACES Maximum number of network interfaces
OTCP_IPNROUTES Maximum number of routing table entries
ARP:
OTCP_ARPMAX Maximum number of open ARP device
OTCP_ARPNINTERFACES Maximum number of ARP interfaces
OTCP_ARPNENTRIES Maximum number of ARP table entries
TCP:
OTCP_TCPMAX Maximum number of open TCP devices UDP
OTCP_UDPMAX Maximum number of open UDP devices RAW
OTCP_RAWMAX Maximum number of open RAW devices LOOP
OTCP_LOOPMAX Maximum number of open LOOP devices

8.2.8.8 General Serial Block Configuration Parameters

The following parameters in sys_conf.h control the allocation of buffers for the General Serial Block buffer manager. These buffers are used by various drivers that use the DISI interface. See the Interfaces and Drivers section of the Programmer's Reference Manual for information on DISI.

PARAMETER EXPLANATION
GS_BUFS_0 Number of 0 length buffers
GS_BUFS_32 Number of 32 byte buffers
GS_BUFS_64 Number of 64 byte buffers
GS_BUFS_128 Number of 128 byte buffers
GS_BUFS_256 Number of 256 byte buffers
GS_BUFS_512 Number of 512 byte buffers
GS_BUFS_1024 Number of 1 Kbyte buffers
GS_BUFS_2048 Number of 2 Kbyte buffers
GS_BUFS_4096 Number of 4 Kbyte buffers
SE_MAX_GS_BUFS Maximum number of stream buffer types
GS_MBLKS 300 Number of message blocks

A routine called GSblkSetup sets up the Global Serial message and data blocks. GSblkSetup uses the values given for #defines in sys_conf.h in the application directory.

Each application may have a different need for a particular size buffer, The need depends on the size of the message the application sends.

Although the code can use a zero-length block, the serial drivers currently have no use for GS_BUFS_0.

The parameter GS_MBLKS tells GSblkSetup how many message block headers to allocate.

Set GS_MBLKS to the total number of data blocks represented by the total number of buffers allocated in the preceding list. If the driver attaches user-supplied data buffers to a message block header, add an additional amount for these as necessary. For example, the pSOSystem terminal driver needs additional message block headers for user-supplied buffers.

Although the code can use a message block that does not have a data buffer attached to it, the serial drivers currently have no use for a header-only message block.

8.2.8.9 Loader Configuration Parameters

The following parameters in sys_conf.h control the configuration for Loader. See the System Services section of the Programmer's Reference Manual for more information on Loader.

PARAMETER EXPLANATION
LD_MAX_LOAD Maximum number of active loads
LD_COFF_MODULE Load COFF object-load-module
LD_SREC_MODULE Load SREC object-load-module

8.2.8.10 pMONT Configuration Parameters

The following parameters in sys_conf.h control pMONT configuration.

PARAMETER EXPLANATION
PM_CMODE 1 = networking, 2 = serial
PM_DEV Major.Minor device number for serial channel if used
PM_BAUD Baud rate for serial channel
PM_TRACE_BUFF if 0, the address of trace buffer is allocated by pSOSystem OS
PM_TRACE_SIZE Size of trace buffer
PM_TIMER Second timer for finer time within data collection

8.3 Adding Drivers to the System

To add drivers to the pSOS+ I/O driver table, edit drv_conf.c in the working directory. This file contains a function called SetUpDrivers(). SetUpDrivers() calls InstallDriver() to install each driver in the I/O table.

If you want to add a driver, you should add an InstallDriver() call to SetUpDrivers(). The parameters passed to InstallDriver() are the major device number, the pointers to the init, open, close, read, write, and ioctl functions for the driver, and the two reserved entries in the pSOS+ I/O switch table. For example, to add a driver as major device 6 (which may have only init and read calls - just as an example), you would add the following to SetUpDrivers() in sysinit.c:

InstallDriver(6, DriverInit, NULLF, NULLF, DriverRead, NULLF, NULLF, 0, 0);

where NULLF is a macro in sysinit.c defined as a null function pointer.

Network interfaces are added in a manner similar to that of pSOS+ drivers. drv_conf.c also contains a routine called SetUpNi(), which calls InstallNI() to install each network interface in the pNA+ initial interface table. The parameters to InstallNI() are documented in drv_conf.c.

8.4 Customizing the System Startup Sequence

Because the startup code we supply with the pSOSystem OS performs the required initialization and startup, the topics in this section are important only if you modify the pSOSystem startup code or write your own startup code. This section documents the initialization and startup requirements of the individual software components.

The following checklist shows the required items for a typical pSOSystem-based system:

In a ROM-based system, most of these items reside in ROM. For a RAM-based system or a system that is under test or integration, some of the items may be loaded into RAM either by the user's Boot module or the pROBE+ System Debug/Analyzer. Furthermore, in a memory-mapped system especially, it is possible to dynamically load the application tasks or drivers at run time.

Figure 8-2 System Startup Sequences

Figure 8-2 on page 8-21 shows the possible startup sequences. Typically, power-on or reset passes control to the user- supplied Boot Code, which performs any necessary initialization and self-test. It should also set up the required configuration environment for the software components in the system. The configuration environment consists of the Node Anchor, the Node configuration table, and the other component configuration tables. You can completely set up this environment now or else allow the startup sequence to proceed incrementally. During debug, for example, you might set up the configuration environment just enough to let the pROBE+ debugger take over and execute. If the pROBE+ debugger is present, the Boot Code should pass control to it. The pROBE+ debugger can then be used to download other items on the checklist and start execution of the pSOS+ application. You can start the pSOS+ kernel in one of the following ways:

j START_of_PSOS + 0x40;

Note that this assumes the CPU is in the supervisor state. If this is not the case, you must set the system call vector to point to this pSOS+ startup address and use the syscall instruction to enter it.

Upon entry, pSOS+ startup first uses the Node Anchor to locate the pSOS+ configuration table. The pSOS+ kernel then takes a segment of memory from the beginning of memory Region 0 for its data area. Within this area, it uses the bottom part for its key data structures. The next memory segment goes to the system stack. Above the system stack, the pSOS+ kernel builds the required number of TCBs, QCBs, SCBs, MGBs, TMCBs, and the Object Tables.

Next, the pSOS+ kernel checks the Node configuration table. If other run-time components are present, the pSOS+ kernel locates and automatically calls those components' Startups to allow them to set up and initialize.

The last step in pSOS+ startup is to create and activate the 'IDLE' system daemon task and the user 'ROOT' task. Startup then dispatches ROOT, which takes over and executes.

The pSOS+ kernel treats any error it encounters during startup as a fatal error. For a discussion of fatal error handling, see pSOSystem System Concepts. Startup error codes and their meaning are in Appendix A of the pSOSystem Programmer's Reference.





psos_support@isi.com

Copyright © 1996, Integrated Systems, Inc. All rights reserved.