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):
|
NOTE: These utilities are also included in the Tornado tree at
installDir/host/x86-win32/bin. |
||||||||||||||||||
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.
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:
C:\> cd installDir\target\config\pc386 C:\> make bootrom_uncmp C:\> copy bootrom_uncmp bootrom.dat
C:\> copy drive:bootrom.dat c:
C:\> mkboot a: bootrom.dat
C:\> chkdsk a:bootrom.sys
[VxWorks Boot]: @
|
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.
|
||||||||||||||||||
|
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.
|
||||||||||||||||||
device=c:\dos\himem.sys dos=high,umb shell=c:\vxload.com c:\bootrom.dat
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
% cd installDir/target/config/bspName % make bootrom_uncmp % aoutToBinDec < bootrom_uncop > bootrom.sys
|
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"
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.
|
|
||||||||||||||||||
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
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
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
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
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
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
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
Use the routine usrFdConfig( )to mount the file system from a diskette. It takes the following parameters:
|
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.
|
||||||||||||||||||
Use the routine usrAtaConfig( )to mount the file system from an ATA/IDE disk. It takes the following parameters:
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:
Use pccardMkfs( ) to initialize a PC card and mount the file system from a PC card (SRAM or ATA). It takes the following parameters:
The pccardMount( ) and pccardMkfs( ) routines are provided in source form in src/drv/pcmcia/pccardLib.c.
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:
The BSP-specific global variables shown in Table D-3 apply to pc386, pc486, and epc4.
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 */
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 */
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:
In addition, the following configurations are defined in the makefile to generate Motorola S-record format from bootrom_uncmp or from vxWorks_boot.st:
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:
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.
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
1: These routines are automatically included when the board is configured. When you invoke them, their output is sent to the standard output device. |
Certain network boards are also configurable in hardware. Use the jumper settings shown in Table D-5 with the network drivers supplied.
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
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:
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.
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
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.
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
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:
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:
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;
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:
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:
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:
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.
|
||||||||||||||||||
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):
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:
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.
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.
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.
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( ).