Mercurial > ecos
changeset 2533:4f15eaebbf32
* cdl/fatfs.cdl: Add configury for the disk device names to be
used for the tests. Default to the synthetic tests, since what
seems to be the most used test platform.
* doc/README.txt: Updates for the naming scheme.
* doc/fat16.ecm: Fit the new naming scheme.
| author | asl |
|---|---|
| date | Sun, 24 Aug 2008 12:54:45 +0000 |
| parents | af5755a0cc71 |
| children | 41a4df71f380 |
| files | packages/fs/fat/current/ChangeLog packages/fs/fat/current/cdl/fatfs.cdl packages/fs/fat/current/doc/README.txt packages/fs/fat/current/doc/fat16.ecm packages/fs/fat/current/doc/fatfd.ecm packages/fs/fat/current/src/fatfs_supp.c packages/fs/fat/current/tests/fatfs1.c |
| diffstat | 7 files changed, 47 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/fs/fat/current/ChangeLog +++ b/packages/fs/fat/current/ChangeLog @@ -1,6 +1,14 @@ +2008-08-19 Andrew Lunn <andrew.lunn@ascom.ch> + + * cdl/fatfs.cdl: Add configury for the disk device names to be + used for the tests. Default to the synthetic tests, since what + seems to be the most used test platform. + * doc/README.txt: Updates for the naming scheme. + * doc/fat16.ecm: Fit the new naming scheme. + 2008-05-13 Savin Zlobec <savinz@users.sourceforge.net> - * src/fatfs.c: Fix handling of '.' and '..' nodes in dirsearch. + * src/fatfs.c: Fix handling of '.' and '..' nodes in dirsearch. 2008-04-02 Xinghua Yang <yxinghua@sunnorth.com.cn> Andrew Lunn <andrew.lunn@ascom.ch>
--- a/packages/fs/fat/current/cdl/fatfs.cdl +++ b/packages/fs/fat/current/cdl/fatfs.cdl @@ -126,6 +126,24 @@ cdl_package CYGPKG_FS_FAT { # -------------------------------------------------------------------- + cdl_component CYGPKG_DEVS_DISK_TESTING { + display "Testing configuration" + default_value 1 + + cdl_option CYGDAT_DEVS_DISK_TEST_DEVICE { + display "Test device driver" + flavor data + default_value {"\"/dev/synthdisk0/1\"" } + } + + cdl_option CYGDAT_DEVS_DISK_TEST_DEVICE2 { + display "Second Test device driver" + flavor data + default_value {"\"/dev/synthdisk0/2\"" } + } + + } + cdl_option CYGPKG_FS_FAT_TESTS { display "FAT FS tests" flavor data
--- a/packages/fs/fat/current/doc/README.txt +++ b/packages/fs/fat/current/doc/README.txt @@ -33,6 +33,8 @@ CYGPKG_DEVS_DISK_V85X_EDB_V850 device on a platform that is otherwise unsupported. It has not been tested. +and other disk drivers which have been added in the mean time. + In addition the above new packages, FAT support also relies on the following existing packages: @@ -62,40 +64,26 @@ Device Drivers The disk device interface is divided into a generic layer in the CYGPKG_IO_DISK package and drivers for each device. -Apart from providing the main API, the other thing that the DISK -package does is to provide support for disk partitions. It interprets -the on-disk data structures and provides an independent channel to -access each partition independently. Partitions are referenced using -an additional element to the device name. If the device is named -"/dev/disk0" then "/dev/disk0/1" refers to partition 1, "/dev/disk0/2" -to partition 2 and so on. If the disk is not partitioned, for example -a floppy disk, then "/dev/disk0/0" refers to the whole disk. - -There are two device drivers currently supported: - -Linux Synthetic Driver ----------------------- - -This driver treats a disk file on Linux as a disk image and read or -writes blocks from/to it to simulate disk IO. At present it supports -just a single disk device image. There are a number of configuration -options for this device, see the CDL file for details, and the .ecm -files for examples. - -EDB V850 Compact Flash Device ------------------------------ - -This uses an IDE interface to a Compact Flash device. This is actually -for a platform that is not supported in the current source tree, so -cannot be tested. However, it should be possible to adapt the code for -other devices. +Each disk driver provides a number of device files. The drivers use a +naming convention to ensure they are unique. The convention is +/dev/XXXdiskY/Z. XXX is the name of the device driver, eg ide, mmc, +synth etc. The DISK packages provide support for disk partitions. They +interpret the on-disk data structures and provides an independent +channel to access each partition independently. Partitions are +referenced using an additional element to the device name. If the +device is named "/dev/XXXdisk0" then "/dev/XXXdisk0/1" refers to +partition 1, "/dev/XXXdisk0/2" to partition 2 and so on. If the disk +is not partitioned, for example a floppy disk, then "/dev/XXXdisk0/0" +refers to the whole disk. Testing ======= There is currently just one test available for the FAT filesystem, fileio1. This test will currently only run on the Linux synthetic -target and needs a special disk image. +target and needs a special disk image. However, with some work it +should be possible to make this test run on other disk drivers, if the +image can be installed and the configury set appropriately. To run the test you first need to configure the synthetic disk driver to access the disk image. This is most easily done by importing the
--- a/packages/fs/fat/current/doc/fat16.ecm +++ b/packages/fs/fat/current/doc/fat16.ecm @@ -28,10 +28,6 @@ cdl_component CYGVAR_DEVS_DISK_ECOSYNTH_ user_value 1 }; -cdl_option CYGDAT_IO_DISK_ECOSYNTH_DISK0_NAME { - user_value {"/dev/disk0/"} -}; - cdl_option CYGDAT_IO_DISK_ECOSYNTH_DISK0_FILENAME { user_value {"/tmp/disk0.img"} };
--- a/packages/fs/fat/current/doc/fatfd.ecm +++ b/packages/fs/fat/current/doc/fatfd.ecm @@ -28,10 +28,6 @@ cdl_component CYGVAR_DEVS_DISK_ECOSYNTH_ user_value 1 }; -cdl_option CYGDAT_IO_DISK_ECOSYNTH_DISK0_NAME { - user_value {"/dev/disk0/"} -}; - cdl_option CYGDAT_IO_DISK_ECOSYNTH_DISK0_FILENAME { user_value {"/dev/fd0"} };
--- a/packages/fs/fat/current/src/fatfs_supp.c +++ b/packages/fs/fat/current/src/fatfs_supp.c @@ -1868,7 +1868,8 @@ fatfs_init(fatfs_disk_t *disk) return err; // Check some known boot record values - if (0x29 != boot_rec.ext_sig || + if (!(0x29 == boot_rec.ext_sig || + 0x28 == boot_rec.ext_sig) || 0x55 != boot_rec.exe_marker[0] || 0xAA != boot_rec.exe_marker[1]) return EINVAL;
--- a/packages/fs/fat/current/tests/fatfs1.c +++ b/packages/fs/fat/current/tests/fatfs1.c @@ -447,7 +447,7 @@ int main( int argc, char **argv ) // -------------------------------------------------------------- - err = mount( "/dev/disk0/1", "/", "fatfs" ); + err = mount( CYGDAT_DEVS_DISK_TEST_DEVICE, "/", "fatfs" ); if( err < 0 ) SHOW_RESULT( mount, err ); err = chdir( "/" ); @@ -543,7 +543,7 @@ int main( int argc, char **argv ) if( err < 0 ) SHOW_RESULT( mkdir, err ); #else diag_printf("<INFO>: mount /disk2\n"); - err = mount( "/dev/disk0/2", "/disk2", "fatfs" ); + err = mount( CYGDAT_DEVS_DISK_TEST_DEVICE2, "/disk2", "fatfs" ); if( err < 0 ) SHOW_RESULT( mount, err ); #endif
