source: rtems-docs/filesystem/system_init.rst @ d389819

4.115
Last change on this file since d389819 was d389819, checked in by Amar Takhar <amar@…>, on 01/18/16 at 05:37:40

Convert all Unicode to ASCII(128)

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