ChorusOS 4.0 MPC8xx Target Family Guide

ChorusOS 4.0 MPC8xx Target Family Guide

This guide describes how to run the ChorusOSTM 4.0 product for the MPC8xx processor family.

Preface

How This Guide is Organized

ChorusOS 4.0 MPC8xx specific information is provided in the following major sections:

Related Books

See the ChorusOS 4.0 Installation Guide for Solaris Hosts for a description of the installation process of the ChorusOS 4.0 product on a host workstation running the SolarisTM operating environment. This document also describes how to set up a boot server running the Solaris operating environment.

See the ChorusOS 4.0 Introduction for a complete description of the ChorusOS 4.0 features.

Typographical Conventions

The following table describes the typographic changes used in this book.

Table 1-1 Typographical Conventions

Typeface or Symbol 

Meaning 

Example 

AaBbCc123

 The names of commands, files, and directories; on-screen computer output

Edit your .login file.

Use ls -a to list all files.

machine_name% you have mail.

AaBbCc123

 What you type, contrasted with on-screen computer outputmachine_name% su Password:

AaBbCc123

 Command-line placeholder: replace with a real name or value

To delete a file, type rm filename.

AaBbCc123

Book titles, new words or terms, or words to be emphasized. 

Read Chapter 6 in User's Guide.

These are called class options.

You must be root to do this.

Shell Prompts

The following table shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.

Table 1-2 Shell Prompts

Shell 

Prompt 

 C shell promptmachine_name%
 C shell superuser promptmachine_name#
 Bourne shell and Korn shell prompt$
 Bourne shell and Korn shell superuser prompt#

Ordering Sun Documents

Fatbrain.com, an Internet professional bookstore, stocks selected product documentation from Sun Microsystems, Inc.

For a list of documents and how to order them, visit the Sun Documentation Center on Fatbrain.com at http://www1.fatbrain.com/documentation/sun.

Accessing Sun Documentation Online

The docs.sun.comSM Web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://www.oracle.com/technetwork/indexes/documentation/index.html.

Obtaining Technical Support

Sun Support Access offerings are available exclusively to members of the Sun Developer Connection Program. To get free membership in the Sun Developer Connection Program, go to http://www.sun.com/developers. For more information or to purchase Sun Support Access offerings, visit: http://www.sun.com/developers/support or contact the Sun Developer Connection Program office near you.

Development Environment

The ChorusOS 4.0 product provides a host-target development environment. Applications are developed on a workstation (the host), and then downloaded and executed on a specific board (the target).

A cross development system is needed to build the applications that execute on the target board (see Section "Utilities").

SPARCTM/SolarisTM Reference Host Environments

Prerequisites for the Solaris host reference configuration are the following:

Cross Compiler

This development environment component is bundled with the ChorusOS 4.0 for MPC8xx product:

The Chorus Cross Development System is based on the Experimental GNU Compiler System egcs 1.1.2 and binutils 2.9.1 and additional patches.

Graphical Debugger

This development environment component is bundled with the ChorusOS 4.0 for MPC8xx product:

ChorusOS 4.0 Supported Features

The following table shows the ChorusOS kernel and operating system optional features that are available for the MPC8xx processor family. The availability status of a feature, can be one of:

Y

The feature is supported, and is configurable with the configurator(1CC) command, or with the ews GUI configuration tool.

Please refer to the note at the end of the table for information about specific conditions, or restrictions, for a given supported feature.

Some of the features (such as MSDOSFS, FLASH, FS_MAPPER, for example) require specific low-level drivers. These features operate only on platforms which provide these drivers.

N

The feature is not supported.

 Feature Description Feature Name Availability
 Actor management 
   Dynamic actor loading management ACTOR_EXTENDED_MNGT Y
   User-mode extension support USER_MODE Y
   Dynamic libraries DYNAMIC_LIBY [Limitation: the binaries making up the executing image of an actor (main program and dynamic libraries) must fit into a 32MB address range. Even if their total size is less than 32 MB, this is not garanteed in flat mode or for supervisor actors.]
   Compressed file management GZ_FILE Y
 Scheduling 
  POSIX round-robin scheduling class ROUND_ROBIN Y
 Memory management 
   Virtual (user and supervisor) address space VIRTUAL_ADDRESS_SPACE Y
   On-demand paging ON_DEMAND_PAGING N
 Hot restart and persistent memory 
  Hot restart HOT_RESTART Y
 Inter-thread communication 
   Semaphores SEM Y
   Event flag sets EVENT Y
   Mutual exclusion lock supporting thread priority inversion avoidance RTMUTEX Y
 Time management 
   Periodic timers TIMER Y
   Thread and actor virtual timer VTIMER Y
   Date and time of day DATE Y
   Real-time clock RTC Y
 Inter-process communication 
   Location-transparent inter-process communication IPC Y
  Remote (inter-site) IPC support IPC_REMOTE Y
  Remote IPC communications medium IPC_REMOTE_COMM Y
   Mailbox-based communications mechanism MIPC Y
   POSIX 1003.1-compliant message queues POSIX_MQ Y
   POSIX 1003.1-compliant shared memory objects POSIX_SHM Y
 LAP 
  Local name server for LAP binding LAPBIND Y
  LAP validity-check option LAPSAFE Y
 Tools support 
   Message logging LOG Y
  Profiling and benchmark support PERF Y
  System Monitoring MON Y
  System debugging DEBUG_SYSTEMY [A flashed system image configured with DEBUG_SYSTEM enabled does not boot. The DEBUG_SYSTEM feature must be disabled.]
 C_INIT 
  Basic command interpreter on target LOCAL_CONSOLE Y
  Remote shell RSH Y
 File system options 
   Named pipes FIFOFS Y
   MS-DOS file system MSDOSFS Y
  NFS client NFS_CLIENT Y
  NFS server NFS_SERVER Y
  UFS file system UFS Y
 I/O management 
   Network packet filter BPF Y
  Swap support FS_MAPPER N
  Driver for IDE disk IDE_DISK N
  /dev/mem, /dev/kmem, /dev/null, /dev/zero DEV_MEM Y
  Support for RAM disk RAM_DISK Y
  Support for FLASH media FLASH Y
  Virtual TTY VTTY Y
  Driver for SCSI disk SCSI_DISK N
 Support for IPC IOM_IPC Y
 Support for OSI IOM_OSI Y
 Networking 
  Serial link IP SLIP Y
   POSIX 1003.1g-compliant sockets POSIX_SOCKETS Y
   Point-to-point protocols PPP Y
   Local sockets and pipes AF_LOCAL Y
 Administration 
   ChorusOS statistics ADMIN_CHORUSSTAT Y
  ifconfig administration command ADMIN_IFCONFIG Y
  mount administration command ADMIN_MOUNT Y
  rarp administration command ADMIN_RARP Y
  route administration command ADMIN_ROUTE Y
  shutdown administration command ADMIN_SHUTDOWN Y
  netstat administration command ADMIN_NETSTAT Y

Libraries

The ChorusOS operating system provides the elementary libraries indicated in the following list:

ChorusOS embedded library [The libebd.a, libcx.a, libm.a and libC.a libraries have been made thread-safe in order to support multithreaded actors.]

libebd.a

ChorusOS extended library

libcx.a

C++ library 

libC.a

X11 related client libraries (not thread safe) 

libX11.a, libXaw.a, libXext.a, libXmu.a, libXt.a

Specific BSD APIs (not thread safe) 

libbsd.a

The SunRPC library 

librpc.a

The mathematical library 

libm.a

The ``embedded'' C library [Included in libebd.a]

stdc.a

The microkernel ``visu'' library [This library is provided for the sake of backwards compatibility only. It is not documented. Its use is strongly discouraged.]

visu.a

Utilities

Target Utilities

The following utilities may be run on the target ChorusOS operating system:

Host Utilities

The following utilities may be run on the host machine:

Reference Hardware

ChorusOS 4.0 targets are described in this section from three different points of view:

Reference Processors and BSPs:

This subsection describes the processors on which the ChorusOS 4.0 product can run as well as the details of the BSPs included in the delivery.

Reference Target Platforms:

This section describes all the target platforms which can be used as references in the context of Sun support contracts.

Validated Reference Targets:

This section describes the precise platforms used to run the Sun QA tests; this may be useful, in case of bugs, as a hint or guide to help in identifying issues which are closely hardware related.

Reference Processors and BSPs

The ChorusOS 4.0 system for MPC8xx supports the following processors:

The ChorusOS 4.0 system for MPC8xx supports the following reference BSP:

mpc8xxADS Reference BSP

Systems

The mpc8xxADS reference BSP supports the following boards:

Devices

The mpc8xxADS reference BSP supports the following MPC860/821 FADS on board devices:

Device Id 

ChorusOS Driver 

cpu (time base and decrementer) 

sun:powerpc-(tb,dec)-timer 

flash (FLASH memory) 

sun:bus-amd29xxx-flash 

quicc-8xx (QUICC bus) 

sun:powerpc-mpc8xx-(bus, quicc) 

quicc-8xx/smc-1 (RS232) 

sun:-smc-dbglink (console) 

quicc-8xx/smc-2 (RS232) 

sun:quicc-smc-uart 

quicc-8xx/scc-1 (Ethernet 10BT) 

sun:quicc-scc-ether 

quicc-8xx/scc-2 

not supported 

quicc-8xx/scc-3 

not supported 

quicc-8xx/scc-4 

not supported 

The mpc8xxADS reference BSP supports the following MPC823 FADS on board devices:

Device Id 

ChorusOS Driver 

cpu (time base and decrementer) 

sun:powerpc-(tb,dec)-timer 

flash (FLASH memory) 

sun:bus-amd29xxx-flash 

quicc-8xx (QUICC bus) 

sun:powerpc-mpc8xx-(bus, quicc) 

quicc-8xx/smc-1 (RS232) 

sun:-smc-dbglink (console) 

quicc-8xx/smc-2 

not supported 

quicc-8xx/scc-1 (USB) 

not supported 

quicc-8xx/scc-2 (Ethernet 10BT) 

sun:quicc-scc-ether 

Reference Target Platforms

This section describes all the target platforms which can be used as references in the context of Sun support contracts.

MPC821/823 FADS (Motorola/SPS)

Type:

Evaluation/Development Board

Processors:

MPC821/823 (50 Mhz)

Main memory:

16-32 MB

Devices:

Asynchronous serial ports (38.4 Kbaud), 10BaseT Ethernet, Timers, Flash memory (AMD 29040 chip)

Host debugger:

mpc8bug v1.5 (via ADI Port)

MPC860 FADS (Motorola/SPS)

Type:

Evaluation/Development Board

Processor:

MPC860 PowerQUICC (50 Mhz)

Main memory:

16-32 MB

Devices:

Asynchronous serial ports (38.4 Kbaud), 10BaseT Ethernet, Timers, Flash memory (AMD 29040 chip)

Host debugger:

mpc8bug v1.5 (via ADI Port)

Validated Reference Targets

This section describes the precise platforms used to run the Sun QA tests.

How to Build and Boot a System Image on the Target

Building a ChorusOS 4.0 System Image

The following procedure assumes that the ChorusOS 4.0 product has already been correctly installed on the host workstation. See the ChorusOS 4.0 Installation Guide for Solaris Hosts.

  1. Create and change to a build directory where you will build system images:


    $ mkdir build_dir
    $ cd build_dir
    
  2. Set an environment variable to use with the configure(1CC) command as a shortcut to the base directory.

    For example:

    Set the environment variable... 

    To the family-specific product directory. The default value is... 

    DIR

    /opt/SUNWconn/SEW/4.0/chorus-mpc860 

  3. Make sure your PATH has been set correctly to include the directory install_dir/4.0/chorus-mpc860/tools/host/bin, where the default install_dir is /opt/SUNWconn/SEW. Also make sure that your PATH includes /usr/openwin/bin, which contains the imake utility.

  4. Configure the build directory, using the configure(1CC) command:

    If you are building from a binary distribution:


    $ configure -b $DIR/kernel \ 
    $DIR/os \ 
    $DIR/tools \ 
    -s $DIR/src/nucleus/bsp/drv \ 
    $DIR/src/nucleus/bsp/powerpc \ 
    $DIR/src/nucleus/bsp/powerpc/mpc8xxADS \ 
    $DIR/src/iom
    

    Note -

    The above command configures the build directory to include components installed during a "Default Install". It does not include optional components, such as the X library or code examples, that you may choose to install separately on Solaris host workstations. For example, in order to include everything in your build environment:


    $ configure -b $DIR/kernel \ 
    $DIR/os \ 
    $DIR/opt/X11 \ 
    $DIR/tools \ 
    -s $DIR/src/nucleus/bsp/drv \ 
    $DIR/src/nucleus/bsp/powerpc \ 
    $DIR/src/nucleus/bsp/powerpc/mpc8xxADS \ 
    $DIR/src/iom \ 
    $DIR/src/opt/examples
    

    If you are building from the source distribution, see the ChorusOS 4.0 Production Guide.

    As a result of configuration, build_dir now contains a Makefile, which is used to generate the build environment, and a Paths file, which specifies paths to files required by and created in the build environment.

  5. Generate the build environment:


    $ make
    
  6. Build a system image:


    $ make chorus
    

    The resulting system image file is located in the build directory, build_dir and is called chorus.RAM.


    Note -

    You can also make a smaller system image that includes only the operating system kernel:


    $ make kernonly
    

Placing the System Image on the Boot Server

See the ChorusOS 4.0 Installation Guide for Solaris Hosts for instructions on how to configure the boot server.

  1. Copy the system image to the boot server.

    For example, on a Solaris host workstation:


    $ rcp chorus.RAM boot_server:/tftpboot
    
  2. Verify that everyone has at least read access to the system image on the boot server.

    For example:


    $ rlogin boot_server
    Password: password_for_user
    $ ls -l /tftpboot/chorus.RAM
    -rwxr-xr-x   1 user    group     1613824 Dec 15 17:33 chorus.RAM*
  3. (Optional) While logged in to the boot server, create a configuration file for the target.

    For a target system with IP address 129.157.173.199 using a boot server with IP address 129.157.173.144, the configuration file contains the following:

    AUTOBOOT=YES
    BOOTFILE=chorus.RAM
    BOOTSERVER=129.157.173.144

    The configuration file is named /tftpboot/819DADC7.ChorusOS.4.0, which is constructed from the target system IP address 129.157.173.199 as a concatenation of the following:

    • 129 in decimal translates to 81 in hexadecimal

    • 157 in decimal translates to 9D in hexadecimal

    • 173 in decimal translates to AD in hexadecimal

    • 199 in decimal translates to C7 in hexadecimal

    • (optional) .ChorusOS.4.0 identifies the release, and is appended to the concatenation of the IP address expressed in hexadecimal.


    Note -

    The system first attempts to find the configuration file with the .ChorusOS.4.0 extension. If it fails to find one, however, it attempts to find a configuration file without the .ChorusOS.4.0 extension.


How to Boot the Target System Using Motorola's mpc8bug Host Debugger

Booting with the mpc8bug Host Debugger

The following procedure concerns mpc8xx FADS target systems reference platforms.

  1. Install Motorola's ADI host debugger (mpc8bug) on the boot host.

    The MPC8XX ADS Software(MPC8bug v 1.5) package contains the mpc8bug monitoring tool, configuration files for all reference targets, and documentation explaining how to install and use the tool.

    See the mpc8bug installation manual for details about installation.

  2. Append a "ChorusOS load" macro to the .mpctcl.cfg configuration file.

    The following TCL macro should be appended at the end of the .mpctcl.cfg file that is provided as part of the mpc8bug package:

    a chload reset :h \; load \$1 \; rms der decie 0 \; rms der extie 0 \; rms der prie 0 \;
    rms der sysie 0 \; rms der trie 0 \; rms der mcie 0 \; rms der itlbmse 0 \;
    rms der dtlbmse 0 \; rms der itlbere 0 \; rms der dtlbere 0 \; go

    The above rms der xx 0 commands allow the ChorusOS kernel to handle the coresponding exceptions.

  3. Connect the Host ADI and Target Debug ports.

    The MPC8xx[F]ADS board must be installed and configured to operate in Host Controlled configuration mode via its ADI port. Therefore, you must plug an ADI board into one of the SBus or ISA slots of the boot host and connect to the MPC8xx[F]ADS through a 37-pin flat cable.

    See the section "Installation Instructions" in the MPC8xx[F]ADS User's Manual for details about installing the ADI board and configuring the target to boot from the Debug port.

    Once this is done, you can start the mpc8bug monitor utility on the boot host as follows:

  4. Connect the target system and boot system RS232 ports.

    Connect the target system RS232 port on SMC1 to the boot system serial port for the ChorusOS debug agent link and system console.

  5. Restart the target system.

  6. Start the mpc8bug monitor:


    $ mpc8bug ADI ADS
    

    Where:

    • ADI is the number, from 0 to 3, of the SBus expanstion slot for the ADI board on the SPARCstation host system, or the address of the ADI card divided by 0x100 for a PC/AT host.

    • ADS is the ADI address, from 0 to 3, of the MPC8xx[F]ADS target board, as determined by the ADDR switches on the DS1 Dip-Switch of the MPC8xx[F]ADS board.

    When started, the mpc8bug monitor automatically executes the commands included in the configuration files:


    mpc8bug version 1.5  May 18 98
    Copyright 1998 Motorola, Inc.  All Rights Reserved.
    
     Initializing memory controller and UPM for 50MHZ
      DRAM delay set to 60ns
      DRAM size set to 16Mbytes
    Executing .mpctcl.cfg file from the current directory.
    Executing .mpc8xx.cfg file from the current directory.
    Executing .mpc860.cfg file from the current directory.
    Executing .mpcsdram.cfg file from the current directory.
    f860Bug> 

    Make sure the MPC8xx[F]ADS hardware is in a working state by running the diagnostic tests T1, T2, T3 and T4 that are provided by the mpc8bug monitor.

    See the mpc8bug documentation for details about using mpc8bug and associated diagnostic programs.

  7. Load the system image through mpc8bug:


    f860Bug> chload chorus.RAM
       ( reset :h ; load chorus.RAM ; rms der decie 0 ; rms der extie 0 ; rms der prie 0 ;
    rms der sysie 0 ; rms der trie 0 ; rms der mcie 0 ; rms der itlbmse 0 ; rms der dtlbmse 0 ;
    rms der itlbere 0 ; rms der dtlbere 0 ; go ) 
     Initializing memory controller and UPM for 50MHZ
      DRAM delay set to 60ns
      DRAM size set to 16Mbytes
    Loading ELF file . . .
    Entry point set to 001cf000
    Loading section 1 (.ChorusO) : 001ce000 bytes at 00004000 
    Heap start address set to 00000001
    No symbol table
    r3 and r5 are set to 0
      Use Ctrl-C to abort execution !

    The following messages are displayed on the target system console:


    ..... Booting Chorus .....
    
    ChorusOS r4.0.0 for PowerPC - Motorola MPC8xx[F]ADS
    Copyright (c) 1999 Sun Microsystems, Inc. All rights reserved.
     
    Kernel modules : CORE SCHED_FIFO SEM MIPC IPC_L MEM_PRM KDB TICK MON ENV ETIMER
    LOG LAPSAFE MUTEX EVENT UI DATE PERF TIMEOUT LAPBIND DKI 
    MEM: memory device 'sys_bank' vaddr 0x7ec22000 size 0x1ce000
    /cpu: sun:powerpc-(timebase,dec)-timer driver started
    /quicc-8xx: sun:powerpc-mpc8xx-(bus,quicc) driver started
    /quicc-8xx/smc-2: sun:quicc-smc-uart driver started
    /quicc-8xx/scc-1: sun:quicc-scc-ether driver started
    /quicc-8xx/scc-1: Ethernet address 08:00:3e:00:00:06
    /quicc-8xx/on-board-flash: error -- wrong (unsupported) CHIP/VENDOR ID
    /flash-emul: started as 'One bank of AMD29F040x4 (64k erase block)'
    DATE: warning -- svDeviceLookup(rtc) failed (-7)
    IOM: SOFTINTR DISABLED (-31). Using an Interrupt thread
    IOM Init cluster space from: 0x7ebff000 to: 0x7ec1f800 [65 items of size: 2048]
    IOM Init io-buf pool from: 0x7ec1f850 to: 0x7ec1fd70 [8 items of size: 164]
    IOM Init raw io-buffer pool from: 0x7ec1fd70 to: 0x7ec211f0 [32 items of size: 164]
    Copyright (c) 1992-1998 FreeBSD Inc.
    Copyright (c) 1982, 1986, 1989, 1991, 1993
            The Regents of the University of California.  All rights reserved.
    
    max disk buffer space = 0x10000
    /rd: sun:ram--disk driver started
    /quicc-8xx/on-board-flash: error -- wrong (unsupported) CHIP/VENDOR ID
    C_INIT: started
    C_INIT: /image/sys_bank mounted on /dev/bd00
    C_INIT: found /image/sys_bank/sysadm.ini
    C_INIT: executing start-up file /image/sys_bank/sysadm.ini
    bpf: ifeth0 attached
    IOM: ifnet ifeth0 bound to device /quicc-8xx/scc-1
    bpf: lo0 attached
    C_INIT: Internet Address: 129.157.173.199
    ifeth0: flags=88437<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
            inet 129.157.173.199 netmask 0xffff0000 broadcast 129.157.255.255
            ether 08:00:3e:00:00:06 
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
            inet 127.0.0.1 netmask 0xff000000 
    C_INIT: rshd started

How to Boot the Target System from Flash Memory Using bootMonitor

In order to boot the target from flash memory you must perform the following procedures.

Creating a bootMonitor Image

See bootMonitor(1CC) for details about how bootMonitor works.

  1. Create a build directory where you will build a bootMonitor image:


    $ mkdir bootmon
    $ cd bootmon
    

    Note that this build directory is different from the directory where you build system images.

  2. Configure the bootMonitor build directory based on the binary distribution:


    $ configure -b $DIR/kernel \ 
    $DIR/os \ 
    $DIR/tools \ 
    -s $DIR/src/nucleus/bsp/drv \ 
    $DIR/src/nucleus/bsp/powerpc \ 
    $DIR/src/nucleus/bsp/powerpc/mcp8xxADS \ 
    $DIR/src/iom
    
  3. Generate the build environment:


    $ make
    
  4. Edit the special bootmon/conf/mini profile so that it reads:

    #
    #	Mini Profile
    #
    
    #
    #	Kernel features
    #
    -set USER_MODE=false
    -set VIRTUAL_ADDRESS_SPACE=false
    -set SEM=false
    -set EVENT=false
    -set MONITOR=false
    -set TIMER=false
    -set DATE=false
    -set RTC=false
    -set PERF=false
    -set IPC=false
    -set MIPC=false
    -set LAPBIND=true # Change this from 'false' to 'true'
    -set LAPSAFE=true # Change this from 'false' to 'true'
    -set MON=false
    -set LOG=false
  5. Configure the build environment for bootMonitor:


    $ configurator -p conf/mini
    $ configurator -set BOOT_MODE=ROM
    $ configurator -setenv ETHER_ADDR=xx:xx:xx:xx:xx:xx
    

    As you enter the commands above, replace xx:xx:xx:xx:xx:xx with the target system Ethernet address.

  6. Build a bootMonitor image:


    $ make bootMonitor
    

    The resulting system image file is located in the build directory, bootmon and is called bootMonitor.ROM.

Flashing the Target System with the bootMonitor Image
  1. Restart the target system.

  2. Start the mpc8bug tool. See Step 6 for details.

  3. Use the loadf command to flash the bootMonitor:


    f860Bug> reset :h ; loadf full_path/bootMonitor.ROM 0x100000
     Initializing memory controller and UPM for 50MHZ
      DRAM delay set to 60ns
      DRAM size set to 4Mbytes
    loadf: Loading ELF file . . .
    Loading flash mapped sections to ram memory buffer:
    Loading section 1 () : 00039000 bytes at 00100000 
    Programming flash :00039000 bytes  at 02800000-02838fff 
    Flash programming completed
  4. Power off the target board.

  5. Unplug the ADI cable.

Booting the Target System

    Restart the target system.

    See Step 7 for an example of the messages displayed on the target system console.