VxWorks Reference Manual : Libraries

sysLib

NAME

sysLib - system-dependent library

ROUTINES

sysClkConnect( ) - connect a routine to the system clock interrupt
sysClkDisable( ) - turn off system clock interrupts
sysClkEnable( ) - turn on system clock interrupts
sysClkRateGet( ) - get the system clock rate
sysClkRateSet( ) - set the system clock rate
sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt
sysAuxClkDisable( ) - turn off auxiliary clock interrupts
sysAuxClkEnable( ) - turn on auxiliary clock interrupts
sysAuxClkRateGet( ) - get the auxiliary clock rate
sysAuxClkRateSet( ) - set the auxiliary clock rate
sysIntDisable( ) - disable a bus interrupt level
sysIntEnable( ) - enable a bus interrupt level
sysBusIntAck( ) - acknowledge a bus interrupt
sysBusIntGen( ) - generate a bus interrupt
sysMailboxConnect( ) - connect a routine to the mailbox interrupt
sysMailboxEnable( ) - enable the mailbox interrupt
sysNvRamGet( ) - get the contents of non-volatile RAM
sysNvRamSet( ) - write to non-volatile RAM
sysModel( ) - return the model name of the CPU board
sysBspRev( ) - return the BSP version and revision number
sysHwInit( ) - initialize the system hardware
sysPhysMemTop( ) - get the address of the top of memory
sysMemTop( ) - get the address of the top of logical memory
sysToMonitor( ) - transfer control to the ROM monitor
sysProcNumGet( ) - get the processor number
sysProcNumSet( ) - set the processor number
sysBusTas( ) - test and set a location across the bus
sysScsiBusReset( ) - assert the RST line on the SCSI bus (Western Digital WD33C93 only)
sysScsiInit( ) - initialize an on-board SCSI port
sysScsiConfig( ) - system SCSI configuration
sysLocalToBusAdrs( ) - convert a local address to a bus address
sysBusToLocalAdrs( ) - convert a bus address to a local address
sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state
sysSerialHwInit2( ) - connect BSP serial device interrupts
sysSerialReset( ) - reset all SIO devices to a quiet state
sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel

DESCRIPTION

This library provides board-specific routines.

NOTE: This is a generic reference entry for a BSP-specific library; this description contains general information only. For features and capabilities specific to the system library included in your BSP, see your BSP's reference entry for sysLib.

The file sysLib.c provides the board-level interface on which VxWorks and application code can be built in a hardware-independent manner. The functions addressed in this file include:

    Initialization functions
        - initialize the hardware to a known state
        - identify the system
        - initialize drivers, such as SCSI or custom drivers

    Memory/address space functions
        - get the on-board memory size
        - make on-board memory accessible to external bus
        - map local and bus address spaces
        - enable/disable cache memory
        - set/get nonvolatile RAM (NVRAM)
        - define board's memory map (optional)
        - virtual-to-physical memory map declarations for processors with MMUs

    Bus interrupt functions
        - enable/disable bus interrupt levels
        - generate bus interrupts

    Clock/timer functions
        - enable/disable timer interrupts
        - set the periodic rate of the timer

    Mailbox/location monitor functions
        - enable mailbox/location monitor interrupts for VME-based boards

The sysLib library does not support every feature of every board; a particular board may have various extensions to the capabilities described here. Conversely, some boards do not support every function provided by this library. Some boards provide some of the functions of this library by means of hardware switches, jumpers, or PALs, instead of software-controllable registers.

Typically, most functions in this library are not called by the user application directly. The configuration modules usrConfig.c and bootConfig.c are responsible for invoking the routines at the appropriate time. Device drivers may use some of the memory mapping routines and bus functions.

INCLUDE FILES

sysLib.h

SEE ALSO

VxWorks Programmer's Guide: Configuration and Build, BSP-specific reference entry for sysLib


Libraries : Routines

sysClkConnect( )

NAME

sysClkConnect( ) - connect a routine to the system clock interrupt

SYNOPSIS

STATUS sysClkConnect
    (
    FUNCPTR routine, /* routine called at each system clock interrupt */
    int     arg      /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each clock interrupt. Normally, it is called from usrRoot( ) in usrConfig.c to connect usrClock( ) to the system clock interrupt.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURN

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), usrClock( ), sysClkEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysClkDisable( )

NAME

sysClkDisable( ) - turn off system clock interrupts

SYNOPSIS

 
void sysClkDisable (void)

DESCRIPTION

This routine disables system clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, sysClkEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysClkEnable( )

NAME

sysClkEnable( ) - turn on system clock interrupts

SYNOPSIS

 
void sysClkEnable (void)

DESCRIPTION

This routine enables system clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, sysClkConnect( ), sysClkDisable( ), sysClkRateSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysClkRateGet( )

NAME

sysClkRateGet( ) - get the system clock rate

SYNOPSIS

 
int sysClkRateGet (void)

DESCRIPTION

This routine returns the system clock rate.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

The number of ticks per second of the system clock.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysClkRateSet( )

NAME

sysClkRateSet( ) - set the system clock rate

SYNOPSIS

STATUS sysClkRateSet
    (
    int ticksPerSecond /* number of clock interrupts per second */
    )

DESCRIPTION

This routine sets the interrupt rate of the system clock. It is called by usrRoot( ) in usrConfig.c.

There may be interactions between this routine and the POSIX clockLib routines. Refer to the clockLib reference entry.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the tick rate is invalid or the timer cannot be set.

SEE ALSO

sysLib, sysClkEnable( ), sysClkRateGet( ), clockLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysAuxClkConnect( )

NAME

sysAuxClkConnect( ) - connect a routine to the auxiliary clock interrupt

SYNOPSIS

STATUS sysAuxClkConnect
    (
    FUNCPTR routine, /* routine called at each aux clock interrupt */
    int     arg      /* argument to auxiliary clock interrupt routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each auxiliary clock interrupt. It does not enable auxiliary clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), sysAuxClkEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysAuxClkDisable( )

NAME

sysAuxClkDisable( ) - turn off auxiliary clock interrupts

SYNOPSIS

 
void sysAuxClkDisable (void)

DESCRIPTION

This routine disables auxiliary clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, sysAuxClkEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysAuxClkEnable( )

NAME

sysAuxClkEnable( ) - turn on auxiliary clock interrupts

SYNOPSIS

 
void sysAuxClkEnable (void)

DESCRIPTION

This routine enables auxiliary clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, sysAuxClkConnect( ), sysAuxClkDisable( ), sysAuxClkRateSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysAuxClkRateGet( )

NAME

sysAuxClkRateGet( ) - get the auxiliary clock rate

SYNOPSIS

 
int sysAuxClkRateGet (void)

DESCRIPTION

This routine returns the interrupt rate of the auxiliary clock.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

The number of ticks per second of the auxiliary clock.

SEE ALSO

sysLib, sysAuxClkEnable( ), sysAuxClkRateSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysAuxClkRateSet( )

NAME

sysAuxClkRateSet( ) - set the auxiliary clock rate

SYNOPSIS

STATUS sysAuxClkRateSet
    (
    int ticksPerSecond /* number of clock interrupts per second */
    )

DESCRIPTION

This routine sets the interrupt rate of the auxiliary clock. It does not enable auxiliary clock interrupts.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the tick rate is invalid or the timer cannot be set.

SEE ALSO

sysLib, sysAuxClkEnable( ), sysAuxClkRateGet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysIntDisable( )

NAME

sysIntDisable( ) - disable a bus interrupt level

SYNOPSIS

STATUS sysIntDisable
    (
    int intLevel /* interrupt level to disable */
    )

DESCRIPTION

This routine disables a specified bus interrupt level.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if intLevel is out of range.

SEE ALSO

sysLib, sysIntEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysIntEnable( )

NAME

sysIntEnable( ) - enable a bus interrupt level

SYNOPSIS

STATUS sysIntEnable
    (
    int intLevel /* interrupt level to enable (1-7) */
    )

DESCRIPTION

This routine enables a specified bus interrupt level.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if intLevel is out of range.

SEE ALSO

sysLib, sysIntDisable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysBusIntAck( )

NAME

sysBusIntAck( ) - acknowledge a bus interrupt

SYNOPSIS

int sysBusIntAck
    (
    int intLevel /* interrupt level to acknowledge */
    )

DESCRIPTION

This routine acknowledges a specified VMEbus interrupt level.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

NULL.

SEE ALSO

sysLib, sysBusIntGen( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysBusIntGen( )

NAME

sysBusIntGen( ) - generate a bus interrupt

SYNOPSIS

STATUS sysBusIntGen
    (
    int intLevel, /* bus interrupt level to generate */
    int vector    /* interrupt vector to generate (0-255) */
    )

DESCRIPTION

This routine generates a bus interrupt for a specified level with a specified vector.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if intLevel is out of range or the board cannot generate a bus interrupt.

SEE ALSO

sysLib, sysBusIntAck( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysMailboxConnect( )

NAME

sysMailboxConnect( ) - connect a routine to the mailbox interrupt

SYNOPSIS

STATUS sysMailboxConnect
    (
    FUNCPTR routine, /* routine called at each mailbox interrupt */
    int     arg      /* argument with which to call routine */
    )

DESCRIPTION

This routine specifies the interrupt service routine to be called at each mailbox interrupt.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the routine cannot be connected to the interrupt.

SEE ALSO

sysLib, intConnect( ), sysMailboxEnable( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysMailboxEnable( )

NAME

sysMailboxEnable( ) - enable the mailbox interrupt

SYNOPSIS

STATUS sysMailboxEnable
    (
    char * mailboxAdrs /* address of mailbox (ignored) */
    )

DESCRIPTION

This routine enables the mailbox interrupt.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, always.

SEE ALSO

sysLib, sysMailboxConnect( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysNvRamGet( )

NAME

sysNvRamGet( ) - get the contents of non-volatile RAM

SYNOPSIS

STATUS sysNvRamGet
    (
    char * string, /* where to copy non-volatile RAM */
    int    strLen, /* maximum number of bytes to copy */
    int    offset  /* byte offset into non-volatile RAM */
    )

DESCRIPTION

This routine copies the contents of non-volatile memory into a specified string. The string will be terminated with an EOS.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if access is outside the non-volatile RAM address range.

SEE ALSO

sysLib, sysNvRamSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysNvRamSet( )

NAME

sysNvRamSet( ) - write to non-volatile RAM

SYNOPSIS

STATUS sysNvRamSet
    (
    char * string, /* string to be copied into non-volatile RAM */
    int    strLen, /* maximum number of bytes to copy */
    int    offset  /* byte offset into non-volatile RAM */
    )

DESCRIPTION

This routine copies a specified string into non-volatile RAM.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if access is outside the non-volatile RAM address range.

SEE ALSO

sysLib, sysNvRamGet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysModel( )

NAME

sysModel( ) - return the model name of the CPU board

SYNOPSIS


char *sysModel (void)

DESCRIPTION

This routine returns the model name of the CPU board.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

A pointer to a string containing the board name.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysBspRev( )

NAME

sysBspRev( ) - return the BSP version and revision number

SYNOPSIS


char * sysBspRev (void)

DESCRIPTION

This routine returns a pointer to a BSP version and revision number, for example, 1.0/1. BSP_REV is concatenated to BSP_VERSION and returned.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

A pointer to the BSP version/revision string.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysHwInit( )

NAME

sysHwInit( ) - initialize the system hardware

SYNOPSIS


void sysHwInit (void)

DESCRIPTION

This routine initializes various features of the board. It is called from usrInit( ) in usrConfig.c.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

NOTE

This routine should not be called directly by the user application.

RETURNS

N/A

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysPhysMemTop( )

NAME

sysPhysMemTop( ) - get the address of the top of memory

SYNOPSIS


char * sysPhysMemTop (void)

DESCRIPTION

This routine returns the address of the first missing byte of memory, which indicates the top of memory.

Normally, the amount of physical memory is specified with the macro LOCAL_MEM_SIZE. BSPs that support run-time memory sizing do so only if the macro LOCAL_MEM_AUTOSIZE is defined. If not defined, then LOCAL_MEM_SIZE is assumed to be, and must be, the true size of physical memory.

NOTE

Do no adjust LOCAL_MEM_SIZE to reserve memory for application use. See sysMemTop( ) for more information on reserving memory.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

The address of the top of physical memory.

SEE ALSO

sysLib, sysMemTop( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysMemTop( )

NAME

sysMemTop( ) - get the address of the top of logical memory

SYNOPSIS


char *sysMemTop (void)

DESCRIPTION

This routine returns the address of the top of memory.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

The address of the top of memory.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysToMonitor( )

NAME

sysToMonitor( ) - transfer control to the ROM monitor

SYNOPSIS

STATUS sysToMonitor
    (
    int startType /* parameter passed to ROM to tell it how to boot */
    )

DESCRIPTION

This routine transfers control to the ROM monitor. Normally, it is called only by reboot( )--which services ^X--and by bus errors at interrupt level. However, in some circumstances, the user may wish to introduce a startType to enable special boot ROM facilities.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

Does not return.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysProcNumGet( )

NAME

sysProcNumGet( ) - get the processor number

SYNOPSIS


int sysProcNumGet (void)

DESCRIPTION

This routine returns the processor number for the CPU board, which is set with sysProcNumSet( ).

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

The processor number for the CPU board.

SEE ALSO

sysLib, sysProcNumSet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysProcNumSet( )

NAME

sysProcNumSet( ) - set the processor number

SYNOPSIS

void sysProcNumSet
    (
    int procNum /* processor number */
    )

DESCRIPTION

This routine sets the processor number for the CPU board. Processor numbers should be unique on a single backplane.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, sysProcNumGet( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysBusTas( )

NAME

sysBusTas( ) - test and set a location across the bus

SYNOPSIS

BOOL sysBusTas
    (
    char * adrs /* address to be tested and set */
    )

DESCRIPTION

This routine performs a test-and-set instruction across the backplane.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

NOTE

This routine is equivalent to vxTas( ).

RETURNS

TRUE if the value had not been set but is now, or FALSE if the value was set already.

SEE ALSO

sysLib, vxTas( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysScsiBusReset( )

NAME

sysScsiBusReset( ) - assert the RST line on the SCSI bus (Western Digital WD33C93 only)

SYNOPSIS

void sysScsiBusReset
    (
    WD_33C93_SCSI_CTRL * pSbic /* ptr to SBIC info */
    )

DESCRIPTION

This routine asserts the RST line on the SCSI bus, which causes all connected devices to return to a quiescent state.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysScsiInit( )

NAME

sysScsiInit( ) - initialize an on-board SCSI port

SYNOPSIS


STATUS sysScsiInit (void)

DESCRIPTION

This routine creates and initializes a SCSI control structure, enabling use of the on-board SCSI port. It also connects the proper interrupt service routine to the desired vector, and enables the interrupt at the desired level.

If SCSI DMA is supported by the board and INCLUDE_SCSI_DMA is defined, the DMA is also initialized.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the control structure cannot be connected, the controller cannot be initialized, or the DMA's interrupt cannot be connected.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysScsiConfig( )

NAME

sysScsiConfig( ) - system SCSI configuration

SYNOPSIS


STATUS sysScsiConfig (void)

DESCRIPTION

This is an example SCSI configuration routine.

Most of the code found here is an example of how to declare a SCSI peripheral configuration. You must edit this routine to reflect the actual configuration of your SCSI bus. This example can also be found in src/config/usrScsi.c.

If you are just getting started, you can test your hardware configuration by defining SCSI_AUTO_CONFIG, which will probe the bus and display all devices found. No device should have the same SCSI bus ID as your VxWorks SCSI port (default = 7), or the same as any other device. Check for proper bus termination.

There are three configuration examples here. They demonstrate configuration of a SCSI hard disk (any type), an OMTI 3500 floppy disk, and a tape drive (any type).

Hard Disk

The hard disk is divided into two 32-Mbyte partitions and a third partition with the remainder of the disk. The first partition is initialized as a dosFs device. The second and third partitions are initialized as rt11Fs devices, each with 256 directory entries.

It is recommended that the first partition (BLK_DEV) on a block device be a dosFs device, if the intention is eventually to boot VxWorks from the device. This will simplify the task considerably.

Floppy Disk

The floppy, since it is a removable medium device, is allowed to have only a single partition, and dosFs is the file system of choice for this device, since it facilitates media compatibility with IBM PC machines.

In contrast to the hard disk configuration, the floppy setup in this example is more intricate. Note that the scsiPhysDevCreate( ) call is issued twice. The first time is merely to get a "handle" to pass to scsiModeSelect( ), since the default media type is sometimes inappropriate (in the case of generic SCSI-to-floppy cards). After the hardware is correctly configured, the handle is discarded via scsiPhysDevDelete( ), after which the peripheral is correctly configured by a second call to scsiPhysDevCreate( ). (Before the scsiModeSelect( ) call, the configuration information was incorrect.) Note that after the scsiBlkDevCreate( ) call, the correct values for sectorsPerTrack and nHeads must be set via scsiBlkDevInit( ). This is necessary for IBM PC compatibility.

Tape Drive

The tape configuration is also somewhat complex because certain device parameters need to turned off within VxWorks and the fixed-block size needs to be defined, assuming that the tape supports fixed blocks.

The last parameter to the dosFsDevInit( ) call is a pointer to a DOS_VOL_CONFIG structure. By specifying NULL, you are asking dosFsDevInit( ) to read this information off the disk in the drive. This may fail if no disk is present or if the disk has no valid dosFs directory. Should this be the case, you can use the dosFsMkfs( ) command to create a new directory on a disk. This routine uses default parameters (see dosFsLib) that may not be suitable for your application, in which case you should use dosFsDevInit( ) with a pointer to a valid DOS_VOL_CONFIG structure that you have created and initialized. If dosFsDevInit( ) is used, a diskInit( ) call should be made to write a new directory on the disk, if the disk is blank or disposable.

NOTE

The variable pSbdFloppy is global to allow the above calls to be made from the VxWorks shell, for example:

    -> dosFsMkfs "/fd0/", pSbdFloppy
If a disk is new, use diskFormat( ) to format it.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK or ERROR.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysLocalToBusAdrs( )

NAME

sysLocalToBusAdrs( ) - convert a local address to a bus address

SYNOPSIS

STATUS sysLocalToBusAdrs
    (
    int    adrsSpace, /* bus address space in which busAdrs resides */
    char * localAdrs, /* local address to convert */
    char * *pBusAdrs  /* where to return bus address */
    )

DESCRIPTION

This routine gets the bus address that accesses a specified local memory address.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the address space is unknown or not mapped.

SEE ALSO

sysLib, sysBusToLocalAdrs( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysBusToLocalAdrs( )

NAME

sysBusToLocalAdrs( ) - convert a bus address to a local address

SYNOPSIS

STATUS sysBusToLocalAdrs
    (
    int    adrsSpace,  /* bus address space in which busAdrs resides */
    char * busAdrs,    /* bus address to convert */
    char * *pLocalAdrs /* where to return local address */
    )

DESCRIPTION

This routine gets the local address that accesses a specified bus memory address.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

OK, or ERROR if the address space is unknown or the mapping is not possible.

SEE ALSO

sysLib, sysLocalToBusAdrs( ), and BSP-specific reference pages for this routine


Libraries : Routines

sysSerialHwInit( )

NAME

sysSerialHwInit( ) - initialize the BSP serial devices to a quiesent state

SYNOPSIS

 

void sysSerialHwInit (void)

DESCRIPTION

This routine initializes the BSP serial device descriptors and puts the devices in a quiesent state. It is called from sysHwInit( ) with interrupts locked.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysSerialHwInit2( )

NAME

sysSerialHwInit2( ) - connect BSP serial device interrupts

SYNOPSIS

 

void sysSerialHwInit2 (void)

DESCRIPTION

This routine connects the BSP serial device interrupts. It is called from sysHwInit2( ). Serial device interrupts could not be connected in sysSerialHwInit( ) because the kernel memory allocator was not initialized at that point, and intConnect( ) calls malloc( ).

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysSerialReset( )

NAME

sysSerialReset( ) - reset all SIO devices to a quiet state

SYNOPSIS

 

void sysSerialReset (void)

DESCRIPTION

This routine is called from sysToMonitor( ) to reset all SIO device and prevent them from generating interrupts or performing DMA cycles.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

N/A

SEE ALSO

sysLib, and BSP-specific reference pages for this routine


Libraries : Routines

sysSerialChanGet( )

NAME

sysSerialChanGet( ) - get the SIO_CHAN device associated with a serial channel

SYNOPSIS

SIO_CHAN * sysSerialChanGet
    (
    int channel /* serial channel */
    )

DESCRIPTION

This routine gets the SIO_CHAN device associated with a specified serial channel.

NOTE

This is a generic page for a BSP-specific routine; this description contains general information only. To determine if this routine is supported by your BSP, or for information specific to your BSP's version of this routine, see the reference pages for your BSP.*

RETURNS

A pointer to the SIO_CHAN structure for the channel, or ERROR if the channel is invalid.

SEE ALSO

sysLib, and BSP-specific reference pages for this routine