source: rtems-docs/filesystem/system_init.rst

Last change on this file was e52906b, checked in by Sebastian Huber <sebastian.huber@…>, on 01/09/19 at 15:14:06

Simplify SPDX-License-Identifier comment

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