Unix Architecture
Unix Architecture
Index
1.1.Overview of Unix (/communities/unix-c-oracle-lounge-0/content/overview-of-unix)
Go to Doubts
Kernel is a collection of programs mostly written in C, that runs directly on the hardware - so parts of kernel must be customized to each systems hardware features.
It allocates time and memory to programs and handles the filestore and communications in response to system calls.
Interacts directly with the hardware through device drivers.
Provides sets of services to programs, insulating these programs from the underlying hardware.
Manages memory, controls access, maintains file system, handles interrupts, allocates resources of the computer.
Programs interact with the kernel through system calls. Kernel is directly loaded into memory when the system is booted. The basic services of the the kernal is the
Low level jobs like:
System Initialization
Process/Memory/File/I-O Management
Programming Interface
Communication Facilities
https://campuscommune.tcs.com/communities/unix-c-oracle-lounge-0/content/unix-architecture-0 1/4
7/10/2017 Unix Architecture
The kernel accomplishes all these tasks by providing an interface between the other programs running under its control and the physical hardware of the computer;
this interface, the system call interface, effectively insulates the other programs on the UNIX system from the complexities of the computer. For example, when a
running program needs access to a file, it cannot simply open the file; instead it issues a system call which asks the kernel to open the file. The kernel takes over
and handles the request, then notifies the program whether the request succeeded or failed. To read data in from the file takes another system call; the kernel
determines whether or not the request is valid, and if it is, the kernel reads the required block of data and passes it back to the program. Unlike some other operating
systems, UNIX system programs do not have access to the physical hardware of the computer. All they see are the kernel services, provided by the system call
interface.
Kernel Mode
In Unix or Linux there are two distinct modes of operation of the central processing unit(CPU)
The kernal in unix is the core of the operating system. As it has control over everything that occurs in the syatem, is considered as trusted software . When the CPU
is in kernel mode, it is assumed to be executing trusted software and thus it can execute any instructions and reference any locations in memory. All other programs
are considered as untrusted software and when the CPU is in user mode , it runs the untrusted software. All user mode software must request use of the kernel by
means of a system call in order to perform privileged instructions, such as process creation or input/output operations.
System calls
In the simplest form we can define a system call as a request for the operating system to do something on behalf of the user's program. The system calls are
functions used in the kernel itself.
UNIX system calls are used to manage the file system, control processes, and to provide interprocess communication.
File structure related calls - The file structure related system calls available in the UNIX system let us create, open, and close files, read and write files,
randomly access files, alias and remove files, get information about files, check the accessibility of files, change protections, owner, and group of files, and
control devices.
Process Related calls - The UNIX system provides several system calls to create and end program, to send and receive software interrupts, to allocate
memory, and to do other useful jobs for a process.
https://campuscommune.tcs.com/communities/unix-c-oracle-lounge-0/content/unix-architecture-0 2/4
7/10/2017 Unix Architecture
The shell acts as an interface between the user and the kernel and is the interpreter of UNIX to decipher and execute commands. (user interface to the kernel for
isolating the user from the knowledge of kernel functions.). It maintains interactive dialogue with the user and is capable of Input/Output redirection. Shell can do
background processing so that time-consuming, non-interactive tasks can proceed side by side. With the help of pipe, shell makes it possible to connect more than
one commands. Shell includes programming language features which can be used to build shell scripts for performing complex operations.
Types of Shells
Bourne Shell - Original command interpreter developed at AT&T by Stephen R. Bourne; fastest official shell distributed with Unix systems (executable
filename sh)
C Shell - developed by William Joy and others at UCB; gets its name from C due to syntax resemblance with language C (executable file name csh)
Korn Shell - developed by David Korn, combines best features of both shells, not popular (executable file name ksh)
Restricted Shell - restricted version of Bourne shell, typically used for guest logins and in secure installations (executable file name).
External link
http://nptel.ac.in/courses/Webcourse-contents/IISc-BANG/Operating%20Systems/pdf/Lecture_Notes/Mod%2014_LN.pdf (http://nptel.ac.in/courses/Webcourse-
contents/IISc-BANG/Operating%20Systems/pdf/Lecture_Notes/Mod%2014_LN.pdf)
http://nptel.ac.in/courses/Webcourse-contents/IISc-BANG/Operating%20Systems/pdf/PPTs/Mod_14.pdf (http://nptel.ac.in/courses/Webcourse-contents/IISc-
BANG/Operating%20Systems/pdf/PPTs/Mod_14.pdf)
Related Videos:
(/communities/unix-c-oracle-lounge-0/content/overview-of-unix)
Previous
(/communities/unix-c-oracle-lounge-0/content/overview-of-unix)
(/communities/unix-c-oracle-lounge-0/content/connecting-to-unix-server) (/communities/unix-c-oracle-lounge-0/content/connecting-to-unix-server) Next
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline (/feedbacks/new) () located above in top right corner for problems/queries related to quizzes.
Styles Format
Submit
https://campuscommune.tcs.com/communities/unix-c-oracle-lounge-0/content/unix-architecture-0 3/4
7/10/2017 Unix Architecture
https://campuscommune.tcs.com/communities/unix-c-oracle-lounge-0/content/unix-architecture-0 4/4