Chapter 1 Introduction
This chapter addresses particularities of ChorusOS system initialization
that concern file systems. It also presents the process of managing file systems
on ChorusOS systems.
Note -
In order to include file system support in your ChorusOS system, you
must install both the OS and IOM components
of the ChorusOS 4.0 product during installation on the host workstation. You
must also configure(1CC)
the host workstation directory where you build system images to include binaries
from the OS and IOM components.
For this guide, it is assumed that you build file I/O
support and the C_INIT(1M)
actor into your system image.
1.1 System Initialization Overview
The C_INIT(1M)
actor plays an important role in the part of system initialization that concerns
file systems.
When a ChorusOS system is booted, the C_INIT(1M) actor creates a virtual root
file system in order to be able to create two directories, /dev and /image. The role
of these directories is as follows:
- /dev
-
Contains special files.
The C_INIT(1M)
actor mounts a pseudo file system in the /dev directory and populates this file system with special file nodes.
It does this even when no real file system, such as an NFS, UFS, or MS-DOS file system,
is mounted. In fact, as physical device drivers in this release are managed
at the level of the board support package (BSP) framework,
it is necessary to link device drivers in some way into the input/output manager
(IOM) subsystem. Also, each driver managed by the IOM component must be bound to the underlying physical device managed
by the BSP.
In order to bind drivers managed by the IOM component
with physical devices managed by the BSP, the system needs
to determine which drivers correspond to which devices. C_INIT(1M) therefore scans both the
device tree built at boot time by the kernel, and the system initialization
script, sysadm.ini(4CC).
Based on the information from the device tree and the system initialization
script, C_INIT(1M)
informs the IOM component about the correspondence between
device names and physical devices. C_INIT(1M) also creates the appropriate device
nodes in the /dev directory.
- /image
-
Contains the boot system
image.
This makes it possible to execute actors included in the system image
dynamically. This also makes it possible to store configuration files needed
by actors loaded at boot time, such as sysadm.ini(4CC), which is
used by C_INIT(1M).
The boot image is mounted as an MS-DOS file system.
1.2 File System Initialization
File system initialization proceeds in the following manner. After creating
the pdevfs file systems, C_INIT(1M) creates a /dev/console device to which it writes system console messages. It then creates
the other special files that correspond to the devices attached to the device
tree. It also creates special files to access the memory banks and mounts
the contents of the system image in /image/sys_bank as a FAT file system. It mounts other memory
banks under /image/bank_identifier as well, if others are available. Thus, several
file systems are mounted immediately after the system comes up, by the system
itself:
$ rsh target mount
root_device on / (pdevfs)
devfs on /dev (pdevfs)
devfs on /image (pdevfs)
devfs on /tmp (pdevfs)
/dev/bd00 on /image/sys_bank (msdos)
|
Next, C_INIT(1M)
looks for sysadm.ini(4CC),
the system initialization file. Usually, it finds the system initialization
file in /image/sys_bank/sysadm.ini, although it does
this by probing the memory banks for the file and using the first instance
it finds. (If it finds more than one sysadm.ini file,
it displays a warning on the system console.) Finally, C_INIT(1M) executes the commands it
finds in sysadm.ini, such as commands to set up network
connections and commands to create special files for access to local media,
such as hard disks, RAM disks and flash memory.
At this point, you may mount a root file system containing actors to
run on the target system. You do this without unmounting the pseudo
root node. The ChorusOS system allows you to mount a new root while
the pseudo root is still mounted.
Unless you build everything into your system image or mount a root directory
on a local device connected to the target system, you probably mount build_dir/root on
the host workstation as the root directory for your target system. You generate
this directory on the host workstation using the make root
command in the directory where you build system images.
The command to mount the root file system is usually included in the sysadm.ini(4CC)
file. The following example demonstrates what happens, however, when you mount
a new root file system manually after having exported it through NFS from a host workstation:
$ rsh target mount
root_device on / (pdevfs)
devfs on /dev (pdevfs)
devfs on /image (pdevfs)
devfs on /tmp (pdevfs)
/dev/bd00 on /image/sys_bank (msdos)
$ rsh target mount host_IP_address:/export/target/root /
host_IP_address:/export/target/root on / (nfs)
$ rsh target mount
root_device on / (pdevfs)
devfs on /dev (pdevfs)
devfs on /image (pdevfs)
devfs on /tmp (pdevfs)
/dev/bd00 on /image/sys_bank (msdos)
host_IP_address:/export/target/root on / (nfs)
$ rsh target arun /bin/ls /
started aid = 2
Makefile bin etc dev image
lib tmp
$ rsh target umount /
$ rsh target mount
root_device on / (pdevfs)
devfs on /dev (pdevfs)
devfs on /image (pdevfs)
devfs on /tmp (pdevfs)
/dev/bd00 on /image/sys_bank (msdos)
|
See the host workstation documentation for details about sharing this
directory through NFS. If your host workstation is running
the SolarisTM operating environment, you can use the share(1M)
command to share the file system.
1.3 The Process of Managing File Systems
You should understand in advance what you must do to set up file systems
on a ChorusOS system and in what order to perform the necessary steps. The
following list summarizes the stages of file system administration for ChorusOS
systems.
-
Configuring the system image
You must include support for file systems in the system image in order
to use the functionality described in this guide. Configuring the system image
for file system support involves setting features and tunables to support
the media and file system types you want to use, editing the built-in system
initialization script to create special files for accessing the media, and
then rebuilding the properly configured system image for use on the ChorusOS
target system.
This stage is generally completed only once for
a given system.
-
Preparing local media
Local media must be labelled in order to support file systems. If you
have local flash memory, it must also be formatted before it is labelled.
This stage is generally completed only once for
each device.
-
Creating file systems
You create new file systems on the available partitions on local media.
This involves writing file system structures to devices attached to the ChorusOS
system.
This stage is generally completed only once for
a given system.
-
Checking and mounting file systems
Before mounting a local file system, you check it for errors. After
the check is complete and any errors in the file system have been repaired,
you mount the file system into the file system hierarchy. If the file system
is being mounted over the network through NFS, you mount
it without performing a check. Once mounted, the contents of the file system
are available for use.
This stage is performed each time you use a file system.
-
(Optional) Exporting local UFS
file systems through NFS
If you have local UFS file systems that you want
to make available over the network, you export them through NFS.
This stage involves editing several configuration files and starting the daemon
actors that make your target system an NFS server. This
guide assumes you have a working network connection that makes exporting through NFS possible.
File system export is often set up only once for a given system. Daemons
may be started as part of system initialization.
-
(Optional) Unmounting file systems
If you need to remove a file system from the hierarchy, you unmount
it. This stage may be performed during normal system use, but is usually performed
as part of system shutdown.
This document includes instructions to guide you through each stage
of the process of managing file systems.