summaryrefslogtreecommitdiffstats
path: root/testsuites/samples/fileio/fileio.doc
blob: a8f84966d6e14def25009d3524ac6a2714e80718 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# SPDX-License-Identifier: BSD-2-Clause

#
#  fileio.doc,v 
#
#  COPYRIGHT (c) 1989-1999.
#  On-Line Applications Research Corporation (OAR).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

This sample implements some basic tests for the file systems
available. It provides the following functionality:

- perform basic file read/write tests on arbitrary file paths with
selectable I/O buffer size
- perform functions to evaluate FAT disk partition tables
- perform functions to mount FAT disks to the file system tree

A sample session might look like this:

- start this system

- select "p" (part_table_initialize) to read in the partition table of
first harddisk, enter the device name "/dev/hda", when prompted

- select "f" (fsmount) to try to mount the partitions
  /dev/hda1../dev/hdc4 to corresponding mount points. Non-existant
  partitions will report an error, but will not abort the tests

- select "w" (write file) to create a new file on the mounted disk (or
  in the IMFS). Enter the file name (e.g. "/mnt/hda1/test_1M.txt"),
  the file size (e.g. 64K or 2M) and the buffer size to use for the
  write calls (e.g. 32 or 4K). Then the sample will try to write the
  corresponding file and print the time consumed and data rate achived.

- select "r" (read file) to read a file (without displaying the
  contents). It has similar parameters as "write file", but does not
  query the file size.

- select "s" to call the rtems shell with its various capabilities.