For the pc386 and pc486 BSPs, you have the option of including a fully functional PCMCIA interface driver that TrueFFS can use to handle its socket layer interface. You can use this PCMCIA driver instead of the PCIC driver. The PCMCIA interface driver is designed to support a wide variety of PC card devices, including flash memory card devices. It supports hot swapping and is careful to check the type of the device in the PCMCIA socket before it sends any commands to the device.1
Of course, there are situations in which you need some support for PC flash cards but could do without all the services provided by the PCMCIA driver. In such cases, you should use the simple PCIC driver with pc386sysTffs.c. The PCIC driver does not support hot swapping, nor does it check the device type before sending commands to the socket. However, the PCIC code is quite small.
The changes described in Changing the Makefile, and Changing sysTffs.c, apply to both the pc386 and pc486 BSPs. However, the changes you must make to config.h and syslib.c differ as described below.
If you want to use the simple PCIC driver, follow the instructions in Changing config.h. To use the PCMCIA driver you will need to modify config.h as described below.
The PCMCIA interface driver is a product offering distinct from TrueFFS for Tornado. To include it in VxWorks, you must define INCLUDE_PCMCIA in your config.h file. Because this PCMCIA interface driver must support TrueFFS for Tornado, you must also add INCLUDE_TFFS to the list of devices that PCMCIA includes. Thus, in addition to defining INCLUDE_PCMCIA, your config.h make sure that your config.h also defines the following:
#ifdef INCLUDE_PCMCIA #define INCLUDE_TFFS /* include TFFS driver */ #define INCLUDE_ATA /* include ATA driver */ #define INCLUDE_SRAM /* include SRAM driver */ #ifdef INCLUDE_NETWORK #define INCLUDE_ELT /* include 3COM EtherLink III driver */ #endif /* INCLUDE_NETWORK */ #endif /* INCLUDE_PCMCIA */
If you are using the M-System DiskOnChip 2000 product, you might run in to address conflicts with the PCMCIA product. To resolve conflict, redefine the CIS macros as follows:
#ifdef INCLUDE_TFFS #undef CIS_MEM_START #undef CIS_MEM_STOP #undef CIS_REG_START #undef CIS_REG_STOP #define CIS_MEM_START 0xc8000 /* mapping addr for CIS tuple */ #define CIS_MEM_STOP 0xcbfff #define CIS_REG_START 0xcc000 /* mapping addr for config reg */ #define CIS_REG_STOP 0xccfff #endif /* INCLUDE_TFFS */
If your C: drive is a DiskOnChip 2000 device, and, if you boot from it instead of floppy disk, set the sysWarmType global variable to 3. This specifies a warm start from the DiskOnChip 2000 device. To enable rebooting from the TrueFFS flash device, you must change sysLib.c as follows:
After the declaration of the sysWarmAtaDrive variable, add the following:
int sysWarmTffsDrive = SYS_WARM_TFFS_DRIVE; /* TFFS drive 0 (DOC) */
In the function sysToMonitor( ), find the clause that defines the reboot process for the reboot device ATA. After the #endif statement for INCLUDE_ATA, add the following:
#ifdef INCLUDE_TFFS if (sysWarmType == 3) { IMPORT int dosFsDrvNum; tffsDrv (); /* initialize TFFS */ if (dosFsDrvNum == ERROR) dosFsInit (NUM_DOSFS_FILES); /* initialize DOS-FS */ if (usrTffsConfig (sysWarmTffsDrive, FALSE, "/vxboot/") == ERROR) { printErr ("usrTffsConfig failed.\n"); return (ERROR); } } #endif /* INCLUDE_TFFS */
#if (defined (INCLUDE_FD) || defined (INCLUDE_ATA)) if ((sysWarmType == 1) || (sysWarmType == 2))
Replace them with the following:
#if (defined(INCLUDE_FD) || defined(INCLUDE_ATA) ||defined(INCLUDE_TFFS)) if ((sysWarmType == 1) || (sysWarmType == 2) || (sysWarmType == 3))
#endif /* defined (INCLUDE_FD) || defined (INCLUDE_ATA) */
Replace it with the following:
#endif /* (INCLUDE_FD) || (INCLUDE_ATA) || (INCLUDE_TFFS) */
The following instructions show you how to setup and instantiate three TrueFFS devices (a DiskOnChip 2000 and two flash cards in the PCMCIA sockets) for a target using the pc386 or pc486 BSP. All three devices are dedicated entirely to TrueFFS and so each is formatted using tffsDevFormat( ). Notice also that the instructions do not include setting INCLUDE_TFFS or INCLUDE_DOS. That is because defining INCLUDE_PCMCIA implicitly sets those defines for you. 2
-> tffsDevFormat 0,0 -> tffsDevFormat 1,0 -> tffsDevFormat 2,0 -> usrTffsConfig 0,0,"/DOC/" -> usrTffsConfig 1,1,"/PCMCIA1/" -> usrTffsConfig 2,1,"/PCMCIA2/"
The DiskOnChip 2000 uses BIOS extensions to make itself appear to the BIOS as a hard disk. This section outlines the procedures you must follow to make sure that the DiskOnChip 2000 device correctly presents itself to the BIOS as a hard disk. VxWorks can then use the DiskOnChip 2000 as a boot device (just as if it were a floppy driver or a conventional hard disk).
You may install the VxWorks boot code using either DOS or the commands available from a VxWorks target shell.
To use this method, you must be able to connect a floppy drive to your target. You must also be able to boot DOS on the target.
mkboot flash_disk_drive_letter: bootrom_uncmp
To use this method, you need an Ethernet connection to your target. After installing TrueFFS for Tornado and building VxWorks with TrueFFS included, reboot your target.
-> ld < path_to_target_BSP_directory/mkboot.o -> mkbootTffs 0,0,"path_to_target_BSP_directory/bootro~1"
1: Support for "hot swapping" means registering a function to handle the interrupt generated when the user removes a device from the PCMCIA socket.
2: The DiskOnChip 2000 is a "disk on chip" device supplied by M-Systems.
3: There are two versions of mkboot; one that runs on DOS, and one that runs on VxWorks. The purpose of mkboot is to install the VxWorks boot code on the boot disk. Both versions expect that the system tracks have been installed from DOS's format utility using the /s switch. For more information, see the x86 release notes.