source: rtems/testsuites/fstests/mdosfs_support/fs_support.c @ a0bc1dc

4.115
Last change on this file since a0bc1dc was a0bc1dc, checked in by Ralf Kirchner <ralf.kirchner@…>, on 12/05/12 at 12:58:19

dosfs: Delete fattype parameter for msdos_format()

Delete fattype parameter of msdos_format_request_param_t because the FAT
type is determined by cluster and disk size.

Estimate FAT type and re-evaluate FAT type after exact parameter
determination.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#endif
12#include "pmacros.h"
13
14#include "fs_config.h"
15
16#include <sys/stat.h>
17#include <sys/types.h>
18
19#include <rtems/libio.h>
20#include <rtems/dosfs.h>
21
22#include "ramdisk_support.h"
23#include "fstest.h"
24#include "fstest_support.h"
25
26#define BLOCK_SIZE 512
27
28msdos_format_request_param_t rqdata = {
29    OEMName:             "RTEMS",
30    VolLabel:            "RTEMSDisk",
31    sectors_per_cluster: 0,
32    fat_num:             0,
33    files_per_root_dir:  0,
34    media:               0,
35    quick_format:        FALSE,
36    skip_alignment:      0,
37    info_level:          0
38};
39
40void test_initialize_filesystem(void)
41{
42  int rc=0;
43  rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO);
44  rtems_test_assert(rc==0);
45
46  init_ramdisk();
47
48  rc=msdos_format(RAMDISK_PATH,&rqdata);
49  rtems_test_assert(rc==0);
50
51  rc=mount(RAMDISK_PATH,
52      BASE_FOR_TEST,
53      "dosfs",
54      RTEMS_FILESYSTEM_READ_WRITE,
55      NULL);
56  rtems_test_assert(rc==0);
57}
58
59
60void test_shutdown_filesystem(void)
61{
62  int rc=0;
63  rc=unmount(BASE_FOR_TEST) ;
64  rtems_test_assert(rc==0);
65  del_ramdisk();
66}
67
68/* configuration information */
69
70/* drivers */
71#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
73
74/**
75 * Configure base RTEMS resources.
76 */
77#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
78
79#define CONFIGURE_MAXIMUM_TASKS                     10
80#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
81#define CONFIGURE_MAXIMUM_DRIVERS                   10
82#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
83#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
84
85#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
86
87#define CONFIGURE_FILESYSTEM_DOSFS
88
89#define CONFIGURE_INIT
90#include <rtems/confdefs.h>
91
Note: See TracBrowser for help on using the repository browser.