source: rtems-docs/filesystem/system_init.rst @ 489740f

4.115
Last change on this file since 489740f was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

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