0% found this document useful (0 votes)
24 views23 pages

Unit 1 Operating System

The document discusses parallel processing in multiprocessor systems, highlighting contention sources such as locking systems, shared data, and false sharing, which can impact performance. It also provides an overview of operating systems, their functions, evolution, and services, detailing how they manage resources and support user interactions. Additionally, it covers operating system structures, operations, and system calls, emphasizing the importance of distinguishing between user and kernel modes for effective execution.

Uploaded by

manimegalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views23 pages

Unit 1 Operating System

The document discusses parallel processing in multiprocessor systems, highlighting contention sources such as locking systems, shared data, and false sharing, which can impact performance. It also provides an overview of operating systems, their functions, evolution, and services, detailing how they manage resources and support user interactions. Additionally, it covers operating system structures, operations, and system calls, emphasizing the importance of distinguishing between user and kernel modes for effective execution.

Uploaded by

manimegalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

DOWNLOADED FROM STUCOR APP

parallel processing is used in the fields like artificial intelligence and expert system,
image processing, weather forecasting etc.
 In a multiprocessor system, the dynamically sharing of resources among the various
processors may cause therefore, a potential bottleneck. There are three main sources of
contention that can be found in a multiprocessor operating system:

1.8.2.1 Locking system:


 In order to provide safe access to the resources shared among multiple processors,
they need to be protected by locking scheme. The purpose of a locking is to
serialize accesses to the protected resource by multiple processors. Undisciplined
use of locking can severely degrade the performance of system.
 This form of contention can be reduced by using locking scheme, avoiding long
critical sections, replacing locks with lock-free algorithms, or, whenever possible,

P
avoiding sharing altogether.

AP
1.8.2.2 Shared data:
 The continuous accesses to the shared data items by multiple processors (with one
or more of them with data write) are serialized by the cache coherence protocol.
Even in a moderate-scale system, serialization delays can have significant impact
on the system performance.
R
 In addition, bursts of cache coherence traffic saturate the memory bus or the
interconnection network, which also slows down the entire system. This form of
CO
contention can be eliminated by either avoiding sharing or, when this is not
possible, by using replication techniques to reduce the rate of write accesses to the
shared data.
U

1.8.2.3 False sharing:


ST

 This form of contention arises when unrelated data items used by different
processors are located next to each other in the memory and, therefore, share a
single cache line: The effect of false sharing is the same as that of regular sharing
bouncing of the cache line among several processors. Fortunately, once it is
identified, false sharing can be easily eliminated by setting the memory layout of
non-shared data.
1.9 OPERATING SYSTEM OVERVIEW
1.9.1 Objectives and Functions

 A program that is executed by the processor that frequently relinquishes


control and must depend on the processor to regain control.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 A program that mediates between application programs and the hardware

 A set of procedures that enable a group of people to use a computer system.

 A program that controls the execution of application programs

 An interface between applications and hardware

1.9.2 Functions
Usage
Computer system
Control
Support

P
Usage

AP
 Users of a computer system:
 Programs - use memory, use CPU time, use I/O devices
 Human users
 Programmers - use program development tools such as debuggers, editors end
R
users - use application programs, e.g. Internet explorer
Computer system
CO
hardware + software
OS is a part of the computer software, it is a program. It is a very special program, that is
the first to be executed when the computer is switched on, and is supposed to control and
support the execution of other programs and the overall usage of the computer system.
U

Control
The operating system controls the usage of the computer resources - hardware devices
and software utilities. We can think of an operating system as a Resource Manager. Here
ST

are some of the resources managed by the OS:

 Processors,

 Main memory,

 Secondary Memory,

 Peripheral devices,

 Information.
Support
 The operating system provides a number of services to assist the users of the
computer system:

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
For the programmers:
Utilities - debuggers, editors, file management, etc.
For the end users - provides the interface to the application programs
For programs - loads instructions and data into memory, prepares I/O devises for
usage, handles interrupts and error conditions.
1.10 EVOLUTION OF OPERATING SYSTEM
1.10.1 Serial Processing - 1940’s – 1950’s programmer interacted directly with hardware. No
operating system.

Problems

Scheduling - users sign up for machine time. Wasted computing time

P
Setup Time- Setup included loading the compiler, source program, saving

AP
compiled program, and loading and linking. If an error occurred - start over.

1.10.2 Simple Batch Systems

Improve the utilization of computers.

Jobs were submitted on cards or tape to an operator who batches jobs together
R
sequentially. The program that controls the execution of the jobs was called monitor - a simple
version of an operating system. The interface to the monitor was accomplished through Job
CO
Control Language (JCL). For example, a JCL request could be to run the compiler for a
particular programming language, then to link and load the program, then to run the user
program.

Hardware features:
U

Memory protection: do not allow the memory area containing the monitor to be altered

Timer: prevents a job from monopolizing the system


ST

Problems:

Bad utilization of CPU time - the processor stays idle while I/O devices are in use.

1.10.3 Multiprogrammed Batch Systems

More than one program resides in the main memory. While a program A uses an I/O device the
processor does not stay idle, instead it runs another program B.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP

P
New features:

AP
R
Memory management - to have several jobs ready to run, they must be kept in main
memory
CO

Job scheduling - the processor must decide which program to run.

1.10.4 Time-Sharing Systems

Multiprogramming systems: Several programs use the computer system.


U

Time-sharing systems: Several (human) users use the computer system interactively.
ST

Characteristics:

 Using multiprogramming to handle multiple interactive jobs


 Processor’s time is shared among multiple users
 Multiple users simultaneously access the system through terminals

1.10.5 Operating-System Services


The OS provides certain services to programs and to the users of those programs.

1. Program execution:

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
The system must be able to load a program into memory and to run that
program. The program must be able to end its execution, either normally or abnormally
(indicating error).

2. I/O operations:
A running program may require I/O. This I/O may involve a file or an I/O device.

3. File-system manipulation:
The program needs to read, write, create and delete files.

4. Communications :
In many circumstances, one process needs to exchange information with another
process. Such communication can occur in two major ways. The first takes place
between processes that are executing on the same computer; the second takes place

P
between processes that are executing on different computer systems that are tied
together by a computer network.

AP
5. Error detection:
The operating system constantly needs to be aware of possible errors. Errors may
occur in the CPU and memory hardware (such as a memory error or a power failure), in
I/O devices (such as a parity error on tape, a connection failure on a network, or lack of
paper in the printer), and in the user program (such as an arithmetic overflow, an attempt
R
to access an illegal memory location, or a too-great use of CPU time). For each type of
error, the operating system should take the appropriate action to ensure correct and
consistent computing.
CO

6. Resource allocation:
Different types of resources are managed by the Os.
When there are multiple users or multiple jobs running at the same time, resources
U

must be allocated to each of them.

7. Accounting:
ST

We want to keep track of which users use how many and which kinds of
computer resources. This record keeping may be used for accounting or simply for
accumulating usage statistics.

8. Protection:
The owners of information stored in a multiuser computer system may want to
control use of that information. Security of the system is also important.
1.10.6 CP derivatives

1. CP
2. CP-VM
3. CP/M

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
1. CP/M-86
2. DOS
3. DRDOS
1. FreeDOS
4. Microsoft Windows
1. Windows 3.x
2. Windows 95/98/Me
3. Windows Xp
4. Windows Vista
5. Windows 7
6. windows 8
1.10.7 MULTICS derivatives

1. UNIX

P
 Unix V5 (SCO Unix)
 Modern Unix (Solaris / BSD )

AP
 FreeBSD
 OpenBSD
2. Xenix
3. Linux
4. Plan 9 jim bading tahaha
 Inferno to hell
R
5. QNX
6. VSTa
CO
7. Mac OSX
8. MIPS RISC/os
9. RISC iX
1.10.8 VMS derivatives

1. VMS
U

1. OpenVMS
2. OS/2
ST

1. eComStation
3. Microsoft Windows =rude-magic!
1. ReactOS
1.10.9 MacOS derivatives

1. Mac OS
1. Mac OS 9
1.10.10 Cambridge CAP Computer derivatives

1. KeyKOS
1. EROS
2. Coyotos
3. CapROS

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
1.10.11 IBSYS derivatives

1. OS/360
2. OS/400
1.10.12 AmigaOS Derivatives

1. AmigaOS
2. AROS
1. AmigaOS 4.x
2. MorphOS
1.10.13 Novel Operating Systems

1. Grasshopper
2. ITS

P
3. BeOS

AP
1.11 COMPUTER SYSTEM ORGANIZATION
1.11.1Operating System Structure
1.11.1.1 MS-DOS System Structure
 MS-DOS – written to provide the most functionality in the least space.
R
 Not divided into modules.
CO
 Although MS-DOS has some structure, its interfaces and levels of functionality are not
well separated.
U
ST

1.11.1.2 Unix System Structure


 UNIX – limited by hardware functionality, the original UNIX operating system had
limited structuring. The UNIX OS consists of two separable parts.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 Systems programs – use kernel supported system calls to provide useful functions such
as compilation and file manipulation.
 The kernel - Consists of everything below the system-call interface and above the
physical hardware
 Provides the file system, CPU scheduling, memory management, and other operating-
system functions; a large number of functions for one level.

P
AP
1.11.1.3 Layered Approach
R
 The operating system is divided into a number of layers (levels), each built on top of
lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user
interface.
CO

 An OS layer is an implementation of an abstract object that is the encapsulation of data


and operations that can manipulate those data. These operations (routines) can be invoked
by higher-level layers. The layer itself can invoke operations on lower-level layers.
 Layered approach provides modularity. With modularity, layers are selected such that
U

each layer uses functions (operations) and services of only lower-level layers.
 Each layer is implemented by using only those operations that are provided lower level
layers.
ST

 The major difficulty is appropriate definition of various layers.


1.11.1.4 Microkernel System Structure
 Moves as much from the kernel into “user” space.
 Communication takes place between user modules using message passing.
 Benefits:
 Easier to extend a microkernel
 Easier to port the operating system to new architectures

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 More reliable (less code is running in kernel mode)
 More secure

1.11.2 Operating-System Operations


 If there are no processes to execute, no I/O devices to service, and no users to whom to
respond, an operating system will sit quietly, waiting for something to happen. Events are
almost always signaled by the occurrence of an interrupt or a trap.
 A trap (or an exception) is a software-generated interrupt caused either by an error (for
example, division by zero or invalid memory access) or by a specific request from a user
program that an operating-system service be performed. The interrupt-driven nature of an
operating system defines that system’s general structure.
 Without protection against these sorts of errors, either the computer must execute only

P
one process at a time or all output must be suspect. A properly designed operating system
must ensure that an incorrect (or malicious) program cannot cause other programs to
execute incorrectly.

AP
1.11.2.1 Dual-Mode and Multimode Operation
 In order to ensure the proper execution of the operating system, we must be able to
R
distinguish between the execution of operating-system code and user defined code. The
approach taken by most computer systems is to provide hardware support that allows us
to differentiate among various modes of execution.
CO
U
ST

 At the very least, we need two separate modes of operation: user mode and kernel mode
(also called supervisor mode, system mode, or privileged mode).
 A bit, called the mode bit, is added to the hardware of the computer to indicate the
current mode: kernel (0) or user (1). With the mode bit, we can distinguish between a task
that is executed on behalf of the operating system and one that is executed on behalf of
the user.

1.11.2.2Timer

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 We cannot allow a user program to get stuck in an infinite loop or to fail to call system
services and never return control to the operating system.
 To accomplish this goal, we can use a timer. A timer can be set to interrupt the computer
after a specified period. The period may be fixed (for example, 1/60 second) or variable
(for example, from 1 millisecond to 1 second).
 A variable timer is generally implemented by a fixed-rate clock and a counter.
 The operating system sets the counter. Every time the clock ticks, the counter is
decremented. When the counter reaches 0, an interrupt occurs. For instance, a 10-bit
counter with a 1-millisecond clock allows interrupts at intervals from 1 millisecond to
1,024 milliseconds, in steps of 1 millisecond.

1.13 SYSTEM CALLS


 System calls provide the interface between a process and the operating system.

P
 These calls are generally available as assembly-language instructions.

AP
 System calls can be grouped roughly into five major categories:

1. Process control
2. file management
3. device management
R
4. information maintenance
CO
5. communications.
1. Process Control
 end,abort
 load, execute
U

 Create process and terminate process


ST

 get process attributes and set process attributes.


 wait for time, wait event, signal event
 Allocate and free memory.
2. File Management
 Create file, delete file
 Open , close
 Read, write, reposition
 Get file attributes, set file attributes.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
3. Device Management
 Request device, release device.
 Read, write, reposition
 Get device attribtues, set device attributes
 Logically attach or detach devices

4. Information maintenance
 Get time or date, set time or date
 Get system data, set system data
 Get process, file, or device attributes

P
 Set process, file or device attributes

AP
5. Communications
 Create, delete communication connection
 Send, receive messages
 Transfer status information
R
 Attach or detach remote devices
Two types of communication models
CO

(a) Message passing model


(b) Shared memory model
1.14 SYSTEM PROGRAMS
U

 System programs provide a convenient environment for program development and


execution.
ST

 They can be divided into several categories:


1. File management: These programs create, delete, copy, rename, print, dump, list and
generally manipulate files and directories.
2. Status information: The status such as date, time, amount of available memory
or diskspace, number of users or similar status information.
3. File modification: Several text editors may be available to create and modify the
content of files stored on disk or tape.
4. Programming-language support: Compilers, assemblers, and interpreters for
common programming languages are often provided to the user with the operating system.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
5. Program loading and execution: The system may provide absolute loaders,
relocatable loaders, linkage editors, and overlay loaders.
6. Communications: These programs provide the mechanism for creating virtual
connections among processes, users, and different computer systems. (email, FTP, Remote log
in)
7. Application programs: Programs that are useful to solve common problems, or
to perform common operations.
Eg. Web browsers, database systems.

P
AP
UNIT – II PROCESS MANAGEMENT
Processes-Process Concept, Process Scheduling, Operations on Processes, Interprocess
Communication; Threads- Overview, Multicore Programming, Multithreading Models;
Windows 7 -Thread and SMP Management. Process Synchronization - Critical Section
Problem, Mutex Locks,Semophores, Monitors; CPU Scheduling and Deadlocks.
R
2.1 PROCESSES
CO

 A process is a program in execution.


o We are assuming a multiprogramming OS that can switch from one process to
another.
o Sometimes this is called pseudoparallelism since one has the illusion of a parallel
U

processor.
o The other possibility is real parallelism in which two or more processes are
actually running at once because the computer system is a parallel processor, i.e.,
ST

has more than one processor.

2.1.1: The Process Model

Even though in actuality there are many processes running at once, the OS gives each process the
illusion that it is running alone.

 Virtual time: The time used by just these processes. Virtual time progresses at a rate
independent of other processes. Actually, this is false, the virtual time is typically
incremented a little during systems calls used for process switching; so if there are more
other processors more ``overhead'' virtual time occurs.

 Virtual memory: The memory as viewed by the process. Each process typically believes
it has a contiguous chunk of memory starting at location zero. Of course this can't be true

DOWNLOADED FROM STUCOR APP


 Difficult to provide the desired priority.
c) Time-sharing operating systems
Time-sharing is a technique which enables many people, located at various terminals, to use a particular computer
system at the same time. Time-sharing or multitasking is a logical extension of multiprogramming. Processor's time
which is shared among multiple users simultaneously is termed as time-sharing.
The main difference between Multiprogrammed Batch Systems and Time-Sharing Systems is that in case of
Multiprogrammed batch systems, the objective is to maximize processor use, whereas in Time-Sharing Systems,
the objective is to minimize response time.
Multiple jobs are executed by the CPU by switching between them, but the switches occur so frequently. Thus, the
user can receive an im;mediate response. For example, in a transaction processing, the processor executes each
user program in a short burst or quantum of computation. That is, if nusers are present, then each user can get a
time quantum. When the user submits the command, the response time is in few seconds at most.
The operating system uses CPU scheduling and multiprogramming to provide each user with a small portion of a
time. Computer systems that were designed primarily as batch systems have been modified to time-sharing
systems.
Advantages of Timesharing operating systems are as follows −

 Provides the advantage of quick response.


 Avoids duplication of software.
 Reduces CPU idle time.
Disadvantages of Time-sharing operating systems are as follows −

 Problem of reliability.
 Question of security and integrity of user programs and data.
 Problem of data communication.

---------------------------------------------------------------------------------------------------------------------------------------------------------

5. COMPUTER-SYSTEM ORGANIZATION
a) Computer-System Operation
Computer system consists of one or more CPUs and a number of device controllers connected through a
common bus that provides access to shared memory. Each device controller is in charge of a specific type of device.
When a computer is powered on or rebooted,
bootstrap program runs. It is stored within the
computer hardware in read-only memory (ROM) or
electrically erasable programmable read-only memory
(EEPROM), known by the general term firmware. It
initializes all aspects of the system, from CPU registers
to device controllers to memory contents. The
bootstrap knows how to load the operating system and how to start executing that system. Once the kernel is loaded
and executing, it waits for an event to occur.
The occurrence of an event is usually signaled by an interrupt from either the hardware or the software.
Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.
Software may trigger an interrupt by executing a special operation called a system call. When the CPU is
interrupted, it stops what it is doing and immediately transfers execution to a fixed location. The fixed location usually
contains the starting address where the service routine for the interrupt is located. The interrupt service routine
executes; on completion, the CPU resumes the interrupted computation.
b) Storage Structure
The CPU can load instructions only from memory, so any programs to run must be stored there. General-
purpose computers run most of their programs from rewritable memory, called main memory (also called random-
access memory, or RAM). Main memory commonly is implemented in a semiconductor technology called dynamic
random-access memory (DRAM).
Ideally, we want the programs and data to reside in main memory
permanently. This arrangement usually is not possible for the
following two reasons:
1. Main memory is usually too small to store all needed programs
and data permanently.
2. Main memory is a volatile storage device that loses its contents
when power is turned off or otherwise lost.
Thus, most computer systems provide secondary storage as an
extension of main memory. The main requirement for secondary
storage is that it be able to hold large quantities of data permanently.
The most common secondary-storage device is a magnetic disk,
which provides storage for both programs and data. Most programs
(system and application) are stored on a disk until they are loaded
into memory.
Caching:
 Important principle, performed at many levels in a computer (in hardware, operating system, software)
 Information in use copied from slower to faster storage temporarily
 Faster storage (cache) checked first to determine if information is there
o If it is, information used directly from the cache (fast)
o If not, data copied to cache and used there
 Cache smaller than storage being cached
o Cache management important design problem
o Cache size and replacement policy
c) I/O Structure
General-purpose computer system consists of CPUs and multiple device controllers that are connected
through a common bus.
 Each device controller is in charge of a specific type of device. Depending on the controller, more
than one device may be attached. For instance, seven or more devices can be attached to the
small Computer-systems interface (SCSI) controller.
 A device controller maintains some local buffer storage and a set of special-purpose registers.
 The device controller is responsible for moving the data between the peripheral devices that it
controls and its local buffer storage.
 Typically, operating systems have a device driver for each device controller. This device driver
understands the device controller and provides the rest of the operating system with a uniform
interface to the device.
To start an I/O operation, the device driver loads the appropriate registers within the device controller. The
device controller, in turn, examines the contents of these registers to determine what action to take (such as “read a
character from the keyboard”). The controller starts the transfer of data from the device to its local buffer. Once the
transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its
operation. The device driver then returns control to the operating system, possibly returning the data or a pointer to
the data if the operation was a read. For other operations, the device driver returns status information

Direct Memory Access:


Interrupt-driven I/O is fine for moving small amounts of data but can produce high overhead when used for
bulk data movement such as disk I/O. To solve this problem, direct memory access (DMA) is used. After setting up
buffers, pointers, and counters for the I/O device, the device controller transfers an entire block of data directly to or
from its own buffer storage to memory, with no intervention by the CPU. Only one interrupt is generated per block, to
tell the device driver that the operation has completed, rather than the one interrupt per byte generated for low-speed
devices. While the device controller is performing these operations, the CPU is available to accomplish other work.
Some high-end systems use switch rather than bus architecture. On these systems, multiple components
can talk to other components concurrently, rather than competing for cycles on a shared bus. In this case, DMA is
even more effective. The following diagram interplays all components of a computer system.

-------------------------------------------------------------------------------------------------------------------------------------------------------
6. Operating System structure
 Multiprogramming (Batch system) needed for efficiency
o Single user cannot keep CPU and I/O devices busy at all times
o Multiprogramming organizes jobs (code and data) so CPU always has one to execute
o A subset of total jobs in system is kept in memory
o One job selected and run via job scheduling
o When it has to wait (for I/O for example), OS switches to another job
 Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users
can interact with each job while it is running, creating interactive computing
DOWNLOADED FROM STUCOR APP
UNIT – I OPERATING SYSTEMS OVERVIEW
Computer System Overview-Basic Elements, Instruction Execution, Interrupts, Memory
Hierarchy, Cache Memory, Direct Memory Access, Multiprocessor and Multicore
Organization. Operating system overview-objectives and functions, Evolution of Operating
System.- Computer System Organization-Operating System Structure and Operations-
System Calls, System Programs, OS Generation and System Boot.

1. COMPUTER SYSTEM OVERVIEW:


What is an Operating System?
 An operating system is a program that manages the computer hardware.
 It also provides a basis for application programs and acts as an intermediary between

P
a user of a computer and the computer hardware.
 The purpose of an operating system is to provide an environment in which a user can

AP
execute programs.

Goals of an Operating System


 The primary goal of an operating system is thus to make the computer system
convenient to use.
R
 The secondary goal is to use the computer hardware in an efficient manner.
1.1 BASIC ELEMENTS OF A COMPUTER SYSTEM
CO

 An operating system is an important part of almost every computer system.


A computer system can be divided roughly into four components.
 Hardware
U

 Operating system
 The application programs
 Users
ST

 The hardware - the central processing unit (CPU), the memory, and the
Input/output (I/O) devices-provides the basic computing resources.
 The application programs- such as word processors, spreadsheets, compilers,
and web browsers- define the ways in which these resources are used to
solve the computing problems of the users.
 An operating system is similar to a government. The OS simply provides an
environment within which other programs can do useful work.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
Abstract view of the components of a computer system.
Operating system can be viewed as a resource allocator.
 The OS acts as the manager of the resources ( such as CPU time, memory space, file

P
AP
storage space, I/O devices) and allocates them to specific programs and users as
necessary for tasks.
 An operating system is a control program. It controls the execution of user programs
to prevent errors and improper use of computer.

1.1.1 Mainframe Systems


R
 Early computers were physically enormous machines run from a console.
CO
 The common input devices were card readers and tape drives.
 The common output devices were line printers, tape drives, and card punches.
 The user did not interact directly with the computer systems.
 Rather, the user prepared a job - which consisted of the program, the data, and some
U

control information about the nature of the job (control cards)-and submitted it to the
computer operator.
ST

 The job was usually in the form of punch cards.


 The operating system in these early computers was fairly simple.
 Its major task was to transfer control automatically from one job to the next.
 The operating system was always resident in memory

Memory layout for a simple batch system.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP

 A batch operating system, thus normally reads a stream of separate jobs.


 When the job is complete its output is usually printed on a line printer.

P
 The definitive feature of batch system is the lack of interaction between the user and
the job while the job is executing.

AP
 Spooling is also used for processing data at remote sites.
1.1.2 Multiprogrammed Systems
 A pool of jobs on disk allows the OS to select which job to run next, to
increase CPU utilization.
R
 Multiprogramming increases CPU utilization by organizing jobs such that the CPU
always has one to execute.
CO

 The idea is as follows: The operating system keeps several jobs in memory
simultaneously. This set of jobs is a subset of the jobs kept in the job pool. The
operating system picks and begins to execute one of the jobs in the memory.

Memory layout for a multiprogramming system.


U
ST

1.1.3 Time-Sharing Systems


 Time sharing (or multitasking) is a
logical extension of multiprogramming.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 The CPU executes multiple jobs by switching among them, but the switches occur so
frequently that the users can interact with each program while it is running.
 A time-shared operating system allows many users to share the computer
simultaneously. Since each action or command in a time-shared system tends to
be short, only a little CPU time is needed for each user.
 As the system switches rapidly from one user to the next, each user is given the
impression that the entire computer system is dedicated to her use, even though
it is being shared among many users.
1.1.4 Desktop Systems
 As hardware costs have decreased, it has once again become feasible to have a
computer system dedicated to a single user. These types of computer systems are
usually referred to as personal computers(PCS).

P
 They are microcomputers that are smaller and less expensive than mainframe
computers.

AP
 Operating systems for these computers have benefited from the development of
operating systems for mainframes in several ways.

1.1.5 Multiprocessor Systems


 Multiprocessor systems (also known as parallel systems or tightly coupled
R
systems) have more than one processor in close communication, sharing the
computer bus, the clock, and sometimes memory and peripheral devices.
CO
 Multiprocessor systems have three main advantages.
 Increased throughput.
 Economy of scale.
 Increased reliablility.
U

 If functions can be distributed properly among several processors, then the failure of
one processor will not halt the system, only slow it down. If we have ten processors
ST

and one fails, then each of the remaining nine processors must pick up a share of the
work of the failed processor.
 Thus, the entire system runs only 10 percent slower, rather than failing altogether.
This ability to continue providing service proportional to the level of surviving
hardware is called graceful degradation. Systems designed for graceful degradation
are also called fault tolerant.
 Continued operation in the presence of failures requires a mechanism to allow
the failure to be detected, diagnosed, and, if possible, corrected.
 The most common multiple-processor systems now use symmetric
multiprocessing (SMP), in whch each processor runs an identical copy of the
operating system, and these copies communicate with one another as needed.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 Some systems use asymmetric multiprocessing, in which each processor is assigned a
specific task. A master processor controls the system; the other processors either look
to the master for instruction or have predefined tasks.
 This scheme defines a master-slave relationship. The master processor schedules
and allocates work to the slave processors.

1.1.6 Distributed Systems


 In contrast to the tightly coupled systems, the processors do not share memory
or a clock. Instead , each processor has its own local memory.
 The processors communicate with one another through various communication
lines, such as high speed buses or telephone lines. These systems are usually
referred to as loosely coupled systems, or distributed systems.

P
Advantages of distributed systems
 Resource Sharing

AP
 Computation speedup
 Reliability
 Communication

1.1.7 Real-Time Systems


R
 Systems that control scientific experiments, medical imaging systems, industrial
control systems, and certain display systems are real-time systems.
CO

 Some automobile-engine fuel-injection systems, home-appliance controllers, and


weapon systems are also real-time systems. A real-time system has well-defined, fixed
time constraints.
 Real-time systems come in two flavors: hard and soft.
U

 A hard real-time system guarantees that critical tasks be completed on time.


 This goal requires that all delays in the system be bounded, from the retrieval
ST

of stored data to the time that it takes the operating system to finish any request made
of it.

1.2 OPERATING SYSTEM COMPONENTS


There are eight major operating system components. They are:

 Process management
 Main-memory management
 File management

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 I/O-system management
 Secondary-storage management
 Networking
 Protection system
 Command-interpreter system
(i) Process Management
 A process can be thought of as a program in execution. A batch job is a process. A
time shared user program is a process.
 A process needs certain resources-including CPU time, memory, files, and I/O
devices-to accomplish its task.

P
 A program by itself is not a process; a program is a passive entity, such as the
contents of a file stored on disk, whereas a process is an active entity, with a program

AP
counter specifying the next instruction to execute.
 A process is the unit of work in a system.
 The operating system is responsible for the following activities in connection
with process management:
R
 Creating and deleting both user and system processes
 Suspending and resuming processes
CO

 Providing mechanisms for process synchronization


 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling
U

(ii) Main – Memory Management


 Main memory is a large array of words or bytes, ranging in size from
ST

hundreds of thousands to billions. Each word or byte has its own address.
 Main memory is a repository of quickly accessible data shared by the CPU and I/O
devices.
 To improve both the utilization of the CPU and the speed of the computer's response
to its users, we must keep several programs in memory.
 The operating system is responsible for the following activities in connection
with memory management:
 Keeping track of which parts of memory are currently being used and by whom.

(iii) File Management

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
 File management is one of the most visible components of an operating
system.
 The operating system is responsible for the following activities in connection
with file management:
 Creating and deleting files
 Creating and deleting directories
 Supporting primitives for manipulating files and directories
 Mapping files onto secondary storage
 Backing up files on stable (nonvolatile) storage media
(iv) I/O System management

P
 One of the purposes of an operating system is to hide the peculiarities of
specific hardware devices from the user. This is done using the I/O subsystem.

AP
 The I/O subsystem consists of a memory-management component that includes
buffering, caching, and spooling.
 A general device-driver interface
 Drivers for specific hardware devices
R
(v) Secondary storage management
CO
 Because main memory is too small to accommodate all data and programs, and
because the data that it holds are lost when power is lost, the computer system must
provide secondary storage to back up main memory.
 The operating system is responsible for the following activities in connection
with disk management:
U

 Free-space management
 Storage allocation
ST

 Disk Scheduling

(vi) Networking
 A distributed system is a collection of processors that do not share memory,
peripheral devices, or a clock.
 Instead, each processor has its own local memory and clock, and the
processors communicate with one another through various communication lines,
such as high-speed buses or networks.
 The processors in the system are connected through a communication network,
which can be configured in a number of different ways.

DOWNLOADED FROM STUCOR APP


DOWNLOADED FROM STUCOR APP
(vii) Protection System
 Various processes must be protected from one another's activities. For that purpose,
mechanisms ensure that the files, memory segments, CPU, and other resources
can be operated on by only those processes that have gained proper authorization
from the operating system.
 Protection is any mechanism for controlling the access of programs, processes, or
users to the resources defined by a computer system.
 Protection can improve reliability by detecting latent errors at the interfaces between
component subsystems.
(viii) Command-Interpreter System
 One of the most important systems programs for an operating system is the command

P
interpreter.
 It is the interface between the user and the operating system.

AP
 Some operating systems include the command interpreter in the kernel. Other
operating systems, such as MS-DOS and UNIX, treat the command interpreter as a
special program that is running when a job is initiated, or when a user first logs on
(on time-sharing systems).
 Many commands are given to the operating system by control statements.
R
 When a new job is started in a batch system, or when a user logs on to a time-
shared system, a program that reads and interprets control statements is executed
CO
automatically.
 This program is sometimes called the control-card interpreter or the command-
line interpreter, and is often known as the shell.
U

1.3 BASIC ELEMENTS


ST

1.3.1 Main Memory

 referred to as real memory or primary memory

 volatile
1.3.2 I/O modules

 secondary memory devices

 communications equipment

 terminals
1.3.3 System bus

DOWNLOADED FROM STUCOR APP

You might also like