Unit 1 Notes
Unit 1 Notes
Unit 1 Notes
Unit I: Introduction
Syllabus
Computer System - Elements and organization; Operating System Overview - Objectives and
Functions - Evolution of Operating System; Operating System Structures - Operating System
Services User Operating System Interface - System Calls - System Programs - Design and
Implementation - Structuring methods.
Computer System
AU May-17, 18, 22, Dec-17
• Computer system consists of hardware device and software that are combined to provide a tool
to user for solving problems.
• Fig. 1.1.1 shows modern computer system.
• Modern computer consists of one or two CPU with main memory and various I/O devices.
Common bus is used for communication between these devices. Each device has its own device
controller.
• CPU and device controller uses memory cycle for execution purposes. But memory cycle is
only available to one device at a time.
• Bootstrap program is loaded when user start the computer. It initialies all the device connected
to the computer system and then loads required device drivers.
• After this, operating system loads in the computer system. In UNIX OS, an 'init' is the first
process which execute by OS.
• Interrupt is software and hardware. It is used to send signal to CPU. Software interrupt is
sometime called system call.
• When interrupt is trigger, the CPU stops executing the instruction and control is transfer to the
fixed location. Starting address is stored at fixed location where the service routine executes.
• Interrupts do not alter the control flow of the process executing on the processor.
Storage structure
• Processor access the data from main memory before executing any instruction. Main memory is
also called Random Access Memory (RAM).
• DRAM is used in main memory. Fig. 1.1.2 shows hierarchy of storage device.
• At the top of the hierarchy, we have storage on the CPU registers. For accessing the CPU, it is
fastest form of storage.
• Cache memory capacity is less than 1 MB.
• User program and data are stored in the main memory. Main memory is volatile, so it can
not stored permanently.
Instruction Execution
• The program which is to be executed is a set of instructions which are stored in memory. The
Central Processing Unit (CPU) executes the instructions of the program to complete a task.
• The major responsibility of the instruction execution is with the CPU. The instruction execution
takes place in the CPU registers.
• A special register contains the address of the instruction. The CPU "fetches" the instruction
from memory at that address.
• The CPU "decodes" the instruction to figure out what to do. The CPU "fetches" any data
b(operands) needed by the instruction, from memory or registers.
• Fig 1.1.3 shows instruction execution cycle.
• The CPU "executes" the operation specified by the instruction on this data. The to CPU
"stores" any results into a register or memory.
•The register used for instruction execution are as follows:
1. Memory Address Register (MAR): It specifies the address of memory location from which
data or instruction is to be accessed (for read operation) or to best yr which the data is to be
stored (for write operation).
2. Program Counter (PC): It keeps track of the instruction which is to be executed next, after
the execution of an on-going instruction.
3. Instruction Register (IR): Here the instructions are loaded before their execution.
Interrupts
• Definition: It is an event external to the currently executing process that causes a change in the
normal flow of instruction execution; usually generated by hardware not devices external to the
CPU. They tell the CPU to stop its current activities and not execute the appropriate part of the
operating system.
• Fig. 1.1.4 shows interrupts.
• The CPU uses a table and the interrupt vector to find OS the code to execute in response to
interrupts. When interrupt signaled, processor executes a routine called an interrupt handler to
deal with the interrupt.
• Operating system may specify a set of instructions, called an interrupt handler, to be executed
in response to each type of interrupt.
• Interrupt Service Routine (ISR) is the software code that is executed when the hardware
requests interrupt. The design of the interrupt service routine requires careful consideration of
many factors. Although interrupt handlers can create and use local variables, parameter passing
between threads must be implemented using shared global memory variables.
• A private global variable can be used if an interrupt thread wishes to pass information to itself,
e.g., from one interrupt instance to another. The execution of the main program is called the
foreground thread, and the executions of the various interrupt service routines are called
background threads.
• Interrupts are of three types: Hardware, software and trap.
• Hardware Interrupts are generated by hardware devices to signal that they need some
attention from the OS. Software Interrupts are generated by programs when they want to
request a system call to be performed by the operating system.
• Traps are generated by the CPU itself to indicate that some error or condition occurred for
which assistance from the operating system is needed.
• Interrupt and trap numbers are defined by the hardware which is also responsible for calling the
procedure in the kernel space. An interrupt handler is called in response to a signal from another
device while a trap handler is called in response to an instruction executed within the CPU.
• Synchronous interrupts occur when a process attempts to perform an illegal action, such as
dividing by zero or referencing a protected memory location. Synchronous interrupt occurs due
to software execution.
• Cache in CPU unit is referred as Level1 cache (L1 cache) and cache stored in a chip next to
CPU is termed as Level2 cache (L2 cache) and it resides on the motherboard.
• The function of cache is to act as a buffer between a relatively fast device and a relatively slow
one.
• Small unit of allocation in cache is page. Cache is arranged into slots or pages. It uses two
components data store and tag RAM. The actual data is stored in a
different part of the cache, called the data store. The values stored in the tag RAM determine
whether a cache lookup results in a hit or a miss.
• The size of the tag RAM determines what range of main memory can be cached. Tag RAM is
a small piece of SRAM that stores the addresses of the data that is stored in the SRAM
• A cache address can be specified simply by index and offset. The tag is kept to allow the cache
to translate from a cache address to a unique CPU address.
• A cache hit means that the CPU tried to access an address, and a matching cache block was
available in cache. So, the cache did not need to access RAM. In a cache miss, the CPU tries to
access an address, and there is no matching cache block. So, the cache is forced to access RAM.
of
• Cache includes tags to identify which block of main memory is in each cache slot.
• Every cache block has associated with it at least the modify and valid bits, and a tag address.
The valid bit says if the cache block is used or is unused. The modify bit makes sense only if the
valid bit is set. The modify bit says whether the data in the cache block is different from RAM or
is the same as RAM.
• The size of a page is dependent on the size of the cache and how the cache is organized. A
cache page is broken into smaller pieces, each called a cache line. The size of a cache line is
determined by both the processor and the cache design. .
• When the processor starts a read cycle, the cache checks to see if that address is a cache hit.
• Cache Hit: If the cache contains the memory location, then the cache will respond to the read
cycle and terminate the bus cycle.
• Cache Miss: It is reference to item that is not resident in cache, but is resident in main
memory. For cache misses, the fast memory is cache and the slow memory is main memory.
• Resource sharing and resource abstraction are two key aspects of the operating system.
• Purposes of the operating system :
1. OS provides an interface between the computer hardware and computer user (programmer). It
simplifies the programmer job like editing, coding, creation.
2. Allocation and use of computer resources among the programmer is controlled arnaldo it by
OS.
• The operating system is responsible for managing the all resources. A portion of the OS is in
main memory. This portion of the OS is called kernel.
• User program and data is also stored in remaining parts of the memory. Allocation of main
memory is controlled by operating system with the help of memory management hardware.
• I/O device is controlled by OS and it decides when an I/O device can be used by program in
execution. Processor is one type of resource and OS control the execution of user program on the
processor.
• Modern OS allows multiple programs to run at the same time. If multiple users are using
computer then there is need of managing and protecting the memory, I/O devices and other
resources.
• Resource management includes sharing resources in different ways. Time and space are the two
concept for resource sharing.
1. Time: Time slot is allocated to each program first one gets to use the resource then another
and so on.
2. Space: Consider the example of main memory. Main memory is normally divided up among
several running programs, so each one can be resident at the same time.
• Types of an operating system are a grouping that differentiates or identifies the operating
system based on how it works the type of hardware it controls and the application it supports.
• Evolution of an operating systems are as follows:
a) Early systems/serial processing (mid 1940s to mid 1950s)
b) Simple batch systems (1960)
c) Multi-programmed batch systems (1970)
d) Time-sharing and real-time systems (1970)
e) Multiprocessor systems (1980)
f) Networked/distributed systems (1980)
Batch System
• Batch system process a collection of jobs, called a batch. Batch is a sequence of user jobs.
• Job is a predefined sequence of commands, programs and data that are combined into a single
unit.
• Each job in the batch is independent of other jobs in the batch. A user can define a job control
specification by constructing a file with a sequence of commands.
• Jobs with similar needs were batched together to speed up processing. Card readers and tape
drives are the input device in batch systems. Output devices are tape drives, card punches and
line printers.
• Primary function of the batch system is to service the jobs in a batch one after another without
requiring the operator's intervention. There is no need for human/user interaction with the job
when it runs, since all the information required to complete job is kept in files.
• Some computer systems only did one thing at a time. They had a list of instructions to carry out
and these would be carried out one after the other. This is called a serial system. The mechanics
of development and preparation of programs in such environments are quite slow and numerous
manual operations non involved in the process.
• Batch monitor is used to implement batch processing system. Batch monitor is also called
kernel. Kernel resides in one part of the computer main memory.
• The memory allocator managed the main memory space. Batch monitor controls the sequence
of events. Main memory store the batch monitor and users program and data (jobs). Fig. 1.3.1
shows memory layout for a batch system.
• Computer operator gives a command to start the processing of a batch, the kernel sets up the
processing of the first job. Job was selected from the job queue and loaded into main memory.
When a job completed execution, its memory was released and the output for the job was copied.
• When a job is completed, it returns control to the monitor, which immediately reads in the next
job.
• Fig. 1.3.2 shows concept of batch system.
• Scheduling is also simple in batch system. Jobs are processed in the order of submission i.e.
first come first served fashion.
• When a job completes execution, its memory is released and the output for the job gets copied
into an output spool for later printing.
Spooling
• Spooling an acronym for simultaneous peripheral operation on line. Spooling uses the disk as a
large buffer for outputting data to printers and other devices. It can also be used for input, but is
generally used for output.
• Its main use is to prevent two users from alternating printing lines to the line printer on the
same page, getting their output completely mixed together. It also helps in reducing idle time and
overlapped I/O and CPU.
• Batch system often provides simple forms of file management. Access to file is serial. Batch
systems do not require any time critical device management.
• Batch systems are inconvenient for users because users cannot interact with their jobs to fix
problems. There may also be long turnaround times. Example of this system is generating
monthly bank statement.
• An optimization used to minimize the discrepancy between CPU and I/O speeds is spooling. It
overlaps of one job with computation of other job.
• The spooler for instance could be reading the input of one job while printing the output of
different job.
• Spooling refers to putting jobs in a buffer, a special area in memory or on a disk where a device
can access them when it is ready.
• Spooling is useful because device access data at different rates. The buffer provides a waiting
station where data can rest while the slower device catches up.
• Computer can perform I/O in parallel with computation, it becomes possible to have the
computer read a deck of cards to a tape, drum or disk and to write out to a tape printer while it
was computing. This process is called spooling.
• The most common spooling application is print spooling.
• Spooling batch system were the first and are the simplest of the multiprogramming systems.
Advantages of spooling
1. The spooling operation uses a disk as a very large buffer.
2. Spooling is however capable of overlapping I/O operation for one job with processor
operations for another job.
Advantages and Disadvantages of Batch System
Advantages of batch system
1. Move much of the work of the operator to the computer.
2. Increased performance since it was possible for job to start as soon as the previous job
finished.
Disadvantages of batch system
1. Turn around time can be large from user standpoint.
2. Program debugging is difficult.
3. There was possibility of entering jobs in infinite loop.
4. A job could corrupt the monitor, thus affecting pending jobs.
5. Due to lack of protection scheme, one batch job can affect pending jobs.
• Concept of virtual machine is used in time sharing system. It creates virtual machine one per
user. User interaction with system by using virtual machine. User enters the command for virtual
machine and result will received back to user.
• Time sharing system is more complex than multiprogramming operating system. It So disk sni
also takes help of file system. File system is stored on the disk management is also required.
• Major problem with time sharing system is protection and security of data.
• Time sharing system uses medium term scheduling such as round robin for the foreground.
Background process uses can use a different scheduling method.
• Difference between multiprogramming and multitasking operating system is context switching.
In multiprogramming system a context switching occurs only when the currently executing
process stalls for some reasons.
• Time sharing system gives each user the impression that the entire system is dedicated to his
use. Context switching simply allows several applications to be open, but only one is working at
a time.
• Truly speaking, even in true multi-tasking, only one application program is ever running at
anyone instant. Because the computer automatically switches from one program to the next
program so quickly, all the programs seem to run don simultaneously.
Difference between Time sharing Os and multiprogramming Os
• In a multiprogramming and time-sharing environment, several users share the system
simultaneously. This situation can result in various security problems. Such problems are
privacy, integrity and denial of service.
a) Privacy: One user can read the private data of another user.
b) Integrity: One user can corrupt the private data of another user.
c) Denial of Service: One user can prevent another user from getting anything done.
• Can we get the same degree of security in a time-shared machine as we have in a dedicated
machine? Solution to this is Yes/No. There are two answers, either one correct.
a) Yes: If we can ensure that the operating system prevents any sharing of data between users,
either for reading or writing and fairly shares the computer, then we can achieve the same level
of security.
b) No: We can never be sure that our software doesn't have bugs, so we can never be sure that we
prevent all sharing of data and fairly allocate computer resources.
1.4 Multiprocessor System
• Multiprocessor system means more than one processor in close communication. All the
processor share common bus, clock, memory and peripheral devices.
• Multiprocessor system is also called parallel system or tightly coupled systems. Multiprocessor
operating systems are just regular operating systems. They handle system calls, do memory
management, provide a file system, and manage I/O devices.
• Multiprocessor systems is also known as parallel systems or multicore systems.
•Features of Multiprocessor Systems :
1.The processor should support efficient context switching operation.
2. It supports large physical address space and larger virtual address space.
3. If one processor fails, then other processors should retrieve the interrupted process state so that
execution of the process can continue.
4.The inter-process communication mechanism should be provided and implemented in
hardware as it becomes efficient and easy.
• Multiprocessors can be used in different ways:
1. Uniprossesors (single-instruction, single-data or SISD)
2. Within a single system to execute multiple, independent sequences of instructions in multiple
contexts (multiple-instruction, multiple-data or MIMD); 3. 3.A single sequence of instructions in
multiple contexts (single-instruction, multiple-data or SIMD, often used in vector processing);
4. Multiple sequences of instructions in a single context (multiple-instruction, single-data or
MISD, used for redundancy in fail-safe systems and sometimes applied to describe pipelined
processors or hyper threading).
Symmetric Multiprocessing
• The simplest multiprocessors are based on a single bus. In symmetric multiprocessing, number
of homogeneous processor are running independently without affecting other programs.
• Systems that treat all CPUs equally are called symmetric multiprocessing (SMP) systems.
• Each processor uses 'different data and program but sharing some common resources like
memory, I/O device etc. Fig. 1.4.1 shows multiprogramming system.
• In SMP, all processor are at the same level. They work in peers. There is no master-slave
relationship in between the processor. Each processor shares a single copy of operating system.
• Symmetric multiprocessing is easier to implement in operating systems. Examples of
symmetric multiprocessing operating systems are Windows NT 4.0, Novell Netware 2.1 etc.
Asymmetric Multiprocessor
• If all CPUs are not equal, system resources may be divided in a number of ways, including
asymmetric multiprocessing (ASMP), non-uniform memory access
(NUMA) multiprocessing, and clustered multiprocessing.
• All CPUs are not equal. There is one master processor and remaining is the slave processor.
Each processor has its own memory address space.
• A master processor controls the whole operations. It gives the instruction to the slave processor
or slave processor uses some predefined set of tasks.
• Asymmetric multiprocessing has one master CPU and the remainder CPUs are slaves. The
Master distributes takes among the slaves and I/O is usually done by the master only.
• Each processor has own task which assign by master processor. Asymmetric multiprocessing is
difficult to implement.
• Examples of distributed operating system are Amoeba, chrous, mach and v-system
• A Local Area Network (LAN) is a network that is confined to a relatively small area. It is
generally limited to a geographic area such as a college, lab or building.
• WAN provides long distance transmission of data and voice. Computers connected to a wide-
area network are often connected through public networks, such as the telephone system. They
can also be connected through leased lines or satellites.
• A MAN typically covers an area of between 5 and 50 km diameter. Many MANS cover an area
the size of a city, although in some cases MANS may be as small as a group of buildings.
• A MAN often acts as a high speed network to allow sharing of regional resources. MAN
provides the transfer rates from 34 to 150 Mbps.
Advantages and Disadvantages of DS
a) Advantages of distributed OS:
1. Resource sharing: Sharing of software resources such as software libraries, database and
hardware resources such as hard disks, printers and CDROM can also be done in a very effective
way among all the computers and the users.
2. Higher reliability: Reliability refers to the degree of tolerance against errors and component
failures. Availability is one of the important aspects of reliability. Availability refers to the
fraction of time for which a system is available for use.
3. Better price performance ratio: Reduction in the price of microprocessor and increasing
computing power gives good price-performance ratio.
4. Shorter responses times and higher throughput.
5. Incremental growth: To extend power and functionality of a system by simply adding
additional resources to the system.
b) Disadvantages :
1. There are no current commercially successful examples.
2. Protocol overhead can dominate computation costs.
3. Hard to build well.
4. Probably impossible to build at the scale of the internet.
Client-Server Computing
• The system is structured as a set of processes, called servers that offer services to the users,
called clients.
• Server systems are of two types: Compute servers and file servers.
• Compute-server system: It provides an interface to which a client can send a request to
perform an action. In response, the server performs some operation and sends the results to the
client. Server contains database.
• File-server system: Client can performs various operation like create, read, update and delete
file on file server. Web server is best example of this type.
• Fig. 1.6.2 shows the client server model.
• The client-server model is usually based on a simple request/reply protocol, implemented with
send/receive primitives or using Remote Procedure Calls (RPC) or Remote Method Invocation
(RMI) :
1. The client sends a request (invocation) message to the server asking for some service;
2. The server does the work and returns a result (e.g. the data requested) or an error code if the
work could not be performed.
• Server is a process; Client is a process. Clients invoke servers, servers send results to clients.
Servers can be clients of other servers.
• HTTP (Web) server is a server process to its client processes (web browsers).
• HTTP server may be a client of a database server. Service may be provided by multiple servers,
as is most often the case within a large enterprise.
• Cache is a repository of recently accessed objects (files, graphics) that is physically closer to
the client than the server from which it originated. Proxy server sits in between clients and
servers and can play many mitigation roles.
Advantages:
1. Simple to implement.
2. Provides good security.
3. All files are stored in a central location.
Disadvantages:
1. Single point of failure.
2. A specialist network operating system is needed.
Peer-to-Peer System
• All processes (objects) play similar role. Do not require a server process. Processes (objects)
interact without particular distinction between clients and servers.
• The pattern of communication depends on the particular application. Fig. 1.6.3 shows the peer-
to-peer model. (See Fig. 1.6.3 on next page.)
• Processing and communication loads for access to objects are distributed across many
computers and access links. This is the most general and flexible model.
• A group of computers connected together to combine their computing and 'processing abilities
to search the Internet or solve very complex problems
Layered Approach
• Second type of operating system design is layered approach. Operating system is divided into
number of layers. Each layer boundary is properly defined. Bottom layer is called layer 0 and top
most layer is called layer N. Layer N provides user interface.
• A function of layer is also fixed. Fig. 1.9.1 shows the operating system layer. Each layer
consists of data structure and a set of routines. Layer provides services to upper and lower layers.
• Modularity is the advantage of the layered system. Number of layers are selected properly and
each layer uses the services and functions of lower level layer (Below layer of the current layer).
This type of design simplifies the debugging and system verification.
• First layer contains only basic hardware to implement function. So only first layer is debugged
for checking the whole system. If error is not found then the system will works properly. If error
is encounter while debugging second layer, then error is related to the second layer only. In this
operating system is designed and implemented. It simplifies the design task of the operating
system.
• Care should be taken while designing the layers. Which functions are added to which layer
must be designing properly? Layer boundaries must be defined properly. Some of the function
includes only in the lower layer. Device driver, memory management and input/output operation
function must be included in the lower layer.
• Secondary storage is required for all operation. When CPU changes the process as per
scheduling method, currently executing process is stored on the secondary storage. Disk space is
required for this purpose. So CPU scheduling is includes in the above layer of the secondary
storage layer.
• Each layer uses system calls for performing their operation. Layer adds overhead to the system
call.
Monolithic Structure
• Traditional UNIX operating system uses monolithic kernel architecture. The entire operating
system runs as a single program in kernel mode. Program contains operating system core
function and device drivers.
• Most of the operation performed by kernel is via system call. Required system calls are made
within programs and a checked copy of the request is passed through a system call. Fig. 1.9.2
shows monolithic kernel.
• LINUX operating system and FreeBSD uses modern monolithic kernel architecture. It loads the
modules at run time. There is easy access of kernel function as required and minimize the code
running in kernel space.
• Monolithic kernel used in Windows 95, Windows 98, Linux and FreeBSD etc.
Advantages:
1. Simple to design and implement.
2. Simplicity provides speed on simple hardware.
3. It can be expanded using module system.
4. Time tested and design well known.
Disadvantages :
1.Runtime loading and unloading is not possible because of module system.
2. If code base size increases, maintain is difficult.
3. Fault tolerance is low.
Microkernel
• Microkernel provides minimal services like defining memory address space, IPC and process
management. It is small operating core. Hardware resource management is implemented
whenever process is executing.
• The function of microkernel is to provide a communication facility between the client
programs. It also provides facility to various services which are running in user space. Message
passing method is for communication two processes.
• Microkernel runs in kernel mode and rest run in normal user processes. Microkernel also
provides more security and reliability. Most of the services are running as user rather than kernel
processes.
• By running device driver and file system as a separate user process, a error in one can crash
only single component. Fig. 1.9.3 shows microkernel.
Virtual Machine
• In a pure virtual machine architecture the operating system gives each process the illusion that
it is the only process on the machine. The user writes an application as if only its code were
running on the system.
• Each user interacts with the computer by typing commands to the virtual machine on a virtual
system console and receiving results back from the machine as soon as they are computed.
• Each user directs the virtual machine to perform different commands. These commands are
then executed on the physical machine in a multiprogramming environments.
• Virtualization is an abstraction layer that decouples the physical hardware from the operating
system to deliver greater IT resource utilization and flexibility.
• It allows multiple virtual machines, with heterogeneous operating systems to run in isolation,
side-by-side on the same physical machine. Fig. 1.9.4 shows virtual machine.
• Each virtual machine has its own set of virtual hardware (e.g., RAM, wol CPU, NIC, etc.) upon
which an o operating system and applications The operating system creates the illusion of
multiple processes, each executing on its own processor with its own (virtual) memory.
• The main components of virtual machine are the control program, conversational monitor
system,remote spooling communication interactive problem control and system.
• The control program creates the environments in which virtual machines can executes. It also
manages the real machines underlying the virtual machine environment.
• The java virtual machine is one of the most widely used virtual machines.
• Virtual machines tend to be less efficient than real machines because they access the hardware
indirectly.
Benefits
1. There is no overlap amongst memory as each virtual memory has its own memory space.
2. Virtual machines are completely isolated from the host machine and other virtual machines.
3. Data does not leak across virtual machines.
Virtualization
•Virtualization means running multiple machines on a single hardware. The "Real" hardware
invisible to operating system. OS only sees an abstracted out picture. Only Virtual Machine
Monitor (VMM) talks to hardware.
• It is "a technique for hiding the physical characteristics of computing resources from the way in
which other systems, applications, or end users interact with those resources. This includes
making a single physical resource appear to function as multiple logical resources; or it can
include making multiple physical resources appear as a single logical resource."
• It is divided into two main categories :
1. Platform virtualization involves the simulation of virtual machines.
2. Resource virtualization involves the simulation of combined, fragmented, or simplified
resources.
• Services will change according to the operating system. May be the two different operating
system provides same type of services with different names. OS makes programmer job easy by
providing different services.
1. Program execution: Before executing the program, it is loaded into the memory by operating
system. Once program loads into memory, its start execution. Program finishes its execution with
error or without error. It is up to the user for next operation.
2. Input- output operation: Program is combination of input and output statement. While
executing the program, it requires I/O device. OS provides the I/O devices to the program.
3. Error detection: Error is related to the memory, CPU, I/O device and in the user program.
Memory is full, stack overflow, file not found, directory not exist, printer is not ready, attempt to
access illegal memory are the example of error detection.
4. File and directory operation: User wants to read and writes the file and directory. User
wants to search the file/directory, rename file, and modify the file etc. user also create the file or
directory. All these operation is performed by user by using help of operating system.
6. Graphical user interface: User interacts with operating system by using user interface. All
operating system provides user interface. Command line interface and batch interface are two
types of user interface used in the operating system. In command line interface, user enters the
text command for performing operation. Batch interface uses files. A file contains the command
for various operations. When file executes, command output is displayed on the screen.
• All above services provided by operating system is only for single user. If suppose there are
multiple user in the system, then operating system provides some Po additional services. These
services are resource allocation, accounting, protection of data and security.
• Different types of resources are managed by the operating system. Multiple users require
different resource for their execution. One type of resource may be required by two different
users. So resource allocation is necessary.
• Accounting means keeping information of resources and users. Which types of resources are
allocated to which user and whether particular user has permission sostro for using this type of
resources.
Command Interpreters
• A command interpreter is a system software that understands and executes commands that are
entered interactively by a human or from another program. Command interpreter is an important
part of any operating system. It provides an interface between the user and the computer.
• Command interpreter is also called command-line interface.
• Most operating systems, including Linux, UNIX and Windows, treat the command interpreter
as a special program that is running when a process is initiated or when a user first logs on.
• A command interpreter is often also called a command shell or simply a shell. A command
shell also usually provides a set of programs or utilities which allows ad users to perform file
management functions.
• The shell utility provides a user interface to many system services. For example, user requests
such as listing file names in a directory, running a program, logging out, may all be handled by
the shell. The shell may invoke other utilities to actually do the work; for example, directory file
listing is sometimes a utility program itself.
• The command interpreter itself contains the code to execute the command. For example, a
command to delete a file may cause the command interpreter to jump to a section of its code that
sets up the parameters and makes the appropriate system call.
• User may choose among several different shells, including the C shell, Bourne-Again shell,
Korn shell, and others. Third-party shells and free user-written shells are also available. A very
popular shell on most commercial variants of Unix is the Korn shell.
• Command line is text based interface of the Linux system. Terminal is another name in Linux
system. User can communicate with system is by using command. You can combine more than
one command and get output.
• Commands are executed at the prompt. Command line interface gives the user more control
and options. There are many varieties of Linux, but almost all of them use similar commands that
can be entered from a command-line interface terminal.
• The syntax of command line is as follows:
#command options
• Example :
[root@IAD~]# hostname