Unix
Unix
Definition of UNIX
UNIX is a portable, multitasking, multiuser, time sharing operating system(OS).
Chapter 1: Introduction to UNIX UNIX Operating System
Founder of UNIX
The UNIX was founded by Ken Thompson, Dennis Ritchie and Brain
kerninghan at AT& T Bell Labs research in 1969.
Founder of LINUX
Linus Benedict Torvalds in 1991.
Need of UNIX
Network capability:
With other OS, additional software must be purchased for networking but with
UNIX, network capability is the part of the operating system.
History of UNIX
1960 Bell labs involved in the project with MIT, General Electric and Bell
Laboratories to develop a time sharing system called
MULTICS(Multiplexed Operating and Computing System).
1969 Ken Thompson wrote the first version of the UNIX called
UNICS(Uniplexed Information and Computing System)
1970 Finally UNICS became UNIX.
download) one)
UNIX has very high security system Windows has low security system
UNIX is a command based operating Windows is not a command based
system operating system
The file system is arranged in The file system is arranged in parallel
hierarchical manner manner
UNIX is not a user friendly Windows is a user friendly
Free office(such as excel, PowerPoint Pay for MS Office
and others)
Low Hardware cost High Hardware cost
Customizable add features Not customizable
The Architecture of the UNIX system is divided into 4 major components. They are:
1) The Kernel
2) The Shell
3) Files and Processes
4) System Calls
1. The Kernel
The Kernel is the heart of the Operating System.
It interface between Shell and Hardware.
It performs Low Level Task.
Eg: Device Management, Memory Management etc.
2. The Shell
Chapter 1: Introduction to UNIX UNIX Operating System
Features of UNIX
1) Simple design, organization and functioning
The architecture of the UNIX is simple, organized and functional.
2) Portability
The code can be changed and compiled on a new machine.
3) UNIX Shell
The user interface UNIX Shell provides the services that the user wants.
4) Hierarchical file system
UNIX uses a hierarchical file structure to store information.
5) Multi user
UNIX allows more than one user to share the same computer system at the
same time.
6) Multi-tasking
More than one program can be run at a time.
7) Security
UNIX provides high security level( System level security and File level
security)
8) Pipes and Filters
In UNIX, we can create complex programs from simple programs.
9) Utilities
UNIX has over 200 utility programs for various functions.
10) Machine Independence
Chapter 1: Introduction to UNIX UNIX Operating System
The system hides the machine architecture from the user, making it easier to
write applications that can run any computer system.
Architecture of Kernel
The system call and library interface represent the border between
user programs and the kernel.
The File subsystem manages files, allocating file space,
administrating free space, controlling access to files and retrieving
data for users.
Kernel Interface to Hardware is responsible for handling interrupts
and for communicating with the machine.
Device drivers are the kernel modules that control the operation of
peripheral devices.
Block I/O devices are random access storage devices to reset the system.
Scheduler module allocates CPU to processes.
Memory management module controls allocation of memory.
Inter-process communication (IPC) ranges from asynchronous
signaling of events to synchronous transmission of messages between
processes.
Features of Kernel
1) Concurrency
Many processes run concurrently to improve the performance of the system.
2) Virtual Memory(VM)
Chapter 1: Introduction to UNIX UNIX Operating System
Process :- Process can be defined as a program under Execution. Unix runs many programs at the
same time by using Round-robin Scheduling algorithm.
The shell creates two child process cat and grep simultaneously.
Process state:-
Waiting : The process is waiting for some required resources like input and output devices
Ready : The process is waiting to be allocated to a processor. The process comes to this state immediately after creation.
2)
ii. Ready (Swapped):- Ready to run, but needs to be swapped into memory.
3)
i. Asleep (in memory):- The process is blocked and waiting for an event in
memory.
ii. Asleep (swapped):-The process is swapped out and waiting for an event on the disk.
6) Zombie:- A zombie process in UNIX is a process that has terminated, but whose parent has not waited
for it. May be a parent process exited without waiting for it to terminate
7) Pre-empted:- is a process returning from kernel mode to user model, since it in preempted by kernel,
to schedule another process.
Unix process creation:-
★ Parent is the
orginal process.
★ the parent can either wait for child to complete , or continue executing in parallel with the
child.
★ Resource sharing: a process needs certain resource like CPU time, Memory, I/O devices etc.
★ exec( ) system call is used after fork( ), to start another different program.
1. inter-active (foreground)process:-
All the processses creted by the user using the shell and atached to the terminals are called fore
ground process.
-> when user pass a command to shell ,the shell passes ,rebuilds and sends it to the kernal for execution.
-> duiring the execution of one process the user should wait for the kernal until compilatiton of that
process.
2. non-interactive(background)process:-
The process which can without using the terminal are know as background process.
-> background process take input from a file ,process them without holding up the terminal and write
output on other file.
-> for ex:- sorting and searching of files/content from long files.
limitatitons:-
-> nohup (no hang up) which avoids deadlocking of ome background process during unusual logouts.
runaway process :- when background process (using & at the end) and logout without closing
or killing the process .such a processs is called runaway process.
the value range from 0 to 39, in linux -9 to 20 .where 0 is high and 39 is lower value.
The priority of a process can be made lower using the nice command.
for example: if a process is already running and using a lot of cpu time; then it can be reniced.
Daemon Processes:-
Daemon processes are processes that are constantly running without using associated terminal or login shell, and keeps w
★ Process vhand, which stands for virtual memory handler, is loaded into the system to swap the active
processes between memory and disk, when they are waiting for CPU time.
★ Process bdflush is responsible for disk I/O.
Process Termination:-
There are situations when the user has to terminate a process prematurely. Several reasonS are
possible for process termination such as:
★ Memory unavailable
★ I/O failure.
★ Data misuse.
Communication commands:-
1) kill command:
Syntax:- $ finger
5) wall command:- wall stands for write all. Wall command is used only
by the super user to send messages to all users on the system.
It is also known as broadcasting a message to all
users , irrespective of there permissions.
Syntax:- $ wall
★★★★★