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