MAINSAIL System-Specific User's Guides, Appendix A

previous   next   top   contents   index   framed top   this page unframed


A. Flavor-Dependent Features of UNIX MAINSAIL

Because different implementations of UNIX provide different facilities, MAINSAIL's view of its host processor and operating system is slightly different on each type of UNIX system. However, these differences do not ordinarily compromise the portability of MAINSAIL source programs that are not dependent on features specific to a particular UNIX variety.

A.1. Object MODULE File Name Extensions for Available UNIX Flavors

Table A–1 lists the objmod and intmod logical file name prefixes for each available UNIX flavor. The logical file names are normally mapped to actual file names with the searchpaths:

SEARCHPATH *-obj:* *2-*1.obj
SEARCHPATH *-int:* *2-*1.int

The compiler replaces the first wildcard in the pattern above with the file abbreviation for the target operating system. For example, the objmod for a MODULE FOO compiled for the SUN4 platform, where the file abbreviation is usp, before being processed as a searchpath has the name:

usp-obj:foo

which after processing becomes:

foo-usp.obj

The latter name is the one you will find in your directory by default after compiling FOO.

These searchpaths are specified in the default bootstraps and configuration files created when MAINSAIL is installed, and may be replaced if desired.

Table A–1. UNIX Intmod and Objmod File Name Prefixes
Platform Abbreviation Platform Name OS Abbreviation File Abbreviation Objmod Prefix Intmod Prefix
hppa HP's HP-UX on PA-RISC upa upa upa-obj: upa-int:
hppa64 HP's HP-UX on PA-RISC (64-bit) upa64 upa64 upa64-obj: upa64-int:
linia64 Red Hat Linux on IA-64 uia64 uia64 uia64-obj: uia64-int:
linpn Red Hat Linux on Pentium upnt upn upn-obj: upn-int:
psolrs Sun Microsystems' Solaris on Purify-Compatible SPARC upspa ups ups-obj: ups-int:
raix IBM's AIX on RISC System/6000 uirs uir uir-obj: uir-int:
solrs Sun Microsystems' Solaris on SPARC uspa usp usp-obj: usp-int:
sun4 Sun Microsystems' SunOS on SPARC uspa usp usp-obj: usp-int:

A.2. FLI Considerations for Available UNIX Flavors

Table A–2. Flavor-Dependent FLI Characteristics
Platform Abbreviation FCC MEC Foreign Starts Label Prefix
hppa TC FC yes none
hppa64 TC FC yes none
linia64 TC FC yes none
linpn TC FC yes none
psolrs TS FS yes none
raix TC FC yes "."
solrs TS FS yes none
sun4 TC FC yes "_"

Table A–2 shows flavor-dependent FLI characteristics for all supported flavors of UNIX. The meanings of the columns are:

A.2.1. MAINSAIL FLI Considerations Specific to IBM's AIX on IBM RISC System/6000

On IBM's AIX on IBM RISC System/6000, calls from MAINSAIL to procedures written in other languages, and from procedures written in other languages to MAINSAIL, are supported as long as the procedures meet the interface described in the “Interlanguage Calls” chapter of the IBM AIX Version 3 for RISC System/6000 XL C User's Guide (Document Number SC09-1259-00).

If the foreign module that defines or uses a particular foreign label is not an assembly language module, then the encoded foreign label must begin with a period. If it does not, the resulting FLI assembly language module will still successfully assemble and link with the rest of the bootstrap, but when the linked bootstrap is executed, the loader will issue the following error message (where xxx below is the name of the linked bootstrap):

Could not load program xxx
Relocation entry number 0 is defective in xxx
Error wasExec format error

A.3. Program Exceptions

A.3.1. Stack Overflow

Those UNIX MAINSAIL implementations that can do so detect stack overflow. They use the mprotect system call to create a protected page at the end of each coroutine's stack to detect stack overflow.

This system call is not available on every flavor of UNIX, and furthermore, cannot be applied to the system stack on systems where MAINSAIL shares the system stack.

A.3.2. UNIX Signals

Signals (other than arithmetic exceptions) that are ignored when MAINSAIL is invoked are ignored by MAINSAIL; arithmetic signals are always intercepted. If the signals shown in Table A–3 are not ignored, MAINSAIL catches them and issues a fatal error message if they occur. Additional signals are intercepted as described in Section A.4.

Table A–3. Standard UNIX Signals Caught by MAINSAIL
SIGBUS          SIGEMT          SIGFPE
SIGILL          SIGIOT          SIGPIPE
SIGSEGV         SIGSYS          SIGTRAP

A.3.3. BIGSUN and mainsab

On Sun BSD 4.2 UNIX and SUN-4 UNIX, the bootstrap mainsab is configured to run the BIGSUN display MODULE (user-created bootstraps must be linked with a special file, mb.o instead of m.o, if they are to run the BIGSUN display MODULE). Consult Section B.4 of the MAINEDIT User's Guide for a detailed description of BIGSUN.

A.4. Terminal Handling

UNIX terminal handling is divided into two main types: BSD and System V. The abbreviations for the platforms that fall into each of these categories are shown in Table A–4.

Table A–4. BSD and System V UNIX Flavors
BSD linia64 linpn sun4
System V hppa hppa64 psolrs raix solrs

A.4.1. BSD Systems

On BSD systems, display MODULEs use CBREAK instead of RAW mode. This has the following implications:

  1. Flow control characters (CTRL-S and CTRL-Q) are intercepted and processed by UNIX.

  2. SIGINT (usually CTRL-C) is intercepted by MAINSAIL, which asks for confirmation from /dev/tty. Responding with y<eol> terminates the MAINSAIL process; n<eol> continues. The case of the response is not significant.

  3. SIGTSTP (usually CTRL-Z or CTRL-Y) is intercepted by MAINSAIL, which resets the terminal to cooked mode, then re-raises the signal. This usually causes the MAINSAIL process to stop. If the process is resumed, it returns to the terminal mode in effect before the signal was received, and resumes execution.

  4. SIGQUIT (usually CTRL-\) is intercepted by MAINSAIL, which displays the prompt Yes? (? for help):. Among the options offered are:

    ? to see a list of options
    T to see incremental CPU times and continue
    D to dump core and exit
    E to exit without a dump
    F to see open file descriptors
    K to kill program with SEGV to see which PROCEDURE is executing (if lucky)
    B to attempt to break at next debuggable PROCEDURE
    <eol> to continue the program

  5. The K response to the prompt given when SIGQUIT is caught may be useful if MAINSAIL is not in a critical section and can handle the error without dying; it can then print a call stack or enter the debugger. This can be used to track down an infinite loop. Using this response saves you the trouble of going to another terminal, finding out the job number, and issuing a kill command to send the SEGV signal.

  6. CBREAK mode clears the parity bit on terminal input characters, so that if a terminal has a META or EDIT key (which sets the parity bit), it is ignored.

A.4.2. System V Systems

On System V systems, UNIX intercepts and processes flow control characters. SIGINT behaves as on BSD systems. There is no SIGTSTP on System V UNIX. The mode used does not interfere with parity bits, so that META or EDIT keys may be used on such systems.

A.4.3. ioctl from Programs

MAINSAIL keeps track of what it believes to be the current terminal modes. It reads the current values when MAINSAIL is initialized, and keeps track of changes by MAINSAIL system software. User programs that call ioctl may confuse MAINSAIL's terminal handling if they do not restore terminal modes before the next time MAINSAIL alters the terminal mode.

The MAINSAIL STREAMS package provides facilities for terminal control that allow programs to achieve the effect of ioctl portably without confusing the MAINSAIL runtime system. See the MAINSAIL STREAMS User's Guide for details.

A.5. MAINSAIL and Purify

MAINSAIL MODULEs can coexist with Purify, a C error-detection tool made by Rational Software Corporation. This is useful for programmers who have linked C code with a MAINSAIL bootstrap and wish to debug the C code.

The changes required to coexist with Purify have been made in the current version of MAINSAIL only for the SOLRS platform. XIDAK cannot generally make an existing non-Purify-compatible platform compatible with Purify; we must introduce a new processor, a new operating system, and a new platform, all of which are compatible with Purify. In the case of SOLRS, the Purify-compatible counterpart is the PSOLRS platform.

In order for MAINSAIL to coexist with Purify on Solaris, several SPARC registers had to be taken away from MAINSAIL's general use (Purify dedicates those registers to its own purposes), and all loads and stores in MAINSAIL code are performed by calling Purify-specific load and store functions in the bootstrap so that every MAINSAIL memory access will be visible to Purify. These changes make MAINSAIL run noticeably slower, even when Purify is not actually being run.

Note that MAINSAIL considers the Purify-compatible SPARC and non-Purify SPARC processors to be different only in the way that MAINSAIL MODULEs use registers and access memory. The same SPARC machine can run MAINSAIL MODULEs that were compiled for either a Purify-compatible SPARC or a non-Purify SPARC. However, because the register conventions used by MAINSAIL on the non-Purify SPARC and the Purify-compatible SPARC are so different, Purify-compatible and non-Purify MODULEs cannot be mixed in the same MAINSAIL session.

To cross-compile a MAINSAIL MODULE intended to run on a Purify-compatible SPARC, specify the target upspa compiler subcommand. The file abbreviation is ups for Purify-compatible SPARC UNIX (e.g., sys-ups.ilb).

A.5.1. Bootstrap-Building Instructions on PSOLRS When Running under Purify 4.2

When running under Purify Version 4.2 or later, you should build a PSOLRS bootstrap not by using m.o or f.o, but by enumerating the object files that the MAINSAIL installation script linked together to produce m.o or f.o. These files (all located on the MAINSAIL directory) are:

unixm.o unixb.o xiutil.o xisignal.o xiproc.o xiconf.o sysitf.o

for m.o, and:

unixb.o xiutil.o xisignal.o xiproc.o xiconf.o sysitf.o

for f.o.

Thus, for example, the commands required to link a bootstrap mainsa from CONF output mainsa.s are:

as -P -o mainsa.o mainsa.s
/
space/pure/purify-4.2-solaris2/purify \
    /
opt/SUNWspro/bin/cc -o mainsa mainsa.o \
    
unixm.o unixb.o xiutil.o xisignal.o xiproc.o \
    
xiconf.o sysitf.o \
    -
lsocket -lnsl

A.6. Using MAINSAIL under ClearCase on RAIX

On the RAIX platform, MAINSAIL may fail to come up under Rational's ClearCase because of a change ClearCase makes in the semantics of the stat system call. To prevent this problem, when running MAINSAIL under ClearCase, set the UNIX environment variable MSLUSESCLEARCASE to 1, e.g., with:

setenv MSLUSESCLEARCASE 1

This causes MAINSAIL to perform additional checks that avoid the problem with stat.

A.7. Note on Linux Operating System Versions

XIDAK obtained the Linux operating systems under which MAINSAIL has been tested from Red Hat, Inc.

The operating system versions under which LINPN (the Pentium version of Linux) has been tested are Red Hat Linux 6.0 (the operating system's uname command reports the kernel version number as 2.2.5-15) and Red Hat Linux 7.1 (kernel version 2.4.2-2).

The operating system version under which LINIA64 (the IA-64 version of Linux; “IA-64” refers to the architecture of the Intel Itanium processor) has been tested is Red Hat Linux 7.0.98 (the operating system's uname command reports the version number as 2.4.3-2.10.1smp).

MAINSAIL may work on other versions of Linux, but has not been tested on them.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL System-Specific User's Guides, Appendix A