📄 readme
字号:
dosFsVolOptionsSet() routine (see VxWorks Reference manual),
as shown by the code fragment below:
#include "fldrvvxw.h"
dosFsVolOptionsSet(tffs_dosFs_vol,
tffs_dosFs_vol->dosvd_options | DOS_OPT_CHANGENOWARN);
where 'tffs_dosFs_vol' is a pointer returned by the call to the
routine dosFsDevInit() (see Section 2.10 above).
More detailed discussion of the issues related to the unexpected
power shutdown could be found in Chapter 6 below.
===> NOTE. The disabling of the filesystem cache reduces the
I/O performance of the DiskOnChip.
2.12. Make sure your BSP configuration .H file
(Tornado/target/config/pc486/config.h in case of pc486 BSP)
excludes the following VxWorks components:
#undef INCLUDE_TFFS /* include TrueFFS driver */
#undef INCLUDE_PCMCIA /* include PCMCIA driver */
2.13 By default, dosFs runs with long filenames support disabled (option
DOS_OPT_LONGNAMES is not set), for MS-DOS compatibility reasons. If
you will not be enabling support for long filenames in dosFs,
you should skip Sections 2.14 - 2.27.
If you do want to enable this option and use long filenames, you
will need to proceed with Section 2.14.
===> NOTE. The dosFs's long filenames support is not compatible with
MS-DOS, and dosFs volumes with long filenames cannot be accessed
on MS-DOS machines. Please use dosFs long filenames option
ONLY when you really need them.
===> NOTE. While the DiskOnChip driver does support dosFs's long filenames,
it runs with some internal optimizations turned off in this mode.
This may have a negative impact on the driver's 'write'
performance (the 'read' performance is not affected).
2.14. Since the dosFs volume with long filenames support is not compatible
with MS-DOS, it can't be read by VxWorks bootsector. In another words,
it is not possible to boot VxWorks from such a volume. This means that,
in order to boot VxWorks from the DiskOnChip AND still be able to use
dosFs long filenames, two partitions need to be created on DiskOnChip:
- the primary, DOS-compatible partition which will be used to store
the bootimage BOOTROM.SYS
- the second partition which will be used to store application
files in the dosFs's long filename format
The following sections contain instructions for creating and
initializing these two partitions.
2.15. Boot DOS on the target, and start MS-DOS FDISK.EXE utility:
FDISK
If DiskOnChip is the only "hard disk" in the system, you should
see FDISK's main menu with the enries like "Delete Partition" and
"Create DOS partition or logical DOS Drive".
If FDISK asks you to select the hard disk, you will have to power
down the system, detach all the hard disks, turn the power up and
re-invoke FDISK at the DOS prompt.
2.16. Delete the existing FAT12/16 partition by selecting "Delete Partition"
(option 3), then "Delete Primary DOS Partition" (option 1).
2.17. Create boot partition by selecting "Create DOS partition or logical
DOS Drive" (option 1), then "Create Primary DOS Partition" (option 1).
When asked "Use maximum available size for that partition [Y/N]",
answer 'N', and then specify the minimum size which is sufficient for
storing VxWorks bootimage(s).
2.18. Create extended partition by selecting "Create DOS partition or logical
DOS Drive" (option 1), then "Create Extended DOS Partition" (option 2).
By default FDISK proposes to allocate all the remaining disk space to
the extended partition; you should accept this default.
Finally, FDISK offers to create logical drive that spans the entire
extended partition; you should accept this too.
2.19. Mark the primary partition as active one by selecting "Set active
partition" (option 2), and then entering '1' as the number of
partition you wish to make active.
2.20. Exit FDISK and reboot the system with DOS.
2.21. Create the FAT12/16 filesystem on the primary partition by executing :
FORMAT C:
2.22. Write VxWorks boot sector onto the primary partition by executing:
VXSYS C:
2.23. At that point you will need to create dosFs filesystem with long
filenames support on the extended partition on the DiskOnChip.
The Sections below show how to do this.
You will need to use boot scenario 'A' (boot over network) for
this purpose.
2.24. Locate the place in you application which contains the tffsDevCreate()
call (see Section 2.9), and change the 2nd arguement passed to
this call to be (FL_DOSFS_LONGNAMES | 2).
===> NOTE. Please note that if the boot scenario 'C' is used (see
Section 3.1), the routine tffsDevCreate() is called from two
places - from the application code, and from the BOOTROM.SYS
bootloader code (Tornado/target/config/all/bootConfig.c,
see Section 3.11). Only the application code should pass
((FL_DOSFS_LONGNAMES | 2) to tffsDevCreate() as 2nd arguement,
because application is looking for access to the extended
partition (where application stores it's files). The bootloader
code in bootConfig.c always passes zero as 2nd arguement to
tffsDevCreate(), because bootloader code is looking for access
to the primary partition (where VxWorks application is stored).
2.25. Locate the place in your application which contains dosFsDevInit()
call (see Section 2.10), and temporary change this code section to look
like this:
#include "fldrvvxw.h"
#if FALSE
DOS_VOL_DESC *tffs_dosFs_vol =
dosFsDevInit ("/tffs0/", tffs_blk_dev, NULL);
#else
/*
Temporary code to initialize extended partition for use
with dosFs's long filenames
*/
#include "stdio.h"
#include "stdlib.h"
if (dosFsMkfsOptionsSet(DOS_OPT_LONGNAMES) == ERROR)
printf ("Temporary code : dosFsMkfsOptionsSet() failed\n");
else
{
DOS_VOL_DESC *tffs_dosFs_vol = dosFsMkfs ("/tffs0/", tffs_blk_dev);
if (tffs_dosFs_vol == NULL)
printf("Temporary code : dosFsMkfs() failed\n");
else
{
printf ("Temporary code : dosFs volume has been successfully initialized\n");
printf (" for long filenames. The temporary code is not\n")
printf (" needed anymore, please remove it.\n");
}
}
printf ("Halting the boot.\n");
while (TRUE)
;
#endif
2.26. Build your application, download it to the target over network (recall
that we are using boot scenario 'A'), and run it.
Normally the application should display the following messages:
Temporary code : dosFs volume has been successfully initialized
for long filenames. The temporary code is not
needed anymore, please remove it.
and hang up (see infinite while(TRUE) loop in Section 2.25 above).
2.27. Locate the place in your application which contains dosFsDevInit()
call (see Section 2.25), and remove temporary code from this code section:
#include "fldrvvxw.h"
DOS_VOL_DESC *tffs_dosFs_vol =
dosFsDevInit ("/tffs0/", tffs_blk_dev, NULL);
#if FALSE
/*
Temporary code to initialize extended partition for use
with dosFs's long filenames
*/
#include "stdio.h"
#include "stdlib.h"
if (dosFsMkfsOptionsSet(DOS_OPT_LONGNAMES) == ERROR)
printf ("Temporary code : dosFsMkfsOptionsSet() failed\n");
else
{
DOS_VOL_DESC *tffs_dosFs_vol = dosFsMkfs ("/tffs0/", tffs_blk_dev);
if (tffs_dosFs_vol == NULL)
printf("Temporary code : dosFsMkfs() failed\n");
else
{
printf ("Temporary code : dosFs volume has been successfully initialized\n");
printf (" for long filenames. The temporary code is not\n")
printf (" needed anymore, please remove it.\n");
}
}
printf ("Halting the boot.\n");
while (TRUE)
;
#endif
3. Booting VxWorks/x86 from the DiskOnChip.
-------------------------------------------
3.1. There are three basic VxWorks boot scenarios supported by the
TrueFFS driver, namely:
A. Network boot
The DiskOnChip-resident bootfile BOOTROM.SYS acts as a secondary
program loader and uses a network connection to bring the
VxWorks application from a remote host. This scenario is usually
used during application development/debugging stage.
B. One-step standalone boot
The DiskOnChip resident bootfile BOOTROM.SYS includes the
application itself. This scenario is used for relatively small
applications that entirely fit into the 640KB of low RAM, directly
accessible by the BIOS.
C. Two-step standalone boot
The DiskOnChip resident bootfile BOOTROM.SYS acts as a secondary
program loader and loads the application from the DiskOnChip.
This scenario is used with large size VxWorks applications where
scenario 'B' cannot be used because of the application's size.
Boot scenarios 'A' and 'B' are supported by the TrueFFS driver.
There is no need to make any changes in the VxWorks boot code.
Boot scenario 'C' requires some minimal changes to be done to
the following VxWorks files:
- BSP configuration .H file (i.e. Tornado/target/config/pc486/
config.h in case of pc486 BSP)
- Tornado/target/config/all/bootConfig.c
- Tornado/target/config/all/usrConfig.c
The procedures outlined in Sections 3.2 - 3.6 below are common for all
three boot scenarios. If you are using boot scenario 'C', also
follow the extra procedures outlined in Sections 3.8 - 3.17 below.
3.2. Make sure that you have the following the software and hardware:
- Standard M-Systems's DFORMAT.EXE utility for DOS. This
utility can be be downloaded from M-Systems' website
(http://www.m-sys.com).
- DiskOnChip firmware file DOC123.EXB file (where '123' is the
firmware version). This file can be can be downloaded from
M-Systems' website (http://www.m-sys.com).
- Standard VxWorks's VXSYS utility
- VxWorks bootfile BOOTROM.SYS
- DOS-bootable floppy
- standard DOS utilities FDISK.EXE and FORMAT.EXE
3.3. If you have enabled support for dosFs's long filenames (as described in
Sections 2.14 - 2.27), skip to Section 3.9, otherwise proceed
with Sections 3.4 - 3.6 below.
3.4. Boot DOS on the target board from the DOS diskette, and re-format the
DiskOnChip by running M-Systems' DFORMAT.EXE utility at the DOS prompt
as shown below:
DFORMAT /WIN={address} /S={firmware} /FIRST /Y
where {address} is the base address of the DiskOnChip (i.e. D000,
D400, etc.) and {firmware} is the DiskOnChip firmware file
(DOC121.EXB, DOC123.EXB etc.).
For instance, if DiskOnChip appears at the address D800:0 and the
firmware file that you have at hand is DOC123.EXB, you should
execute the following command:
DFORMAT /WIN=d800 /S=DOC123.EXB /FIRST /Y
3.5. Reboot the target system from the DOS diskette and check that the
DiskOnChip has installed itself at drive letter C:
dir C:
3.6. At the DOS prompt, run WindRiver's VXSYS.COM utility to write VxWorks
bootstrap code onto the DiskOnChip :
VXSYS C:
3.7. Copy your BOOTROM.SYS to the root directory of the DiskOnChip:
COPY BOOTROM.SYS C:\
At this point the DiskOnChip is ready to boot the BOOTROM.SYS.
3.8. If you are using either boot scenarios 'A' or 'B', you can skip all
the remaining sections in this chapter and proceed with section 4.
If you are using boot scenario 'C', proceed with Section 3.9.
3.9. Add the following line to the BSP configuration .H file (i.e.
Tornado/target/config/pc486/config.h in case of pc486 BSP):
#define INCLUDE_DISKONCHIP /* M-SYSTEMS DiskOnChip */
3.10 Change the #define DEFAULT_BOOT_LINE in the BSP configuration
.H file (i.e. Traget/target/config/pc486/config.h in case of pc486
BSP) to look similar to this:
#define DEFAULT_BOOT_LINE \
"tffs=0,0(0,0)host:/tffs0/vxWorks h=90.0.0.3 e=90.0.0.50 u=target"
===> NOTE. The bootline above instructs the BOOTROM.SYS to look
for an application named 'vxWorks', residing in the
root directory of the device '/tffs0/' (i.e. first
DiskOnChip). If you want to name your application
different or place it into a location other than the
root directory of the first DiskOnChip, change the
respective fields in the bootline.
3.11. Modify the file Tornado/target/config/all/bootConfig.c and add the
following code fragment under #define INCLUDE_DISKONCHIP, just
before the routine usrInit():
#ifdef INCLUDE_DISKONCHIP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -