In the extended environment, a special actor called
C_INIT provides administrative commands for the following:
network configuration, such as defining IP addresses and initializing network interfaces
file system management, such as partitioning a disk and mounting a file system
device management, such as binding a high level service (file system, networking,
tty management) to an actual device driver
Here are the most frequently used
mknod: defines special device files
mkdev: binds high level services to an instance of a device driver
mount, umount: mounts and unmounts file systems
arun: launches executables
ifconfig: defines IP addresses
route, rarp, netstat, ppp, ping: miscellaneous networking commands
memstat, chorusStat: prints system statistics
setenv, unsetenv, echo, help, sleep, reboot, shutdown: miscellaneous system commands
rshd, console, source: specifies the device from which commands can be accepted:
rshd: from a host through rsh
console: from system console
source: from a file
See C_INIT(1M) for a complete description.
These commands are invoked at system start-up, described in the following section, and later during the life of the system. During the life of the system, the
C_INIT actor executes commands from the system console, or from a remote host through rsh.
At system start-up, the
C_INIT actor executes the following steps:
sets up an initial virtual file system
executes commands from the configuration file sysadm.ini
executes commands from /etc/rc.chorus when a root file system is mounted (see C_INIT(1M))
If the target has a valid IP address, the file /etc/rc.chorus.<ip_address> (if it exists) will be selected instead of /etc/rc.chorus.
<ip_address> must be written in the usual dot notation, for example: 18.104.22.168.
The initial virtual file system in step 1 contains only two directories, /dev and /image/sys_bank. The /dev directory, initially empty, is used for the definition of special devices, like /dev/tty01. The /image/sys_bank directory contains all the components in the boot image:
system actors such as
system configuration files (sysadm.ini)
user defined configuration files and executables
All of these components can be accessed like the files in an ordinary file system, using their path, for example: /image/sys_bank/sysadm.ini.
To access /dev and /image directories on the virtual file system, dev and image directories must be present on your root file system, and this root file system must be mounted.
In step 2, the
C_INIT actor executes commands from a configuration file called sysadm.ini. This file contains all the commands needed for the initial administration of the system, including networking, file system management and device management.
The sysadm.ini file can be customized. On the host, it is located in the conf subdirectory of the ChorusOS build directory. This file is automatically embedded in the boot image, in the /image/sys_bank/sysadm.ini file of the initial file system. This allows you to configure embedded targets which do not have access to a local or remote file system.
Below are typical commands of the sysadm.ini file.
ifnet interface 0 to a specific Ethernet driver:
% mkdev ifeth 0 /pci/epic/epic100
The pathname is optional. For more information, refer to mkdev(1M).
In the ChorusOS operating system, hardware devices are identified by a path in a device tree; the mkdev command connects to the driver instance servicing the indicated hardware device.
ifnet interface 0 to the first Ethernet driver found:
% mkdev ifeth 0
Define the IP address of
ifnet interface 0:
% ifconfig ifeth0 ip-address netmask ip-mask broadcast broadcast-addr
Define the IP address using the
rarp protocol on
ifnet interface 0:
% rarp ifeth 0
Associate a special device to a serial line driver:
% mknod /dev/tty01 c 0 0 % mkdev tty 0 /pci/pci-isa/ns16550-2
The third argument to mknod, 0, is the major device number identifying the serial line driver. The fourth argument to mknod, 0, is the minor device number identifying the hardware device at the POSIX level.
Mount a local file system by defining required devices, then mount the disk:
% mknod /dev/sd0a b 10 0 % mknod /dev/rsd0a c 9 0 % mount /dev/sd0a /
Mount a remote file system:
% mount host-ip-addr:host-path /