D.5   Board Support Packages

Boot Considerations for PC Targets

For general information on booting VxWorks, see Tornado Getting Started.

This section describes how to build a boot disk, how to boot VxWorks, and how to mount a DOS file system. VxWorks for x86 targets includes the following DOS diskettes (in 3.5" (1.44MB) format):

These utilities help you build new boot disks and are described in the following subsections.


*

NOTE: These utilities are also included in the Tornado tree at
installDir/host/x86-win32/bin.

Boot Process

When a standard PC-AT computer is powered on, the system BIOS code loads and executes the bootstrap loader. The bootstrap loader is written in 8088 16-bit assembly language. The BIOS obtains the bootstrap loader from the boot sector, which may be in one of several locations: a diskette, a hard disk, or some other alternatives such as a ROM.1 When it finds the bootstrap loader, it executes it to find out where to find the bootrom.sys file.

The VxWorks bootstrap loader must be written to the boot sector instead of the standard bootstrap loader in order to create a VxWorks boot disk (or diskette). In addition, you must create the appropriate bootrom.sys file. This can be a bootable VxWorks kernel or it can be an intermediate kernel designed to load VxWorks from another source, such as a diskette, a hard disk, ROM, or flash. The following subsections describe how to do this from MS-DOS, from Solaris, and from VxWorks.

Building a Boot Disk/Diskette from MS-DOS

The VxWorks Utility Disk includes several utility programs for creating VxWorks boot disks. These utilities write the VxWorks bootstrap loader to the boot sector, and then copy the VxWorks executables from the host to the disk in a format suitable for the bootstrap loader. The utilities mimic the corresponding MS-DOS utilities, but they can be run under a DOS session of Windows, not "pure" DOS. They are summarized as follows and described in more detail later in this section:

vxsys.com
installs a VxWorks bootstrap loader in a disk's boot sector.

vxcopy.exe
copies a VxWorks a.out executable to the boot disk in the required format.

vxload.com
loads and executes VxWorks from MS-DOS (must be run under "pure" DOS).

mkboot.bat
an MS-DOS batch file that creates boot disks.

  • Creating a Boot Disk for PC-Compatible Targets
  • To create a diskette or a bootable hard disk for PC-compatible targets, follow these steps:

    1. On the development host, change to the BSP directory, for example, config/pc386. Use make to produce the minimal boot program (the target bootrom_uncmp) or a bootable VxWorks (the targets vxWorks_rom, vxWorks_rom_low, or vxWorks.st_rom).2 We recommend you copy the resulting file to a legal MS-DOS file name, such as bootrom.dat, to simplify the rest of the process.

    The commands for this sequence in a Windows DOS shell are as follows:

        C:\> cd installDir\target\config\pc386 
        C:\> make bootrom_uncmp 
        C:\> copy bootrom_uncmp bootrom.dat

    1. Transfer the executable image to a PC running MS-DOS. In many cases, the PC is networked with the workstation, using PC-NFS or a similar networking package. For example:

        C:\> copy drive:bootrom.dat c:
    where drive refers to the mounted file system on your PC.

    1. Use the mkboot utility (or a combination of vxsys and vxcopy) to create the boot disk. If this boot disk is a diskette, it must be a high-density diskette. The following example shows this step, assuming the diskette is in drive A:

        C:\> mkboot a: bootrom.dat
    The mkboot utility uses vxsys to create the VxWorks bootstrap loader in the disk's boot sector. mkboot then runs vxcopy to copy bootrom.dat to the boot file bootrom.sys on the target disk, excluding the a.out header.

    1. Check that bootrom.sys is contiguous on the boot disk, using the MS-DOS chkdsk utility. (The mkboot utility runs chkdsk automatically.) If chkdsk shows that there are non-contiguous blocks, delete all files from the disk and repeat the vxcopy operation to ensure that MS-DOS lays down the file contiguously.

    The following example shows chkdsk output where the boot file is not contiguous (note especially the last line of output):

        C:\> chkdsk a:bootrom.sys
    Volume Serial Number is 2A35-18ED 1457664 bytes total disk space 895488 bytes in 11 user files 562176 bytes available on disk
    512 bytes in each allocation unit 2847 total allocation units on disk 1098 available allocation units on disk
    655360 total bytes memory 602400 bytes free
    A:\BOOTROM.SYS Contains 2 non-contiguous blocks

    1. To test your boot disk, first make sure that the correct drive holds the boot disk (in this example case, drive A: holds the boot diskette).

    1. Reboot the PC.

    Depending on the configuration of your VxWorks image, if the boot is successful, the VxWorks boot prompt appears either on the VGA console or on the COM1 serial port. You can boot VxWorks by entering @:

        [VxWorks Boot]: @
  • The MS-DOS Boot Utilities in More Detail
  • vxsys drive:
    This command installs a VxWorks bootstrap loader in a drive's boot sector. The drive can be either a diskette (drive A:), or a hard disk that is searched by the BIOS bootstrap (drive C:).3 The VxWorks bootstrap loader searches for the file bootrom.sys in the root directory and loads it directly into memory at 0x8000. Execution then jumps to romInit( ) at 0x8000.


    *

    NOTE: After a bootstrap loader is installed in the disk's boot sector, you do not need to repeat the vxsys operation for new ROM images. Just use vxcopy to make a new version of bootrom.sys.

    vxcopy source_file target_file
    This command copies the VxWorks image file from source_file to target_file. Normally this copies the bootrom_uncmp output to bootrom.sys on the boot disk. vxcopy strips the 32-byte a.out header from source_file as it copies.

    mkboot drive: source_file
    This command is an MS-DOS batch file that uses vxsys to install the VxWorks bootstrap loader in the drive's boot sector, and then uses vxcopy to transfer source_file to drive:bootrom.sys. It also runs the MS-DOS utility chkdsk to check whether bootrom.sys is contiguous.

    vxload [image_file]
    This command is used during an MS-DOS session to load and execute the VxWorks image (normally vxWorks.st or bootrom_uncmp). It can be more convenient or quicker than loading the image via the PC boot cycle. vxload takes an optional parameter, the image file name; the default is vxWorks.st in the current directory.


    *

    CAUTION: vxload cannot be used to load VxWorks if the MS-DOS session has a protected mode program in use. Typical examples include the MS-DOS RAM disk driver, vdisk.sys, and the extended memory manager, emm386.exe. To use vxload, remove or disable such facilities.

    Because vxload must read the image file to memory at 0x8000, it checks to see that this memory is not in use by MS-DOS, and generates an error if it is. If you receive such an error, reconfigure your PC target to make the space available by loading MS-DOS into high memory and reducing the number of device drivers. Or start vxload instead of the MS-DOS command interpreter command.com. (If you take this approach, remember to first ensure that you can restore your previous configuration.)

    The following is a sample config.sys file that shows these suggestions:

    device=c:\dos\himem.sys 
    dos=high,umb 
    shell=c:\vxload.com c:\bootrom.dat
    The file bootrom.dat must have an a.out header, unlike the bootrom.sys file made by mkboot.

    Building a Boot Disk/Diskette from a Solaris Host

    Use /usr/bin/fdformat that comes with Solaris. It requires a bootstrap loader file called vxld.bin, which can be downloaded from WindSurf.

    Copy vxld.bin to your Solaris file system, insert a 1.44 MB diskette into the Sun diskette drive, and issue the fdformat command to format the diskette and install the boot block.

    fdformat -U -d -B vxld.bin 
     
    Formatting 1.44 MB in /vol/dev/rdiskette0/no_name#7 
    Press return to start formatting floppy. 
    .................................................................... 
    fdformat: using "vxld.bin" for MS-DOS boot loader

    Now create the bootrom.sys:

    % cd installDir/target/config/bspName 
    % make bootrom_uncmp 
    % aoutToBinDec < bootrom_uncop > bootrom.sys

    Copy the new bootrom.sys file to your boot diskette.

    Building a Boot Disk/Diskette from VxWorks

    The routine mkbootFd( ) produces a VxWorks boot diskette, and mkbootAta( ) produces a VxWorks boot disk (an IDE or ATA hard disk). Both run on any VxWorks x86 target. They are provided in installDir/target/config/bspname/mkboot.c. Use a DOS-formatted disk or diskette.


    *

    CAUTION: The mkbootFd( ) routine supports only high-density diskettes.

    The mkbootFd( ), mkbootAta( ), and mkbootTffs( ) routines write the boot sector so that it contains the VxWorks bootstrap loader and make a boot image named bootrom.sys. The boot image can be derived from one of the images listed in VxWorks Images. Before making any version of the image, make sure that DEFAULT_BOOT_LINE in config.h is set correctly (see Tornado User's Guide: Setup and Startup), and that the size of the boot image (text+data+bss) is verified to be less than 512KB. It cannot be larger than this, because it is written into lower memory.

    During the booting process, the VxWorks bootstrap loader reads bootrom.sys and then jumps to the entry point of the boot image.

    The mkbootFd( ) routine requires the following parameters:

    STATUS mkbootFd (int drive, int fdType, char *filename)

    The first two parameters specify the drive number and diskette type, specified as in Booting VxWorks from a Diskette, an ATA/IDE Disk, a PC Card, or a Flash File System. The third parameter specifies the file name of the boot image.

    The mkbootAta( ) routine requires the following parameters:

    STATUS mkbootAta (int ctrl, int drive, char *filename)

    The first two parameters specify the controller number and drive number, specified as in Booting VxWorks from a Diskette, an ATA/IDE Disk, a PC Card, or a Flash File System. The third parameter specifies the file name of the boot image.

    The mkbootTffs( ) routine requires the following parameters:

    STATUS mkbootTffs (int drive, int removeBit, char *filename)

    The first two parameters specify the drive number and removable bit, specified as in Booting VxWorks from a Diskette, an ATA/IDE Disk, a PC Card, or a Flash File System. The third parameter specifies the file name of the boot image.

    For example, to create a boot disk for the pc386 BSP if you are using a UNIX host, first use the following commands on the host to create the mkboot.o object from mkboot.c:

    % cd installDir/target/config/pc386 
    % make mkboot.o

    Then, from the Tornado shell, move to the appropriate directory, load mkboot.o, and then invoke mkbootFd( ), mkbootAta( ), or mkbootTffs( ). Remember to place a formatted, empty diskette in the appropriate drive if you use mkbootFd( ).

    In this example, mkbootAta( ) builds a local IDE disk on drive C: from bootrom_uncmp with the default ataResources[] table (see ATA/IDE Disk Driver):

    -> cd "installDir/target/config/pc386" 
    -> ld < mkboot.o 
    -> mkbootAta 0,0,"bootrom_uncmp"
    Booting VxWorks from a Diskette, an ATA/IDE Disk, a PC Card, or a Flash File System

    Four boot devices are available in VxWorks for the x86, one for diskettes, one for ATA/IDE hard disks, one for PCMCIA PC cards, and one for flash files. You can also build your own VxWorks boot ROMs using optional hardware; see ROM Card and EPROM Support. Alternatively, as with other VxWorks platforms, you can also boot over an Ethernet (using one of the supported Ethernet cards), or over a SLIP connection.


    *

    CAUTION: Because standard PC BIOS components do not support initial booting from PCMCIA devices, systems which load VxWorks from these devices must use a VxWorks boot disk/diskette. See Building a Boot Disk/Diskette from MS-DOS, Building a Boot Disk/Diskette from a Solaris Host, and Building a Boot Disk/Diskette from VxWorks.

    When booting from a diskette, an ATA/IDE disk, a PC card, or a flash file system, first make sure that the boot device is formatted for an MS-DOS file system. The VxWorks boot program mounts the boot device by automatically calling either usrFdConfig( ) in usrFd.c for diskettes, usrAtaConfig( ) in usrAta.c for ATA/IDE hard disks, usrPcmciaConfig( ) in usrPcmcia.c for PC cards, or usrTffsConfig( ) for flash file systems. (All files are located in installDir/target/src/config.)


    *

    CAUTION: Because the boot program uses usrFdConfig( ) for floppy diskettes, and because usrFdConfig( ) does not provide the DOS_VOL_CONFIG structure required to use dosFsVolUnmount( ), you must instead use ioctl( ) with FIOUNMOUNT before removing the floppy diskette.

    In each case, a mount point name is taken from the file name specified as one of the boot parameters. You might choose diskette zero (drive A:) to be mounted as /fd0 (by supplying a boot file name that begins with that string). Similarly, you might choose ATA/IDE hard disk zero (drive C:) to be mounted as /ata0, you might choose the PC card in socket 0 to be mounted as /pc0, or you might choose the flash file system called drive 1 as /tffs0. In each case, the name of the directory mount point (fd0, ata0, pc0, or tffs0 in these examples) can be any legal file name. (For more information on usrFdConfig( ), usrAtaConfig( ), usrPcmciaConfig( ), or usrTffsConfig( ), see Mounting a DOS File System.)

    Because the PC hardware does not have a standard NVRAM interface, the only way to change default boot parameters is to rebuild the bootstrap code with a new definition for DEFAULT_BOOT_LINE in config.h. See Boot Process for instructions on how to rebuild the bootstrap code.


    *

    CAUTION: To enable rebooting with CTRL+X, you must set some of the BSP-specific global variables sysWarmType, sysWarmFdType, sysWarmFdDrive, sysWarmAtaCtrl, sysWarmAtaDrive, and sysWarmTffsDrive, depending on which boot device you use. For more information, see Table D-3.

  • Booting from Diskette
  • To boot from a diskette, specify the boot device as fd (for floppy device). First, specify the drive number on the boot device: line of the boot parameters display. Then, specify the diskette type (3.5" or 5.25"). The format is as follows:

    boot device: fd=drive number, diskette type
    drive number
    a digit specifying the diskette drive:

    0 =

    default; the first diskette drive (drive A:)

    1 =

    the second diskette drive (drive B:)


    diskette type
    a digit specifying the type of diskette:

    0 =

    default; 3.5" diskette

    1 =

    5.25" diskette


    Thus, to boot from drive B: with a 5.25" diskette, enter the following:

    boot device: fd=1,1

    The default value of the file-name boot parameter is /fd0/vxWorks.st. You can specify another boot image; for example, assume that you have placed your vxWorks and vxWorks.sym files in the root directory of the 5.25" diskette in drive A: as the files A:\\_vxworks and A:\vxworks.sym, and that the mount point for this drive is /fd0. To boot this image, enter the following in the boot parameters display:

    boot device: fd=0,1 
    ... 
    file name: /fd0/vxworks
  • Booting from ATA/IDE Disk
  • To boot from an ATA/IDE disk, specify the boot device as ata. First, specify the controller number on the boot device line of the boot parameters display. Then, specify the drive number. The format is as follows:

    boot device: ata=controller number, drive number 
    controller number
    a digit specifying the controller number:

    0 =

    a controller described in the first entry of the ataResources table (in the default configuration, the local IDE disk is the first controller)

    1 =

    a controller described in the second entry of the ataResources table (in the default configuration, the ATA PCMCIA PC card is the second controller)


    drive number
    a digit specifying the hard drive:

    0 =

    the first drive on the controller (drive C: or E:)

    1 =

    the second drive on the controller (drive D: or F:)


    If your vxWorks and vxWorks.sym files are in the root directory of your IDE hard disk drive C: as the files C:\vxworks and C:\vxworks.sym, where C: is the first IDE disk drive on the system and the mount point for the drive is /ata0, then enter the following in the boot parameters display:

    boot device: ata=0,0 
    ... 
    file name: /ata0/vxworks
  • Booting from PCMCIA PC Card
  • To boot from a PCMCIA PC card, specify the boot device as pcmcia. Specify the socket number on the boot device: line of the boot parameters display. The format is as follows:

    boot device: pcmcia=socket number
    socket number
    a digit specifying the socket number:

    0 =

    the first PCMCIA socket

    1 =

    the second PCMCIA socket


    If your vxWorks and vxWorks.sym files are in the root directory of your ATA or SRAM PCMCIA PC card drive E: as the files E:\vxworks and E:\vxworks.sym, and the mount point for your PC card drive is /pc0, then enter the following:

    boot device: pcmcia=0 
    ... 
    file name: /pc0/vxworks

    If you are using an Ethernet PC card, the boot device is the same and the file name is:

    file name: /usr/wind/target/config/pc386/vxWorks
  • Booting from Flash File System
  • To boot from an TFFS disk, specify the boot device as tffs. Specify both the drive number and the removable bit on the boot device: line of the boot parameters display. The format is as follows:

    boot device: tffs=drive number, removable bit
    drive number
    a digit specifying the drive number; it should be in the range of 0 to (noOfDrives - 1). The global variable noOfDrives holds the number of registered drives, and is initialized by sysTffsInit( ) in tffsDrv.

    removable bit
    a digit specifying whether or not the drive is removable.

    0 =

    non-removable flash media

    1 =

    removable flash media, such as a Flash PC Card


    If your vxWorks and vxWorks.sym files are in the root directory of your TFFS (Disk On Chip) drive E: as the file E:\vxWorks and E:\vxWorks.sym, and the mount point for your TFFS drive is /tffs0, then enter the following:

    boot device: tffs=0,0 
    ... 
    file name: /tffs0/vxWorks

    Mounting a DOS File System

    You can mount a DOS file system from a diskette, an ATA/IDE disk, a PC card (SRAM or ATA), or a flash file system to your VxWorks target.

    Diskette

    Use the routine usrFdConfig( )to mount the file system from a diskette. It takes the following parameters:

    drive number
    the drive that contains the diskette: MS-DOS drive A: is 0; drive B: is 1.

    diskette type
    0 (3.5" 2HD) or 1 (5.25" 2HD).

    mount point
    from where on the file system to mount, for example, /fd0/.


    *

    CAUTION: Because the boot program uses usrFdConfig( ) for floppy diskettes, and because usrFdConfig( ) does not provide the DOS_VOL_CONFIG structure required to use dosFsVolUnmount( ), you must instead use ioctl( ) with FIOUNMOUNT before removing the floppy diskette.

    ATA/IDE Hard Drive

    Use the routine usrAtaConfig( )to mount the file system from an ATA/IDE disk. It takes the following parameters:

    controller number
    the controller: a controller described in the first entry of the ataResources[] table is 0; a controller described in the second entry is 1. In the default configuration, the local IDE disk is 0; the PCMCIA ATA drive is 1.

    drive number
    the drive: the first drive of the controller is 0; the second drive of the controller is 1. In the default configuration, MS-DOS drive C: is 0; drive D: is 1.

    mount point
    from where on the file system to mount, for example, /ata0/.

    PCMCIA Card

    Use pccardMount( ) to mount the file system from a PC card (SRAM or ATA). This routine differs from usrPcmciaConfig( ) in that pccardMount( ) uses the default device. A default device is created by the enabler routine when the PC card is initialized. The default device is removed automatically when the PC card is removed. pccardMount( ) takes the following parameters:

    socket number
    the socket that contains the PC card; the first socket is 0.

    mount point
    from where on the file system to mount, for example, /pc0/.

    Use pccardMkfs( ) to initialize a PC card and mount the file system from a PC card (SRAM or ATA). It takes the following parameters:

    socket number
    the socket that contains the PC card; the first socket is 0.

    mount point
    from where on the file system to mount, for example, /pc0/.

    The pccardMount( ) and pccardMkfs( ) routines are provided in source form in src/drv/pcmcia/pccardLib.c.

    TFFS Drive

    Use the routine usrTffsConfig( ) to mount the file system from an TFFS drive. It takes the following parameters:

    drive number
    the drive number in the range of 0 to (noOfDrives - 1). The global variable noOfDrives holds a number of registered drives that is initialized in sysTffsInit( ) in tffsDrv.

    removable bit
    the removable bit of the drive is 0 for non-removable flash media and 1 for removable flash media.

    mount point
    from where on the file system to mount, for example, /tffs0/.

    DMA Buffer Alignment and cacheLib

    If you write your own device drivers that use direct memory access into buffers obtained from cacheLib, the buffer must be aligned on a 64KB boundary.

    Support for Third-Party BSPs

    To support third party pc386 and pc486 BSPs, the global variable sysCodeSelector and the routines sysIntVecSetEnt( ) and sysIntVecSetExit( ) are defined in sysLib.c.

    VxWorks Images

    The executable target bootrom_uncmp uses lower memory (0x0 - 0xa0000), while vxWorks and vxWorks.st use upper memory (0x100000 - pcMemSize). A minimum of 1MB of memory in upper memory is required for vxWorks and vxWorks.st.

    The VxWorks makefile targets listed below are supported in these BSPs. They should be placed on a bootable diskette by mkboot (a DOS utility) or by mkbootFd( ) or mkbootAta( ) or mkbootTffs( ) (VxWorks utilities). The makefile target vxWorks_rom should be downloaded by the bootrom_high bootROM image; for information on all VxWorks makefile targets, see 8.6.2 Executing VxWorks from ROM:

    vxWorks_rom

    bootable VxWorks:

    upper memory

    vxWorks_rom_low

    bootable VxWorks:

    lower memory

    vxWorks.st_rom

    bootable VxWorks.st (compressed):

    upper memory

    bootrom

    bootROM (compressed):

    lower memory

    bootrom_uncmp

    bootROM:

    lower memory

    bootrom_high

    bootROM (compressed):

    upper memory

    BSP-Specific Global Variables for 386 and 486

    The BSP-specific global variables shown in Table D-3 apply to pc386, pc486, and epc4.

    Table D-3:  BSP-Specific Global Variables  


    Location
    Global Variable
    Value
    Description

    sysLib.c  
    sysWarmType
    sysWarmFdType
    sysWarmFdDrive
    sysWarmAtaCtrl
    sysWarmAtaDrive
    sysWarmTffsDrive  
    0 = ROMBIOS
    1 (default) =
       Diskette
    2 = ATA
    3 = TFFS 
    sysWarmType controls how CTRL+X is processed. If 0, VxWorks asserts SYSRESET line, and CTRL+X produces cold start. If 1, VxWorks reads a boot image from the diskette specified by sysWarmFdType and sysWarmFdDrive, and jumps to the boot image entry point. If 2, VxWorks reads a boot image from the ATA/IDE disk specified by sysWarmAtaCtrl and sysWarmAtaDrive and jumps to the boot image entry point. If 3, VxWorks reads a boot image from the TFFS Disk On Chip specified by sysWarmTffsDrive and jumps to the boot image entry point. 
    sysFdBufAddr
    sysFdBufSize  
    0x2000
    0x3000 
    Address and size of diskette DMA buffer. 
    sysStrayIntCount  
     
    VxWorks increments this when it catches a stray interrupt on IRQ7. 

    Configuring the Pentium BSP

    The project facility configures the Pentium BSP with hardware floating point support and user data cache support set to copyback by default. This configuration is equivalent to the default configuration in config.h:

    #undef   INCLUDE_SW_FP         /* Pentium has hardware FPP */  
    #undef   USER_D_CACHE_MODE     /* Pentium write-back data cache support */  
    #define  USER_D_CACHE_MODE  CACHE_COPYBACK  
    #define  INCLUDE_MTRR_GET      /* get MTRR to sysMtrr[] */  
    #define  INCLUDE_PMC          /* include PMC */

    Configuring the PentiumPro BSP

    The project facility configures the PentiumPro BSP automatically to use the board's special functionality. This configuration is equivalent to the default configuration in config.h. Changes to floating point and cache support can be made in the project facility. If you must change the default setting for other functionality, you must change config.h. (See 8. Configuration and Build.)

    #undef   INCLUDE_SW_FP         /* PentiumPro has hardware FPP * 
    #undef   USER_D_CACHE_MODE     /* PentiumPro write-back data cache support */ 
    #define  USER_D_CACHE_MODE  (CACHE_COPYBACK|CACHE_SNOOP_ENABLED) 
    #define  INCLUDE_MTRR_GET      /* get MTRR to sysMtrr[] */ 
    #define  INCLUDE_PMC           /* include PMC */ 
    #undef   VIRTUAL_WIRE_MODE     /* Interrupt Mode: Virtual Wire Mode */ 
    #undef   SYMMETRIC_IO_MODE     /* Interrupt Mode: Symmetric IO Mode */ 
     
    #if defined(VIRTUAL_WIRE_MODE) || defined(SYMMETRIC_IO_MODE) 
    #define  INCLUDE_APIC_TIMER    /* include Local APIC timer */ 
    #define  PIT0_FOR_AUX          /* use channel 0 as an Aux Timer */ 
    #endif        /* defined(VIRTUAL_WIRE_MODE) || defined(SYMMETRIC_IO_MODE) */ 
     
    #define  INCLUDE_TIMESTAMP_TSC /* include TSC for timestamp */ 
    #define  PENTIUMPRO_TSC_FREQ 0 /* auto detect TSC freq */ 
    #if  FALSE 
    #define  PENTIUMPRO_TSC_FREQ 150000000 /* use specified TSC freq */ 
    #endif                         /* FALSE */ 
     
    #define  INCLUDE_MMU_PENTIUMPRO /* include 32bit MMU for PentiumPro */ 
    #ifdef   INCLUDE_MMU_PENTIUMPRO 
     
    #undef   VM_PAGE_SIZE          /* page size could be 4KB or 4MB */ 
    #define  VM_PAGE_SIZE  PAGE_SIZE_4KB    /* 4KB page */ 
    #if  FALSE 
    #define  VM_PAGE_SIZE  PAGE_SIZE_4MB    /* 4MB page */ 
    #endif                         /* FALSE */ 
     
    #undef   VM_STATE_MASK_FOR_ALL 
    #undef   VM_STATE_FOR_IO 
    #undef   VM_STATE_FOR_MEM_OS 
    #undef   VM_STATE_FOR_MEM_APPLICATION 
    #undef   VM_STATE_FOR_PCI 
     
    #define VM_STATE_MASK_FOR_ALL \ 
    VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | \ 
    VM_STATE_MASK_CACHEABLE | VM_STATE_MASK_WBACK | VM_STATE_MASK_GLOBAL 
     
    #define VM_STATE_FOR_IO \ 
    VM_STATE_VALID | VM_STATE_WRITABLE | \ 
    VM_STATE_CACHEABLE_NOT | VM_STATE_WBACK_NOT | VM_STATE_GLOBAL_NOT 
     
    #define VM_STATE_FOR_MEM_OS \ 
    VM_STATE_VALID | VM_STATE_WRITABLE | \ 
    VM_STATE_CACHEABLE | VM_STATE_WBACK | VM_STATE_GLOBAL_NOT 
     
    #define VM_STATE_FOR_MEM_APPLICATION \ 
    VM_STATE_VALID | VM_STATE_WRITABLE | \ 
    VM_STATE_CACHEABLE | VM_STATE_WBACK | VM_STATE_GLOBAL_NOT 
     
    #define VM_STATE_FOR_PCI \ 
    VM_STATE_VALID | VM_STATE_WRITABLE | \ 
    VM_STATE_CACHEABLE_NOT | VM_STATE_WBACK_NOT | VM_STATE_GLOBAL_NOT 
     
    #endif                       /* INCLUDE_MMU_PENTIUMPRO */

    ROM Card and EPROM Support

    A boot EPROM (type 27020 or 27040) is supported with Blunk Microsystems' ROM Card 1.0. For information on booting from these devices, see the Blunk Microsystems documentation.

    The following program is provided to support VxWorks with the ROM Card:

    config/bspname/romcard.s
    a loader for code programmed in to the EPROM.

    In addition, the following configurations are defined in the makefile to generate Motorola S-record format from bootrom_uncmp or from vxWorks_boot.st:

    romcard_bootrom_512.hex
    boot ROM image for 27040 (512 KB)

    romcard_bootrom_256.hex
    boot ROM image for 27020 (256 KB)

    romcard_vxWorks_st_512.hex
    bootable VxWorks image for 27040 (512 KB)

    Neither the ROM Card nor the EPROM is distributed with VxWorks. To contact Blunk Microsystems, see their Web site at http://www.blunkmicro.com.

    Device Drivers

    VxWorks for the x86 includes a console driver, network drivers for several kinds of hardware, a diskette driver, an ATA/IDE hard disk driver, and a line printer driver.

    VGA and Keyboard Drivers

    The keyboard and VGA drivers are character-oriented drivers; thus, they are treated as additional serial devices. Because the keyboard deals only with input and the VGA deals only with output, they are integrated into a single driver in the module installDir/target/src/drv/serial/pcConsole.c.

    To include the console drivers in your configuration, select the macro INCLUDE_PC_CONSOLE for inclusion in the project facility VxWorks view. When this macro is defined, the serial driver automatically initializes the console drivers.

    The console drivers do not change any hardware initialization that the BIOS has done. The I/O addresses for the keyboard and the console, and the base address of the on-board VGA memory, are defined in installDir/target/config/bspname/pc.h.

    The macro PC_KBD_TYPE specifies the type of keyboard. The default is a PS/2 keyboard with 101 keys. If the keyboard is a portable PC keyboard with 83 keys, define the macro as PC_XT_83_KBD in installDir/target/config/bspname/config.h.

    In the default configuration, /tyCo/0 is serial device 1 (COM1), /tyCo/1 is serial device 2 (COM2), and /tyCo/2 is the console.

    You can define the following configuration macros for the console drivers in pc.h:

    • INCLUDE_ANSI_ESC_SEQUENCE supports the ANSI terminal escape sequences. The VGA driver does special processing for recognized escape sequences.

    • COMMAND_8042, DATA_8042, and STATUS_8042 refer to the I/O base addresses of the various keyboard controller registers.

    • GRAPH_ADAPTER can be set to either VGA or MONOCHROME.

    Network Drivers

    Several network drivers are available, corresponding to an assortment of boards from different manufacturers. To include specific network drivers in your configuration, see the project facility under network components.

    For all network drivers, the I/O address, RAM address, RAM size, and interrupt request (IRQ) levels are defined on the driver Params tab in the project facility (the I/O address must match the value recorded in the EEPROM). Use the configuration program supplied by the manufacturer to set the I/O address; in some cases you can set IRQ levels with the same configuration program.

    You can set the board-specific macro listed in Table D-4 (defined on the Params tab) to specify whether you are using EEPROM, thin coaxial cable (BNC), twisted-pair cable (RJ45), thick coaxial cable (AUI), or some combination (for example, RJ45+AUI and/or RJ45+BNC). The exceptions are the Intel EtherExpress32, which uses EEPROM only, and the Novell/Eagle NE2000, which uses a hardware jumper.

    For most network drivers, a board-specific routine boardShow( ) 4 displays statistics collected in the interrupt handler on the standard output device. This routine requires two parameters: interface unit and zap. For all boards currently supported, interface unit is 0; zap can be either 0 or 1. If zap is 1, all collected statistics are cleared to zero.

    Table D-4 shows the software configuration details for each network driver.

    Table D-4:  Network Drivers  


    Network Board
    IRQ Levels Supported
    Ethernet
    Configuration Macro
    Show Routine

    SMC Elite 16 
    2, 3, 4, 5, 7, 9, 10, 11, 15 
    CONFIG_ELC  
    elcShow1 ( )  
    SMC Elite 16 Ultra 
    2, 3, 5, 7, 10, 11 
    CONFIG_ULTRA  
    ultraShow( )*  
    Intel EtherExpress2  
    2, 3, 4, 5, 9, 10, 11 
    CONFIG_EEX  
    (none)  
    Intel EtherExpress32= 
    3, 5, 7, 9, 10, 11, 12, 15 
    (EEPROM)  
    (none)  
    Intel EtherExpress PRO100B  
    0 - 15 
    (EEPROM)  
    (none)  
    3Com EtherLink III 
    3, 5, 7, 9, 10, 11, 12, 15 
    CONFIG_ELT  
    eltShow( )*  
    Novell/Eagle NE2000 
    2, 3, 4, 5, 10, 11, 12, 15 
    (jumper)  
    eneShow( )*  
    Ampro Ethernet-II 
    2, 3, 10, 11 
    CONFIG_ESMC  
    esmcShow( )*  

    1:  These routines are automatically included when the board is configured. When you invoke them, their output is sent to the standard output device.

    2:  Auto-detect mode is not supported for these boards.

    Certain network boards are also configurable in hardware. Use the jumper settings shown in Table D-5 with the network drivers supplied.

    Table D-5:  Network Board Hardware Configuration  


    Network Board
    Jumpers
    Settings

    SMC Elite 16 
    W1
    W2
    SOFT 
    NONE/SOFT 
    SMC Elite 16 Ultra 
    W1
    SOFT 
    Intel EtherExpress 
    (none)
     
    Intel EtherExpress32 
    (none)
     
    Intel EtherExpress PRO100B 
    (none)
     
    3Com EtherLink III 
    (none)
     
    Novell/Eagle NE2000 
    various
    follow manufacturer's instructions 
    Ampro Ethernet-II 
    W1
    W3
    W4
    PROM size: 16K or 32K
    No.0: 0x300
    Select IRQ-10,11 

    Diskette Driver

    To include the diskette driver in your configuration, select the macro INCLUDE_FD for inclusion in the project facility VxWorks view ("fd" stands for floppy disk). When INCLUDE_FD is included, the initialization routine fdDrv( )is called automatically from usrRoot( )in installDir/target/config/all/usrConfig.c. To change the interrupt vector and level used by fdDrv( ), edit the definitions of FD_INT_VEC and FD_INT_LVL on the Params tab of the Properties window.

    The fdDevCreate( ) routine installs a diskette device in VxWorks. You must call fdDevCreate( ) explicitly for each diskette device you wish to install; it is not called automatically. The fdDevCreate( )routine requires the following parameters:

    drive number
    the diskette drive that corresponds to this device: MS-DOS drive A: is 0; drive B: is 1.

    diskette type
    0 (3.5" 2HD) or 1 (5.25" 2HD). These numbers are indices to the structure table fdTypes[] in installDir/target/config/bspname/sysLib.c, which is described below.

    number of blocks
    the size of the device.

    offset
    the number of blocks to leave unused at the start of a diskette.

    As shipped, the fdTypes[] table in sysLib.c describes two diskette types: the 3.5" 1.44MB 2HD diskette and the 5.25" 1.2MB 2HD diskette. (In particular, there is no entry for low-density diskettes.) To use another type of diskette, add the appropriate disk descriptions to the fdTypes[] table, shown below. Note that each entry in the table is a structure. The entry dataRate is described in more detail in Table D-6 and the entries stepRate, headUnload, and headLoad are described in Table D-7.

    int sectors;         /* number of sectors                         */ 
    int sectorsTrack;    /* sectors per track                         */ 
    int heads;           /* number of heads                           */ 
    int cylinders;       /* number of cylinders                       */ 
    int secSize;         /* 128 << secSize gives bytes per sector     */ 
    char gap1;           /* suggested gap value in read/write cmds    */ 
                         /* to avoid splice point between data field  */ 
                         /* and ID field of contiguous sections       */ 
    char gap2;           /* suggested gap values for format-track cmd */ 
    char dataRate;       /* data transfer rate                        */ 
    char stepRate;       /* stepping rate                             */ 
    char headUnload;     /* head unload time                          */ 
    char headLoad;       /* head load time                            */ 
    char mfm;            /* 1-->MFM (double density),  
                            0--> FM (single density)                  */ 
    char sk;             /* if 1, skip bad sectors on read-data cmd   */ 
    char *name;          /* name                                    */

    The dataRate field must have a value ranging from 0 to 3. The bit value controls the data transfer rate by setting the configuration control register in some IBM diskette controllers. The values correspond to transfer rates as shown in Table D-6.

    Table D-6:  Diskette Data Transfer Rates


    dataRate
    MFM (double density)
    FM (single density)

    1Mbps
    invalid
    500Kbps
    250Kbps
    300Kbps
    150Kbps
    250Kbps
    125Kbps

    The stepRate, headUnload, and headLoad parameters describe time intervals related to physical operation of the diskette drive. The time intervals are a simple function of the parameter value and of a multiplier corresponding to the data transfer rate, except that 0 has a special meaning for headUnload and headLoad, as shown in Table D-7.

    Table D-7:  Time Interval Parameters in fdTypes[]


    Time (ms) by transfer rate

    Description
    Field
    Value
    1M
    500K
    300K
    250K

                                                     Transfer rate multiplier (T):  
    1
    2
    3.33
    4
    Interval between stepper pulses 
    stepRate  
    8
    16
    26.7
    32
    0-15 
    (8 - 0.5 × stepRate) × T
    Interval from end of read or write to head unload 
    headUnload  
    128
    256
    426
    512
    1-15 
    8 × headUnload × T
    Interval from end of head load to start of read or write 
    headLoad  
    128
    256
    426
    512
    1-127 
    headLoad × T

    Interleaving is not supported when the driver formats a diskette; the driver always uses a 1:1 interleave. Use the MS-DOS format program to get the recommended DOS interleave factor.

    The driver uses memory area 0x2000 to 0x5000 for DMA, for the following reasons:

    • The DMA chip has an addressing range of only 24 bits.

    • A buffer must fit in one page; that is, a buffer cannot cross the 64KB boundary.

    Another routine associated with the diskette driver is fdRawio( ). This routine allows you to read and write directly to the device; thus, the overhead associated with moving data through a file system is eliminated. The fdRawio( ) routine requires the following parameters:

    drive number
    the diskette drive that corresponds to this device: MS-DOS drive A: is 0; drive B: is 1.

    diskette type
    0 (3.5" 2HD) or 1 (5.25" 2HD). These numbers are indices to the structure table fdTypes[] in installDir/target/config/bspname/sysLib.c.

    FD_RAW ptr
    pointer to the FD_RAW[] structure, where the data that is being read and written is stored; see below.

    The following is the definition of the FD_RAW[] structure:

    typedef struct fdRaw 
        { 
        UINT     cylinder;  /* cylinder (0 -> (cylinders-1))   */ 
        UINT     head;      /* head (0 -> (heads-1))           */ 
        UINT     sector;    /* sector (1 -> sectorsTrack)      */ 
        UINT     *pBuf;     /* ptr to buff (bytesSector*nSecs) */ 
        UINT     nSecs;     /* # of sectors (1-> sectorsTrack) */ 
        UINT     direction; /* read=0, write=1                 */ 
        } FD_RAW;
    ATA/IDE Disk Driver

    To include the ATA/IDE disk device driver in your configuration, select the macro INCLUDE_ATA for inclusion in the project facility VxWorks view. When INCLUDE_ATA is defined, the initialization routine ataDrv( )is called automatically from usrRoot( )in usrConfig.c for the local IDE disk. To change the interrupt vector and level and the configuration type used by ataDrv( ), edit the definitions of the constants ATA0_INT_VEC, ATA0_INT_LVL, and ATA0_CONFIG in pc.h. The default configuration is suitable for the i8259 interrupt controller; most PCs use that chip. The ataDrv( ) routine requires the following parameters:

    controller number
    the controller: a controller described in the first entry of the ataResources[] table is 0; a controller described in the second entry is 1. In the default configuration, the local IDE disk is 0; the PCMCIA ATA drive is 1.

    number of drives
    number of drives on the controller: maximum of two drives per controller is supported.

    interrupt vector
    interrupt vector

    interrupt level
    IRQ level

    configuration type
    configuration type

    semaphore timeout
    timeout value for the semaphore in the device driver.

    watchdog timeout
    timeout value for the watchdog in the device driver.

    The ataDevCreate( ) routine installs an ATA/IDE disk device in VxWorks. You must call ataDevCreate( ) explicitly for each local IDE disk device you wish to install; it is not called automatically. The ataDevCreate( ) routine requires the following parameters:

    controller number
    the controller: a controller described in the first entry of the ataResources[] table is 0; a controller described in the second entry is 1. In the default configuration, the local IDE disk is 0; the PCMCIA ATA drive is 1.

    drive number
    the drive: the first drive of the controller is 0; the second drive of the controller is 1. In the default configuration, MS-DOS drive C: is 0 on controller 0.

    number of blocks
    the size of the device.

    offset
    the number of blocks to leave unused at the start of a disk.

    If the configuration type specified with ataDrv( )is 0, the ATA/IDE driver does not initialize drive parameters. This is the right value for most PC hardware, where the ROMBIOS initialization takes care of initializing the ATA/IDE drive. If you have custom hardware and the ATA/IDE drive is not initialized, set the configuration type to 1 to cause the driver to initialize drive parameters.

    The drive parameters are the number of sectors per track, the number of heads, and the number of cylinders. The table has two other members used by the driver: the number of bytes per sector, and the precompensation cylinder. For each drive, the information is stored in an ATA_TYPE structure, with the following elements:

    int cylinders;       /* number of cylinders           */ 
    int heads;           /* number of heads               */ 
    int sectorsTrack;    /* number of sectors per track    */ 
    int bytesSector;     /* number of bytes per sector     */ 
    int precomp;        /* precompensation cylinder      */

    A structure for each drive is stored in the ataTypes[] table in sysLib.c. That table has two sets of entries: the first is for drives on controller 0 (the local IDE disk) and the second is for drives on controller 1 (the PCMCIA ATA card). The table is defined as follows:

    ATA_TYPE ataTypes[ATA_MAX_CTRLS][ATA_MAX_DRIVES] = 
        { 
        {{761, 8, 39, 512, 0xff},        /* ctrl 0 drive 0 */ 
         {761, 8, 39, 512, 0xff}},       /* ctrl 0 drive 1 */ 
        {{761, 8, 39, 512, 0xff},        /* ctrl 1 drive 0 */ 
         {761, 8, 39, 512, 0xff}},       /* ctrl 1 drive 1 */ 
        };

    The ioctl( ) function FIODISKFORMAT always returns ERROR for this driver, because ATA/IDE disks are always preformatted and bad sectors are already mapped.

    If INCLUDE_ATA_SHOW is selected for inclusion, the routine ataShow( ) displays the table and other drive parameters on the standard output device. This routine requires two parameters: controller number, which must be either 0 (local IDE) or 1 (PCMCIA ATA), and drive number, which must be either 0 or 1.

    Another routine associated with the ATA/IDE disk driver is ataRawio( ). This routine allows you to read and write directly to the device; thus, the overhead associated with moving data through a file system is eliminated. The ataRawio( ) routine requires the following parameters:

    controller number
    the controller: a controller described in the first entry of the ataResources[] table is 0; a controller described in the second entry is 1. In the default configuration, the local IDE disk is 0; the PCMCIA ATA drive is 1.

    drive number
    the drive: the first drive of the controller is 0; the second drive of the controller is 1. In the default configuration, MS-DOS drive C: is 0 on controller 0.

    ATA_RAW ptr
    pointer to the ATA_RAW structure, where the data that is being read and written is stored; see below.

    The following is the definition of the ATA_RAW structure:

    typedef struct ataRaw 
        { 
        UINT     cylinder;  /* cylinder (0 -> (cylinders-1))   */ 
        UINT     head;      /* head (0 -> (heads-1))           */ 
        UINT     sector;    /* sector (1 -> sectorsTrack)      */ 
        UINT     *pBuf;     /* ptr to buff (bytesSector*nSecs) */ 
        UINT     nSecs;     /* #of sectors (1 -> sectorsTrack) */ 
        UINT     direction; /* read=0, write=1                 */ 
        } ATA_RAW;

    The resource table used by ataDrv( ), ataResources[], is defined in sysLib.c as follows:

    ATA_RESOURCE ataResources[ATA_MAX_CTRLS] = 
        { 
        { 
        { 
        5, 0, 
        {ATA0_IO_START0, ATA0_IO_START1}, {ATA0_IO_STOP0, ATA0_IO_STOP1}, 
         0, 0, 0, 0, 0, 0 
         } 
        IDE_LOCAL, 1, ATA0_INT_VEC, ATA0_INT_LVL, ATA0_CONFIG, 
        ATA_SEM_TIMEOUT, ATA_WDG_TIMEOUT, 0, 0 
        },   /* ctrl 0 */ 
        { 
        { 
        5, 0, 
        {ATA1_IO_START0, ATA1_IO_START1}, {ATA1_IO_STOP0, ATA1_IO_STOP1}, 
         0, 0, 0, 0, 0, 0 
         } 
        ATA_PCMCIA, 1, ATA1_INT_VEC, ATA1_INT_LVL, ATA1_CONFIG, 
        ATA_SEM_TIMEOUT, ATA_WDG_TIMEOUT, 0, 0 
        },   /* ctrl 1 */ 
        };

    Each resource in the table is an ATA_RESOURCE structure, defined as follows:

    typedef struct ataResource      /* PCCARD ATA resources */ 
        { 
        PCCARD_RESOURCE resource;  /* must be the first member           */ 
        int     ctrlType;          /* controller type: IDE_LOCAL         */ 
                                    /* or ATA_PCMCIA                      */ 
        int     drives;            /* 1,2: number of drives              */ 
        int     intVector;         /* interrupt vector                   */ 
        int     intLevel;          /* IRQ level                          */ 
        int     configType;        /* 0,1: configuration type            */ 
        int     semTimeout;        /* timeout seconds for sync semaphore */ 
        int     wdgTimeout;        /* timeout seconds for watch dog      */ 
        int     sockTwin;          /* socket number for twin card        */ 
        int     pwrdown;           /* power down mode                    */ 
        } ATA_RESOURCE;


    *

    CAUTION: This structure applies to both ATA PCMCIA PC cards and local IDE hard disks. For the definition of PCCARD_RESOURCE, see PCMCIA for x86 Release Notes and Supplement.

    Line Printer Driver

    This release of VxWorks for the x86 supports write operations to an LPT line printer driver.

    To include the line printer driver in your configuration, select the macro INCLUDE_LPT for inclusion in the project facility VxWorks view. When INCLUDE_LPT is included, the initialization routine lptDrv( ) is called automatically from usrRoot( ) in usrConfig.c.

    The resource table used by lptDrv( ) is stored in the structure lptResource[] in sysLib.c. The resources are defined as follows:

    int   ioBase;             /* IO base address             */ 
    int   intVector;          /* interrupt vector            */ 
    int   intLevel;           /* interrupt level             */ 
    BOOL  autofeed;           /* TRUE if enable autofeed     */ 
    int   busyWait;           /* loop count for BUSY wait    */ 
    int   strobeWait;         /* loop count for STROBE wait  */ 
    int   retryCnt;          /* timeout second for syncSem */

    lptDrv( ) takes two arguments. The first argument is the number of channels (0, 1, or 2). The second argument is a pointer to the resource table.

    To change lptDrv( )'s interrupt vector or interrupt level, change the value of the appropriate constant (LPT_INT_VEC or LPT_INT_LVL) in pc.h.

    Many of the LPT driver's routines are accessible only through the I/O system. However, the following routines are available (see the manual pages for details):

    lptDevCreate( )
    installs an LPT device into VxWorks. Call lptDevCreate( ) explicitly for each LPT device you wish to install; it is not called automatically. This routine takes the following parameters:

    name = device name

    channel = physical device channel (0, 1, or 2)

    lptAutofeed( )
    enables or disables the autofeed feature; takes the parameter channel (0, 1, or 2).

    lptShow( )
    if INCLUDE_LPT is defined, shows driver statistics; takes the parameter channel (0, 1, or 2).

    In addition, you can perform the following ioctl( ) functions on the LPT driver:

    LPT_GETSTATUS
    gets the value of the status register; takes an integer value where status is stored

    LPT_SETCONTROL
    sets the control register; takes a value for the register

    Advanced Programmable Interrupt Controllers (APICs)

    This module is a driver for the Intel 82093 I/O APIC (Advanced Programmable Interrupt Controller).

    The Local and I/O APICs support 240 distinct vectors in the range of 16 to 255. Interrupt priority is implied by its vector, according to the following relationship:

    priority = vector / 16

    One is the lowest and 15 is the highest. Vectors 16 through 31 are reserved for exclusive use by the processor. The remaining vectors are for general use. The processor's Local APIC includes an in-service entry and a holding entry for each priority level. To avoid losing interrupts, software should allocate no more than 2 interrupt vectors per priority.

  • I/O APIC
  • The I/O APIC unit consists of a set of interrupt input signals, a 24-entry by 64-bit interrupt redirection table, programmable registers, and a message unit for sending and receiving APIC messages over the APIC bus. I/O devices inject interrupts into the system by asserting one of the interrupt lines to the I/O APIC. The I/O APIC selects the corresponding entry in the redirection table and uses the information in that entry to format an interrupt request message. Each entry in the redirection table can be individually programmed to indicate edge/level sensitive interrupt signals, the interrupt vector and priority, the destination processor, and how the processor is selected (statically and dynamically). The information in the table is used to transmit a message to other APIC units (via the APIC bus).

    I/O APIC is used in the symmetric I/O mode (define SYMMETRIC_IO_MODE in config.h). The base address of I/O APIC is determined in loApicInit( ) and stored in the global variable ioApicBase. ioApicInit( ) initializes the I/O APIC with information stored in the redTable[]. The redTable[] has three entries: lsw, vectorNo, and mask. The lsw entry stores the least significant word of the I/O APIC redirection table. That word indicates the trigger mode, interrupt input pin polarity, destination mode, and delivery mode. The vectorNo entry is the vector number of the redirection table. The mask entry should be 0; it is used by ioApicIntLock( ) and ioApicIntUnlock( ) to hold the interrupt mask status. ioApicShow( ) shows the contents of the I/O APIC registers.

  • Local APIC
  • This module is a driver for the Intel PentiumPro's Local APIC (Advanced Programmable Interrupt Controller).

    Local APIC controls the dispatching of interrupts that it receives either locally or from the I/O APIC to its associated processor. It provides facilities for queuing, nesting, and masking interrupts. It handles the interrupt delivery protocol with its local processor, accesses APIC registers, and manages interprocessor interrupts and remote APIC register reads. A timer on the Local APIC allows local generation of interrupts, and local interrupt pins permit local reception of processor-specific interrupts. The Local APIC can be disabled and used in conjunction with a standard 8259-A style interrupt controller.

    The base address of the Local APIC is not fixed. The BIOS writes the base address in some standard memory ranges as specified in Intel MP Specification Version 1.4. The initialization routine scans certain memory regions as specified in the specification, to determine the base addresses. It uses the LOAPIC_BASE and IOAPIC_BASE values defined in pc.h if it is not able to find the addresses in the MP configuration table. Local APIC is used in the virtual wire mode (define VIRTUAL_WIRE_MODE in config.h) and the symmetric I/O mode (define SYMMETRIC_IO_MODE in config.h), but not in the PIC Mode.

    loApicInit( ) initializes the Local APIC for the interrupt mode chosen.

    loApicShow( ) shows the Local APIC registers.

    mpShow( ) shows the MP configuration table.

  • Local APIC Timer
  • This library contains routines for the timer on the Intel PentiumPro's Local APIC.

    Local APIC contains a 32-bit programmable timer for use by the local processor. This timer is configured through the timer register in the local vector table. The time base is derived from the processor's bus clock, divided by a value specified in the divide configuration register. After reset, the timer is initialized to zero. The timer supports one-shot and periodic modes. The timer can be configured to interrupt the local processor with an arbitrary vector.

    This library gets the system clock from the Local APIC timer and the auxiliary clock from either RTC or PIT channel 0 (define PIT0_FOR_AUX in the BSP). The macro TIMER_CLOCK_HZ must also be defined in pc.h to indicate the clock frequency of the Local APIC Timer.

    The macros SYS_CLK_RATE_MIN, SYS_CLK_RATE_MAX, AUX_CLK_RATE_MIN, and AUX_CLK_RATE_MAX must be defined to provide parameter checking for the sysAuxClkRateSet( ) and sysClkRateSet( )routines. They are located in the project facility under INCLUDE_SYSCLK_INIT and INCLUDE_AUX_CLK.

    This driver uses PentiumPro's on-chip TSC (see Time Stamp Counter (TSC)) for the time stamp driver.

    The PentiumPro processor provides a 64-bit time-stamp counter that is incremented every processor clock cycle. The counter is incremented even when the processor is halted by the HLT instruction or the external STPCLK# pin. The time-stamp counter is set to 0 following a hardware reset of the processor. The RDTSC instruction reads the time stamp counter and is guaranteed to return a monotonically increasing unique value whenever executed, except for 64-bit counter wraparound. Intel guarantees, architecturally, that the time-stamp counter frequency and configuration will be such that it will not wraparound within 10 years after being reset to 0. The period for counter wrap is several thousands of years in the PentiumPro and Pentium processors.


    1:  You can use a boot ROM if you install the Blunk Microsystems ROM Card 1.0; see ROM Card and EPROM Support.

    2:  Before making either version of the image, make sure that DEFAULT_BOOT_LINE in config.h is set correctly, and that the size of the boot image (text+data+bss) is less than 512KB. It cannot be larger than this, because x86 chips boot in "real" mode and therefore do have access to all available memory until later in the boot process.

    3:  For embedded applications, actual disk drives are often replaced by solid state disks. Because there are no moving parts, boot performance and reliability are increased.

    4:  The prefix board is an abbreviation for the corresponding network board. For example, the abbreviation for the 3Com EtherLink III board is elt, so the show routine is eltShow( ).