source: rtems-docs/filesystem/system_init.rst @ 5431beb

4.115
Last change on this file since 5431beb was 5431beb, checked in by Chris Johns <chrisj@…>, on 11/09/16 at 05:54:02

filesystem: Fix header levels.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. COMMENT: COPYRIGHT (c) 1988-2002.
4.. COMMENT: On-Line Applications Research Corporation (OAR).
5.. COMMENT: All rights reserved.
6
7System Initialization
8*********************
9
10After the RTEMS initialization is performed, the application's initialization
11will be performed. Part of initialization is a call to
12``rtems_filesystem_initialize()``. This routine will mount the 'In Memory File
13System' as the base filesystem.  Mounting the base filesystem consists of the
14following:
15
16- Initialization of mount table chain control structure
17
18- Allocation of a ``jnode`` structure that will server as the root node of the
19  'In Memory Filesystem'
20
21- Initialization of the allocated ``jnode`` with the appropriate OPS, directory
22  handlers and pathconf limits and options.
23
24- Allocation of a memory region for filesystem specific global management
25  variables
26
27- Creation of first mount table entry for the base filesystem
28
29- Initialization of the first mount table chain entry to indicate that the
30  mount point is NULL and the mounted filesystem is the base file system
31
32After the base filesystem has been mounted, the following operations are
33performed under its directory structure:
34
35- Creation of the /dev directory
36
37- Registration of devices under /dev directory
38
39Base Filesystem
40===============
41
42RTEMS initially mounts a RAM based file system known as the base file system.
43The root directory of this file system tree serves as the logical root of the
44directory hierarchy (Figure 3). Under the root directory a '/dev' directory is
45created under which all I/O device directories and files are registered as part
46of the file system hierarchy.
47
48.. code-block:: shell
49
50    Figure of the tree structure goes here.
51
52A RAM based file system draws its management resources from memory. File and
53directory nodes are simply allocated blocks of memory. Data associated with
54regular files is stored in collections of memory blocks. When the system is
55turned off or restarted all memory-based components of the file system are
56lost.
57
58The base file system serves as a starting point for the mounting of file
59systems that are resident on semi-permanent storage media. Examples of such
60media include non- volatile memory, flash memory and IDE hard disk drives
61(Figure 3). File systems of other types will be mounted onto mount points
62within the base file system or other file systems that are subordinate to the
63base file system. The framework set up under the base file system will allow
64for these new file system types and the unique data and functionality that is
65required to manage the future file systems.
66
67Base Filesystem Mounting
68------------------------
69
70At present, the first file system to be mounted is the 'In Memory File
71System'. It is mounted using a standard MOUNT() command in which the mount
72point is NULL.  This flags the mount as the first file system to be registered
73under the operating system and appropriate initialization of file system
74management information is performed (See figures 4 and 5). If a different file
75system type is desired as the base file system, alterations must be made to
76base_fs.c. This routine handles the mount of the base file system.
77
78.. code-block:: shell
79
80    Figure of the mount table chain goes here.
81
82Once the root of the base file system has been established and it has been
83recorded as the mount point of the base file system, devices are integrated
84into the base file system. For every device that is configured into the system
85(See ioman.c) a device registration process is performed. Device registration
86produces a unique dev_t handle that consists of a major and minor device
87number. In addition, the configuration information for each device contains a
88text string that represents the fully qualified pathname to that device's place
89in the base file system's hierarchy. A file system node is created for the
90device along the specified registration path.
91
92.. code-block:: shell
93
94    Figure  of the Mount Table Processing goes here.
95
96Note: Other file systems can be mounted but they are mounted onto points
97(directory mount points) in the base file system.
Note: See TracBrowser for help on using the repository browser.