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 | |
---|
7 | System Initialization |
---|
8 | ********************* |
---|
9 | |
---|
10 | After the RTEMS initialization is performed, the application's initialization |
---|
11 | will be performed. Part of initialization is a call to |
---|
12 | ``rtems_filesystem_initialize()``. This routine will mount the 'In Memory File |
---|
13 | System' as the base filesystem. Mounting the base filesystem consists of the |
---|
14 | following: |
---|
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 | |
---|
32 | After the base filesystem has been mounted, the following operations are |
---|
33 | performed under its directory structure: |
---|
34 | |
---|
35 | - Creation of the /dev directory |
---|
36 | |
---|
37 | - Registration of devices under /dev directory |
---|
38 | |
---|
39 | Base Filesystem |
---|
40 | =============== |
---|
41 | |
---|
42 | RTEMS initially mounts a RAM based file system known as the base file system. |
---|
43 | The root directory of this file system tree serves as the logical root of the |
---|
44 | directory hierarchy (Figure 3). Under the root directory a '/dev' directory is |
---|
45 | created under which all I/O device directories and files are registered as part |
---|
46 | of the file system hierarchy. |
---|
47 | |
---|
48 | .. code-block:: shell |
---|
49 | |
---|
50 | Figure of the tree structure goes here. |
---|
51 | |
---|
52 | A RAM based file system draws its management resources from memory. File and |
---|
53 | directory nodes are simply allocated blocks of memory. Data associated with |
---|
54 | regular files is stored in collections of memory blocks. When the system is |
---|
55 | turned off or restarted all memory-based components of the file system are |
---|
56 | lost. |
---|
57 | |
---|
58 | The base file system serves as a starting point for the mounting of file |
---|
59 | systems that are resident on semi-permanent storage media. Examples of such |
---|
60 | media 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 |
---|
62 | within the base file system or other file systems that are subordinate to the |
---|
63 | base file system. The framework set up under the base file system will allow |
---|
64 | for these new file system types and the unique data and functionality that is |
---|
65 | required to manage the future file systems. |
---|
66 | |
---|
67 | Base Filesystem Mounting |
---|
68 | ------------------------ |
---|
69 | |
---|
70 | At present, the first file system to be mounted is the 'In Memory File |
---|
71 | System'. It is mounted using a standard MOUNT() command in which the mount |
---|
72 | point is NULL. This flags the mount as the first file system to be registered |
---|
73 | under the operating system and appropriate initialization of file system |
---|
74 | management information is performed (See figures 4 and 5). If a different file |
---|
75 | system type is desired as the base file system, alterations must be made to |
---|
76 | base_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 | |
---|
82 | Once the root of the base file system has been established and it has been |
---|
83 | recorded as the mount point of the base file system, devices are integrated |
---|
84 | into 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 |
---|
86 | produces a unique dev_t handle that consists of a major and minor device |
---|
87 | number. In addition, the configuration information for each device contains a |
---|
88 | text string that represents the fully qualified pathname to that device's place |
---|
89 | in the base file system's hierarchy. A file system node is created for the |
---|
90 | device along the specified registration path. |
---|
91 | |
---|
92 | .. code-block:: shell |
---|
93 | |
---|
94 | Figure of the Mount Table Processing goes here. |
---|
95 | |
---|
96 | Note: Other file systems can be mounted but they are mounted onto points |
---|
97 | (directory mount points) in the base file system. |
---|