Lec 01
Lec 01
Lecture 1
Computer System
Computer system can be divided into four components:
■ Hardware
– Provides basic computing resources
– CPU, memory, I/O devices
■ Operating system
– Controls and coordinates use of hardware among various applications and users
■ Application programs
– Define the ways in which the system resources are used to solve the computing problems
– Word processors, compilers, web browsers, database systems etc.
■ Users
– People, machines and other computers
Computer System
Batch Systems
■ In Batch processing same type of jobs are batch (BATCH- a set of jobs with similar
needs) together and execute at a time
■ Users did not interact directly with the computer systems, but he prepared a job
(comprising of the program, the data, & some control information)
■ The job was submitted to the computer operator by the programmer. At some later
time the output appeared
Memory Layout
■ Resident monitor :
– initial control in monitor
– control transfers to job
– when job completes control transfers back to monitor
Operating
System
User
program
area
Multi-Programmed Systems
■ Several jobs are kept in main memory at the Operating
same time, and the CPU is multiplexed among system
them
job1
■ Figure depicts the layout of multiprogramming
system job2
■ The main memory consists of 4 jobs at a time, the
CPU executes one by one job3
job4
Multi-Programmed Systems
■ Example: Two process P1 and P2 with CPU and I/O bursts of one time unit each
CPU I/O
Burst Burst
P1
P2
P1
…
P2
Multi-Programmed Systems
■ Advantages:
– Efficient memory utilization
– Throughput increases
– CPU is never idle, so performance increases.
Time Sharing 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 simultaneously shared
among multiple users is termed as
time-sharing
■ The operating system uses CPU scheduling and
multiprogramming to provide each user with a small
portion of a time.
Time Sharing Systems
■ Advantages:
– Provides the advantage of quick response
– Reduces CPU idle time
■ Disadvantages:
– Problem of reliability
– Question of security and integrity of user programs and data
Distributed Systems
■ Distribute the computation among several physical processors.
■ Loosely coupled system – each processor has its own local memory; processors
communicate with one another through various communications lines, such as high
speed buses or telephone lines.
■ Processors in a distributed system may vary in size and function.
■ These processors are referred as sites, nodes, computers, and so on.
Advantages of Distributed Systems
■ Resource Sharing
– With resource sharing facility, a user at one site may be able to use the
resources available at another
■ Computational speedup
– Reduction of the load on the host computer
■ Reliability
– If one site fails in a distributed system, the remaining sites can potentially
continue operating.
■ Scalability
– Adds more computers
Clustered Systems
■ Use multiple CPUs to accomplished a task
■ Clustering allows two or more systems to share storage
■ Provides high reliability
– Asymmetric clustering: one server runs the application while other servers
standby
– Symmetric clustering: all N hosts are running the application
Real-time Systems
■ A system that produce output far a given input within a well-defined time period, else
the output is useless.
■ Often used as a control device in dedicated application such as medical imaging
systems, industrial control system, plane landing system, process control in nuclear
power plant, etc.
Real-time Systems
■ Real-time systems may be either hard or soft real-time
■ The hard real-time OS guarantee that critical tasks be completed within a certain
range of time
– Ex: aircraft control systems.
■ The soft real-time OS provides some relaxation in time limit
Single-Processor System
■ Single-processor systems
– One CPU or one processing unit(a single core on a chip)
– They perform only one process at a given time, and it carries out the next
process in the queue only after the current process is completed
Multiprocessor System
■ Multiprocessor systems
– Multiple processor or one processor with multiple core
– Process more than one program simultaneously
– Multiprocessor systems are also known as parallel or tightly- coupled system
Multiprocessor System
■ Asymmetric Multiprocessing; Tasks are assigned to a specific CPU and each CPU
has its own RAM memory
■ Symmetric Multiprocessing; Tasks are assigned to any available CPU and CPU’s can
share RAM memory
■ Advantages include:
– Increased throughput
– Economy of scale
– Increased reliability
What is an Operating System?
■ A program that acts as an intermediary between a user of a computer and the
computer hardware
■ An operating system (OS) is the program that, after being initially loaded into the
computer (main memory) by a boot program, manages all the other programs in a
computer. The other programs are called applications or application programs.
Operating System Objectives
■ Convenience
– Execute user programs and make solving user problems easier
– Make the computer system convenient to use
■ Efficiency
– Use the computer hardware in an efficient manner
■ Ability to evolve
Role of Operating System
■ Government
– Provides an environment for efficient use of its resources
■ Resource allocator
– Manages all resources
– Decides between conflicting requests for efficient and fair use of the resource
■ Control program
– Controls execution of programs to prevent errors and improper use of the
computer
Interrupts and Traps
■ Interrupt
– is a signal to the processor emitted by I/O devices indicating an event that
needs immediate attention from the operating system
– Interrupts are hardware generated
■ Trap
– an event generated by CPU to get attention of the operating system.
– Caused by an error or by a user request for an I/O operation
– It is also called software-generated interrupts
Interrupts and Traps
■ In case of an interrupt or trap, CPU invokes a piece of code in the OS to service it,
known as interrupt service routine (ISR) or trap service routine (TSR)
■ When the CPU is interrupted/trap, it stops what it is doing and immediately transfers
execution to an address where the service routine for the interrupt/trap is located
■ In case of interrupt the OS preserves the state of the CPU but not in case of trap
Interrupts and Traps
Operating System Modes
■ The operating system code and user-defined code must be distinguished to ensure
the proper execution of the operating system.
■ Computer system provides hardware support to differentiate between at least two
modes of operations.
– User mode: execution done on behalf of a user.
– kernel mode: (also called monitor mode or system mode) execution done on
behalf of operating system.
■ Dual-mode operation allows OS to protect itself and other system components.
■ When an interrupt or fault occurs, or a process execute a system call, CPU switches
to monitor mode.
Dual-Mode Operation
■ Mode bit added to computer hardware to indicate the current mode: monitor (0) or
user (1).