Detail
Question : How to boot VxWorks from Vmpc6x User Flash using SCSI disk ?
Answer :
Here is a method which explains:
I How to configure BSP to include SCSI facilities ?
- Config.h
- bootConfig.c
- sysScsi.c
- ncrLib.a
II How to update VxWorks bootrom with SCSI included ?
- Upgrade Boot ROM Using VMPCBug firmware
- Upgrade VxWorks kernel
III Generate a standalone VxWorks kernel to be stored on the SCSI disk
IV How to access and configure the SCSI disk under VxWorks ?
V How to boot from SCSI disk ?
VI How to boot a second board from same first SCSI disk ?
It has been tested on:
Software configuration:
Solaris and windows NT 4, Tornado 2.2 environment.
BSP ID02248 under Tornado2.2/vxWorks5.5
Hardware:
Vmpc6c,6a board.
9Go QUANTUM FIREBALL SCSI disk
I How to configure BSP to include SCSI facilities ?
In order to use the scsiLib facilities in VxWorks, SCSI support has to be added to VxWorks kernel. To do so, Change or add the indicated lines on several files in the BSP directory (/target/config/).
1 Config.h :
/* symbol table management */
#define INCLUDE_NET_SYM_TBL
#define INCLUDE_NETWORK
#define INCLUDE_NET_INIT
#define INCLUDE_STAT_SYM_TBL
#define INCLUDE_SYM_TBL
#define INCLUDE_SYM_TBL_INIT
/* Traces */
#define INCLUDE_SHOW_ROUTINES
#define INCLUDE_NET_SHOW
#define INCLUDE_SYM_TBL_SHOW
/* Target Shell */
#define INCLUDE_SHELL
#define INCLUDE_LOADER
/* scsi support */
#define INCLUDE_SCSI
#define INCLUDE_SCSI_BOOT /* Booting from SCSI (new ROMs must be made */
#define SYS_SCSI_CONFIG /* Call sysScsiConfig() in sysScsi.c */
/* dosFS support */
#define INCLUDE_DOSFS /* DosFS 1.0 support */
#define INCLUDE_DOSFS_MAIN /* DosFS 2.0 support */
#define INCLUDE_DISK_UTIL
2 bootConfig.c
In routine scsiLoad, about line number 3060 after /* now support booting from partitions on SCSI devices */, add the following line :
#if PARTITION_MANAGEMENT_USED
about line number 3081 just before /* load the boot file */ add the following lines :
#else
scsiShow(pSysScsiCtrl);
if (dosFsDevInit ("/sd0/", (CBIO_DEV_ID)pScsiBlkBootDev, 0) == NULL)
{
printErr ("dosFsDevInit failed.\n");
return (ERROR);
}
printErr ("done.\n");
#endif
3 sysScsi.c
At the end of sysScsi.c file create your own routine syScsiConfig() :
#ifdef SYS_SCSI_CONFIG
/* Data for example code */
#include "dosFsLib.h"
SCSI_PHYS_DEV * pSpd20; /* SCSI_PHYS_DEV ptrs (suffix == ID, LUN) */
BLK_DEV * pSbd0;
/*******************************************************************************
*
* sysScsiConfig - Example SCSI device setup code
*
* This is an example of a SCSI routine, that could be added to the BSP
* sysLib.c file to perform SCSI disk/tape setup.
* Define SYS_SCSI_CONFIG to have the kernel call this routine
* as part of usrScsiConfig().
*
* You must edit this routine to reflect the actual configuration of your SCSI bus.
* This example is found in src/config/usrScsi.c.
*
* If you are just getting started, you can test your hardware configuration
* by defining SCSI_AUTO_CONFIG in config.h, 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.
*/
STATUS sysScsiConfig (void)
{
/*
* The following section of code provides sample configurations within
* VxWorks of SCSI peripheral devices and VxWorks file systems. It
* should however be noted that the actual parameters provided to
* scsiPhysDevCreate(), scsiBlkDevCreate(), dosFsDevInit() etc., are
* highly dependent upon the user environment and should therefore be
* modified accordingly.
*/
/* configure a SCSI hard disk at busId = 0, LUN = 0 */
if ((pSpd20 = scsiPhysDevCreate (pSysScsiCtrl, 0, 0, 0, NONE, 0, 0, 0)) == (SCSI_PHYS_DEV *) NULL)
{
printErr ("usrScsiConfig: scsiPhysDevCreate failed.\n", 0, 0, 0, 0, 0, 0);
}
else
{
/* create block devices */
if (((pSbd0 = scsiBlkDevCreate (pSpd20, 0, 0)) == NULL))
{
return (ERROR);
}
if ((dosFsDevInit ("/sd0/", pSbd0, NULL) == NULL) )
{
return (ERROR);
}
}
return(OK);
}
#endif /* SYS_SCSI_CONFIG */
4 ncrLib.a
This library must be modified, you have to install the patch bsp02248-T2.2-3 that correct the CRP 2713
II How to update VxWorks bootrom with SCSI included ?
In order to include SCSI facilities, you have to regenerate bootrom.bin and VxWorks kernel
1 Upgrade Boot ROM Using VMPCBug firmware
For more details, refer to the VxWorks BSP documentation (Flashing the Boot ROM Using VMPCBug firmware chapter) and Thales Computers PowerEngine VMPCBug User's Manual.
In the BSP directory, execute these commands :
make clean
make bootrom.bin
The download is made by Ethernet link with a jumper placed on LK2 on Vmpc board and execute the command :
COMMAND> tftpget 192.54.144.173:?,192.54.144.189;t
d:/tornado2.2/.../bootrom.bin
with, for example :
192.54.144.173 = Ip address of the machine that contain the file bootrom.bin (Host machine),
192.54.144.189 = Ip adress of the Vmpc board.
d:/tornado2.2/.../bootrom.bin = An example of the location of the bootrom.bin file on the Host machine
Be Careful, the two machines have to be on the same network.
Once this step is right, execute the following command to write the file in the bootrom.
COMMAND> iop
(R)ead / (W)rite / (F)ormat / rewin(D) [R]? w
Controller LUN = c ? 4
Device LUN = 0 ? 1
Memory address = 10000 ? 20000
Sector number = 0 ?
Number of sector = 1 ? 400
........
2 Upgrade VxWorks kernel
In the BSP directory, execute these commands : make clean make vxWorks Now, VxWorks can be executed with the command : go ffe00000 at the ' COMMAND>' prompt COMMAND> go ffe00000 GO at the effective address 0xffe00000 VxWorks System Boot Copyright 1984-2002 Wind River Systems, Inc. CPU: VMPC6c Version: VxWorks5.5 BSP version: 1.2/02248 Creation date: Feb 5 2003, 13:37:33 Press any key to stop auto-boot... 0 auto-booting... boot device : dec unit number : 0 processor number : 0 host name : HOST file name : /Tornado2.2ppc/target/config/vmpc6c/vxworks inet on ethernet (e) : 192.54.144.19:ffffff00 host inet (h) : 192.93.163.10 gateway inet (g) : 192.54.144.232 user (u) : support flags (f) : 0x8 Ethernet unit 0 Link 100Mbps UP Attached TCP/IP interface to dec0. Attaching network interface lo0... done. Loading... 1330928 Starting at 0xa0000... Target Name: vxTarget Ethernet unit 0 Link 100Mbps UP Attached TCP/IP interface to dec unit 0 Attaching network interface lo0... done. Loading symbol table from HOST:/Tornado2.2ppc/target/config/vmpc6c/vxworks.sym ...de ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]] ]]]] ]]]]]]]]]] ]] ]]]] (R) ] ]]]]]]]]] ]]]]]] ]]]]]]]] ]] ]]]] ]] ]]]]]]] ]]]]]]]] ]]]]]] ] ]] ]]]] ]]] ]]]]] ] ]]] ] ]]]] ]]] ]]]]]]]]] ]]]] ]] ]]]] ]] ]]]]] ]]]] ]]] ]] ] ]]] ]] ]]]]] ]]]]]] ]] ]]]]]]] ]]]] ]] ]]]] ]]]]] ] ]]]] ]]]]] ]]]]]]]] ]]]] ]] ]]]] ]]]]]]] ]]]] ]]]]]] ]]]]] ]]]]]] ] ]]]]] ]]]] ]] ]]]] ]]]]]]]] ]]]] ]]]]]]] ]]]]] ] ]]]]]] ] ]]] ]]]] ]] ]]]] ]]]] ]]]] ]]]] ]]]]]]]] ]]]]] ]]] ]]]]]]] ] ]]]]]]] ]]]] ]]]] ]]]] ]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]] Development System ]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]] VxWorks version 5.5 ]]]]]]]]]]]]]]]]]]]]]]]]]] KERNEL: WIND version 2.6 ]]]]]]]]]]]]]]]]]]]]]]]]] Copyright Wind River Systems, Inc., 1984-2002 CPU: VMPC6c. Processor #0. Memory Size: 0x1f80000. BSP version 1.2/02248. WDB Comm Type: WDB_COMM_NETWORK WDB: Ready. USB: OHCI version -> 1.0, legacy support USB: CMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 USB: 2 ports with 2 removable, self powered -> If boot parameters are not correctly set, use these commands : [VxWorks Boot]: p --> display the parameters [VxWorks Boot]: c --> change the parameters [VxWorks Boot]: h --> display all the commands [VxWorks Boot]: @ --> download and boot the VxWorks kernel If you have already booted vxWorks, you can return at '[VxWorks Boot]' prompt in order to download another kernel by executing one of the following command : -> reboot or -> CTRL^X.
III Generate a standalone VxWorks kernel to be stored on the SCSI disk
In order to simplify the operations, the symbols table will be included in VxWorks image. So, you have to modify the file config.h of your BSP :
Add the lines :
#define INCLUDE_STANDALONE_SYM_TBL
#define STANDALONE_NET
And suppress the line :
#define INCLUDE_NET_SYM_TBL
In the BSP directory, execute these commands :
Make clean
Make vxWorks.st
IV How to access and configure the SCSI disk under VxWorks ?
Usually a file system is attached to a SCSI device. One of the popular VxWorks file systems is the DOS file system (dosFs). The easiest way to make a new file system is with the dosFsMkfs() call. dosFsMkfs() expects as parameters a volume name (or drive name) and a pointer to a BLK_DEV structure. To do this with a SCSI device, one must use routines from scsiLib to define a logical block device on the actual SCSI unit. The actual call to dosFsMkFs() is detailed below.
First, get some info on the device in question:
-> scsiShow ID LUN VendorID ProductID Rev. Type Blocks BlkSize pScsiPhysDev -- --- -------- ---------------- ---- ---- -------- ------- ------------ 0 0 QUANTUM FIREBALL SE2.1S PJ0A 0 4201304 512 0x01df7ee0 value = 0 = 0x0
The steps to define this logical block device are as follows:
1) To get a pointer to a SCSI_PHYS_DEV structure (call this pDisk). One will need to refer to the info from scsiShow(), or to use the scsiPhysDevIdGet() call. (See VxWorks 5.4 Reference Manual entry of scsiPhysDevIdGet() for details.) scsiPhysDevIdGet() returns * SCSI_PHYS_DEV.
Using scsiPhysDevIdGet():
-> pDisk=scsiPhysDevIdGet(pSysScsiCtrl,0,0) new symbol "pDisk" added to symbol table. pDisk = 0x1f7ffe0: value = 31424224 = 0x1df7ee0 ->
The first " 0 " parameter come from the disk SCSI ID and the second from the LUN of the device.
2) To get the pointer to a BLOCK_DEV structure. scsiBlkDevCreate() returns this when given: a pointer to a SCSI_PHYS_DEV structure, the number of blocks to use on the device, and an offset to the first block. Arbitrarily 2000 blocks are used, with an offset of 0 blocks (an offset of 0 blocks specifies this block device will start at the beginning of the physical device). (See VxWorks 5.4 Reference Manual entry of scsiBlkDevCreate() for more details.)
-> pBlockDev = scsiBlkDevCreate(pDisk,0x2000,0x0) new symbol "pBlockDev" added to symbol table. pBlockDev = 0x2a5310: value = 16765968 = 0xffd410 ->
pBlockDev is a pointer to a BLOCK_DEV structure which may be used with dosFsMkFs(). The dosFsMkfs() call returns a pointer to a DOS_VOL_DESC structure (see the manual entry for more detail):
-> pdosVolDescript = dosFsMkfs("/sd0/",pBlockDev) new symbol "pdosVolDescript" added to symbol table. pdosVolDescript = 0x2a52f0: value = 12557552 = 0xbf9cf0 ->
The "device" created is named "/sd0/" which is now ready for use. The devs command shows:
-> devs drv name 0 /null 1 /tyCo/0 1 /tyCo/1 1 /tyCo/2 1 /tyCo/3 5 HOST: 6 /vio 3 /sd0/ value = 0 = 0x0 ->
SCSI disk can eventually be formatted with command
-> DiskFormat("/sd0/")
You can now copy the VxWorks kernel on the SCSI disk, by using the command :
-> copy "HOST:/Tornado2.2ppc/target/config/vmpc6c/vxWorks.st","/sd0/vxWorks.st" Copy OK: 1455133 bytes copied value = 0 = 0x0 -> cd "/sd0/" value = 0 = 0x0 -> ls vxWorks.st value = 0 = 0x0 ->
Note : Only SCSI Disk of SCSI2 type are supported by VxWorks drivers.
V How to boot from SCSI disk ?
You have to modify boot parameters of VxWorks in order to boot on SCSI disk:
[VxWorks Boot]: c '.' = clear field; '-' = go to previous field; ^D = quit boot device : dc0 scsi=0,0 processor number : 0 host name : HOST file name : /tornado2.2/.../vxWorks /sd0/vxWorks.st inet on ethernet (e) : 192.54.144.189 inet on backplane (b): 192.41.3.1 host inet (h) : 192.54.144.173 gateway inet (g) : user (u) : vxworks ftp password (pw) (blank = use rsh): xx flags (f) : 0x8 target name (tn) : rumba startup script (s) : other (o) : dec [VxWorks Boot]:
If you reboot VxWorks, you will see the following messages :
boot device : scsi=0,0 unit number : 0 processor number : 0 host name : saran file name : /sd0/vxWorks.st inet on ethernet (e) : 192.54.144.19:ffffff00 host inet (h) : 192.93.163.10 gateway inet (g) : 192.54.144.232 user (u) : support flags (f) : 0x8 Attaching to scsi device... ID LUN VendorID ProductID Rev. Type Blocks BlkSize pScsiPhysDevCreate -- --- -------- ---------------- ---- ---- -------- ------- ------------ 0 0 QUANTUM FIREBALL SE2.1S PJ0A 0 4201304 512 0x01f7db10 done. Loading /sd0/vxWorks.st... 1449424 Starting at 0xa0000... Target Name: vxTarget Ethernet unit 0 Link 100Mbps UP Attaching network interface lo0... done. Unable to add route to 192.93.163.0; errno = 0xffffffff. Adding 3756 symbols for standalone. ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]] ]]]] ]]]]]]]]]] ]] ]]]] (R) ] ]]]]]]]]] ]]]]]] ]]]]]]]] ]] ]]]] ]] ]]]]]]] ]]]]]]]] ]]]]]] ] ]] ]]]] ]]] ]]]]] ] ]]] ] ]]]] ]]] ]]]]]]]]] ]]]] ]] ]]]] ]] ]]]]] ]]]] ]]] ]] ] ]]] ]] ]]]]] ]]]]]] ]] ]]]]]]] ]]]] ]] ]]]] ]]]]] ] ]]]] ]]]]] ]]]]]]]] ]]]] ]] ]]]] ]]]]]]] ]]]] ]]]]]] ]]]]] ]]]]]] ] ]]]]] ]]]] ]] ]]]] ]]]]]]]] ]]]] ]]]]]]] ]]]]] ] ]]]]]] ] ]]] ]]]] ]] ]]]] ]]]] ]]]] ]]]] ]]]]]]]] ]]]]] ]]] ]]]]]]] ] ]]]]]]] ]]]] ]]]] ]]]] ]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]]]] Development System ]]]]]]]]]]]]]]]]]]]]]]]]]]]] ]]]]]]]]]]]]]]]]]]]]]]]]]]] VxWorks version 5.5 ]]]]]]]]]]]]]]]]]]]]]]]]]] KERNEL: WIND version 2.6 ]]]]]]]]]]]]]]]]]]]]]]]]] Copyright Wind River Systems, Inc., 1984-2002 CPU: VMPC6c. Processor #0. Memory Size: 0x1f80000. BSP version 1.2/02248. WDB Comm Type: WDB_COMM_NETWORK WDB: Ready. USB-> : OHCI version 1.0, legacy support USB: CMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 USB: 2 ports with 2 removable, self powered ->
Note : Networks is needed ?
====================
If you need the networks in this standalone VxWorks kernel you need to:
- define STANDALONE_NET in config.h
- add 'dec' in boot parameters named 'other' of VxWorks :
[VxWorks Boot]: c ... other (o) : dec
VI How to boot a second board from same first SCSI disk?
You can boot a second board with the same kernel located on scsi disk of the first VMPC board. It is necessary to use the SM network. Let say the first board connected to SCSI disk is named VMPC1 while the other board is named VMPC2. To simplify we consider we use the previous vxWorks.st file. It is necessary to add the following define when building this kernel :
/*For standalone kernel but with network*/ #define INCLUDE_STANDALONE_SYM_TBL #define STANDALONE_NET #undef INCLUDE_NET_SYM_TBL /*For SM network statistic : smNetShow */ #define INCLUDE_SM_SHOW /* To allow VMPC1 board to answer FTP connection from VMPC2 */ #define INCLUDE_FTP_SERVER
The parameters to set on both boards are for example :
VMPC1 ----------- [VxWorks Boot]: p boot device : scsi=0,0 unit number : 0 processor number : 0 host name : pcfbo file name : /sd0/vxWorks.st inet on ethernet (e) : 192.93.161.148:ffffff00 inet on backplane (b): 93.0.0.1:0xffffff00 host inet (h) : 192.93.161.133 user (u) : support ftp password (pw) : support flags (f) : 0x8 target name (tn) : vx other (o) : dec VMPC2 ----------- boot device : sm=0xc4004100 unit number : 0 processor number : 1 host name : vx file name : /sd0/vxWorks.st inet on backplane (b): 93.0.0.2 host inet (h) : 93.0.0.1 user (u) : support ftp password (pw) : support flags (f) : 0x8 target name (tn) : vxworks0
Note : In case VMPC2 must access the SCSI disk on VMPC1 board after booting, it will be necessary VMPC1 exports the " /sd0/ " directory to VMPC2 (so INCLUDE_NFS_SERVER is mandatory and use nfsExport). Also VMPC2 must mount this directory after booting using command nfsMount.