The Internet Encyclopedia (Volume 3)

(coco) #1

P1: JDW


UNIX WL040/Bidgoli-Vol III-Ch-41 August 13, 2003 17:26 Char Count= 0


OPERATINGSYSTEMSTRUCTURE 507

System Call Interface

Terminal Handling Network Handling I/O Handling Signal Handling Process Handling

Characater devices Routing and Network devices Caching and Disk drivers Process Management, Scheduling

HARDWARE

Figure 4: Structure of a typical Unix kernel.

Filesystem
The typical Unix file system is a hierarchical composite of
directories and files, starting with a base directory called
root. Every directory in the system, with the exception of
the root directory, belongs to some other directory. Every
regular file in the system is contained in a single directory.
Figure 5 shows a typical layout of a hierarchical Unix file
system.
The main directories and their functions on a typical
Unix system are given in Table 5.
The /home directory is significant because most users
on a Unix system are assigned a default home directory,
and this directory is generally stored under the /home
directory. Therefore, a user with the username andy would
usually have a home directory under /home/andy. The user
sally would have a home directory under /home/sally. A
user’s home directory is the current working directory im-
mediately after log-in and is the place where the user can
store personal work files.
Each file in the system is associated with a structure
known as an inode. An inode (information node) con-
tains information relative to that particular file in the
file system. The inode contains, among other things, the

filename, the current size on disk in bytes, the type of file
(regular file, directory, link, device, etc.), the number of
hard links to the file, information indicating the user and
group associated with the file, a file system unique identi-
fier, and some time stamps representing when the file was
last read, modified, and when the inode structure itself
was last changed. Most important, the inode contains a
pointer to the physical location of the file’s data on the
actual hard disk.
Every file in the file system can be defined as being
somehow derivatively off of the root directory. A file with
a pathname that begins with a / slash is called an absolute
pathname, because its location within the logical hierar-
chical structure is unambiguous. An absolute pathname
describes exactly how to navigate to a particular file on the
system. For example, the filename/etc/security/dev/audio
is an absolute pathname because it denotes a single file
on the system, unambiguously, starting from the root di-
rectory.
A relative pathname is a pathname that begins from
the current working directory. Relative pathnames often
begin with two periods (representing the parent directory
of the current directory) or adirectory name in the current

/
(root directory)

bin
(holds executables)

usr
(holds user
commands)

home
(contains home
directories)

etc tmp

bin

local
(holds local
directories)

ucb
(holds BSD
command
versions)

jmshack linda ellen

Figure 5: A typical Unix files system layout.
Free download pdf