Professional Documents
Culture Documents
SHTETROR I TETOVS
Faculty of Mathematical Sciences - Fakulteti i Shkencave
Matematike Natyrore
Branch: Informatics
Seminar Paper
Mentor:
Candidate:
Contents
Introduction................................................................................................................ 2
1.
2.
UNIX OS Architecture........................................................................................... 4
3.
4.
5.
3.1.
File System..................................................................................................... 5
3.2.
Filename........................................................................................................ 5
3.3.
Pathname....................................................................................................... 6
3.4.
3.5.
File Security................................................................................................... 7
UNIX Shell............................................................................................................ 8
4.1.
Bourne Shell................................................................................................... 8
4.2.
C Shell............................................................................................................ 9
4.3.
Processes in UNIX............................................................................................... 10
5.1.
6.
6.2.
Network Hardware....................................................................................... 12
6.2.1.
6.2.2.
6.3.
6.4.
References................................................................................................................ 14
Introduction
An operating system (OS) is software that manages computer
hardware resources and provides common services for computer programs.
The operating system is an essential component of the system software in a
computer system. Application programs usually require an operating system
to function.
Today there are many operating systems for platforms other than
computers from which the most used are the mobile operating systems for
Smartphones. Most popular operating systems used today are: Android, BSD,
iOS, Linux, OS X, QNX, Microsoft Windows, Windows Phone, and IBM z/OS. All
of these, except Windows, Windows Phone and z/OS, share roots in UNIX.
UNIX is a very popular operating system. It is used in labs and
universities also as in the industrial environment. There are available
versions of this system for usage in computers with general purpose, for
specialized computers, personal computers, graphics workstations and small
and large systems from different manufacturers. The main features of this
operating system are as follows:
2. UNIX OS Architecture
An operating system can be defined as the software that controls the hardware
resources of the computer and provides an environment under which programs can
run. Generally, this software is called kernel, since it is relatively small and can be
found at the core of the environment. A diagram of the UNIX System architecture is
shown at Figure 1.1
In a broad sense, an operating system is the kernel and all the other software
that makes a computer useful and gives the computer its personality. This
other software includes system utilities, applications, shells, libraries of
common functions, and so on.
The UNIX OS Kernel controls the computer access, manages the file
systems, resources, computers, disks, tapes, printers, communication
lines and other devices.
For example, Linux is the kernel used by the GNU operating system. Some
people refer to this as the GNU/Linux operating system, but it is more
commonly referred to as simply Linux. Although this usage may not be
correct in a strict sense, it is understandable, given the dual meaning of the
phrase operating system.
3.2. Filename
The names in a directory are called filenames. The only two
characters that cannot appear in a filename are the slash character (/) and
the null character. The slash is used to separate the filenames that form a
pathname and the null character is used to terminate a pathname. For
normal usage is good to restrict the characters in a filename to a subset of
the normal printing characters. (We restrict the characters because if we use
some of the shell's special characters in the filename, we have to use the
shell's quoting mechanism to reference the filename, and this can get
complicated.)
Two filenames are automatically created whenever a new directory is
created: . (Called dot) and.. (Called dot-dot). Dot refers to the current
directory, and dot-dot refers to the parent directory. In the root directory, dotdot is the same as dot.
The Research UNIX System and some older UNIX System V file systems
restricted a filename to 14 characters. BSD versions extended this limit to
255 characters. Today, almost all commercial UNIX file systems support at
least 255-character filenames.
In the UNIX operating system, there is no convention that links the file
names with the type of data they contain, as is the case, for example, in the
DOS operating system (all files that have the suffix .EXE are executable, .BIN
are binary etc.). However, some of the software packages require that the
files they are dealing with have certain suffixes, even though it is not caused
by the operating system. For example, the C programming language
compilers expect that the file containing the source code has extension .C.
Files whose names start with a dot (.) are treated specially by UNIX.
These are the so-called hidden files and differ from others by the fact that
their names do not appear in the standard scrolling directory contents (see
the command ls).
3.3. Pathname
A sequence of one or more filenames, separated by slashes and
optionally starting with a slash, forms a pathname. A pathname that begins
with a slash is called an absolute pathname; otherwise, it's called a relative
pathname. Relative pathnames refer to files relative to the current directory.
The name for the root of the file system (/) is a special-case absolute
pathname that has no filename component.
Every process has a working directory, sometimes called the current
working directory. This is the directory from which all relative pathnames are
interpreted. A process can change its working directory with the chdir (shell
command) function.
Owner
Member of a group, and
Other
File owner is the user who created the file and he has the right to
determine the access permissions of the file. Of course, a super user has the
7
same right. Members of the group are the users who belong to a group
that includes the owner of the file. All other users are treated as others.
For each class of file users, it is possible to define individual access
permissions. For example, it is common that the owner has all the rights of a
file (read, write and execution, if it is executable), group members are
granted the right to read (without changing content), while other users do
not have any right of access to the file.
File access control is relatively simple and can be done with the following
shell commands: chown, chgrp and chmod.
4. UNIX Shell
A UNIX shell is a command-line interpreter or shell that provides a
traditional user interface for the UNIX operating system and for Unix-like
systems. Users direct the operation of the computer by entering commands
8
Description
/bin/sh - Easy to use, flexible, with built-in programming language.
/bin/rsh - reduced version of the Bourne Shell.
/bin/csh - a command interpreter and a programming language that
supports command buffer, control operations, and C-like syntax.
/bin/ksh - additional features compared to the Bourne Shell.
/bin/rksh - reduced version of the Korn shell.
/bin/tcsh - improved version of the C shell. It has a better command
line editing, file names completion, command repetition.
Korn
Shell
Turbo C
Shell
The most influential UNIX shells have been the Bourne shell and the
C shell. These shells have both been used as the coding base and model for
many derivative and work-alike shells with extended feature sets.
4.2. C Shell
The C shell was developed by Bill Joy for the Berkeley Software Distribution, a
line of UNIX operating systems derived from UNIX and developed at the University
of California, Berkeley. It was originally derived from the 6th Edition Unix shell
(Thompson shell), with its syntax modeled after the C programming language. The C
shell is used primarily for interactive terminal use, and less frequently for scripting
and operating system control. It has interactive keyboard shortcuts in form of
special control-key sequences for special effects such as job control.
Simple example of C shell: Simple example that shows a message This is
over a year If 365 days have passed.
#!/bin/csh
if ( $days > 365 ) then
echo This is over a year.
endif
-le 10 ]; do
**' $j = $i
$i '*' 2`
$j + 1`
C Shell
#!/bin/csh
set i = 2
set j = 1
while ( $j <= 10 )
echo '2 **' $j = $i
@ i *= 2
@ j++
end
5. Processes in UNIX
Process is found as a special term in the UNIX operating system. The process
is the basic unit of UNIX that is executed. Commands and tasks can be
10
Nice number - number that defines the priority of the process for capturing
computer resources
h stops all processes and stops the system. Only after this command,
the system can be shut down from the hardware side (power of).
r - stops all processes and restarts the system.
Examples:
Shutdown
# /etc/shutdown - h 0
Restart
#
6. UNIX
Networking
/etc/shutdown
-r /0 UNIX Computer Networks
...
...
11
12
Local Area Networks have a very simple structure and use a number of
different hardware equipment. First of all, these networks are characterized
by the fact that they connect computers in small regions. These are for
example networks within a building. In our environment most often are used
networks using Ethernet as the physical layer protocol. These are the socalled BUS network topology, and used transmission medium is a coaxial
cable with impedance of 50 ohm and a data transfer rate of 10MB / s. In
order for the network to work properly the coaxial cable must be terminated
at both ends with terminators whose resistance is equal to the corresponding
impedance of the cable. Connections for PCs are derived by breaking the
cable and inserting a T connector.
13
6.2.2.
Figure 4.
Example of NFS
structure of two
hosts.
To increase the size of the file system. In this case, host B cannot
use the network part of the drive to save files without burdening local
drives.
File sharing. The network part of the disc at the same time sees two or
more hosts and thus can interchange data without file transfer. For
14
example, the file that is copied to the local disk on a network host B
becomes simultaneously available to users on host A.
15
References
(1) W. Richard Stevens, Stephen A. Rago - Advanced Programming in
the UNIX Environment: Second Edition - Addison Wesley Professional,
2005
(2) R. Morgan, H. McGilton - "Introducing UNIX System V" - McGraw-Hill,
1987.
(3) P. P. Sylvester - "UNIX vodic kroz sistem" - Mikro Knjiga, prevod, 1992.
(4) http://www.wikipedia.com
16