Oslecture 1
Oslecture 1
1
Cont..
• Operating – System Structures
- System Components
- Operating System Services
- System Calls
- System Programs
What is an Operating System?
• An OS is a program that manages the computer
hardware and also provide a basis for
application programs and acts as an
intermediary between a user of a computer and
the computer hardware.
• Major cost of general purpose computing is
software.
– OS simplifies and manages the complexity
of running application programs efficiently.
3
Goals of an Operating System
• Simplify the execution of user programs and
make solving user problems easier.
• Use computer hardware efficiently.
– Allow sharing of hardware and software
resources.
• Make application software portable and
versatile.
4
Contd..
• Provide isolation, security and protection
among user programs.
5
Why should I study Operating
Systems?
– Need to understand interaction between the
hardware and applications
7
8
Computer System Components
• Hardware
– Provides basic computing resources (CPU, memory, I/O
devices).
• Operating System
– Controls and coordinates the use of hardware among
application programs.
• Application Programs
– Solve computing problems of users (compilers, database
systems, video games, business programs such as banking
software).
• Users
– People, machines, other computers
9
Abstract View of System
User
1 User User User
2 3 ... n
Operating System
Computer
Hardware
10
Operating System Views
• Resource allocator
• to allocate resources (software and hardware) of
the computer system and manage them efficiently.
• Control program
• Controls execution of user programs and operation
of I/O devices.
• Kernel
• The program that executes forever (everything else
is an application with respect to the kernel).
11
Early Systems - Bare Machine
(1950s)
• Structure
• Large machines run from console
• Single user system, Programmer/User as operator
• Paper tape or punched cards
• Early software
• Assemblers, compilers, linkers, loaders, device
drivers, libraries of common subroutines.
• Secure execution
• Inefficient use of expensive resources
• Low CPU utilization, high setup time. 12
Types of Operating System
14
Contd..
– The output from each job would be sent back
to the appropriate programmer.
- For eg. Five jobs coded in
C,Java,C,Pascal,Java appear in this
sequence. So the Operating System has to
first load C compiler for first program then
Java compiler for the second program and
then reload C compiler for the third program
and so on.
- Reduce the total execution time of the five
programs. 15
Memory Layout fo Batch
Operating System
Contd..
– Problem
1. Lack of interaction between the user and
the job.
2. CPU is often idle, because the speed of
the I/O devices is slower than the CPU.
3. Difficult to provide the desired priority.
Multi programmed Systems
- 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.
- At the end, the job may have to wait for
some task,such as an I/O operation to
complete.
18
Contd..
- In a multiproframming system,the O.S
simply switches to, and executes, another
job. When the job needs to wait, the CPU
is switched to another job and so on. At
the end the first job finishes waiting and
gets CPU back.
- CPU bound: When CPU has an
instruction for processing or computation
Cont…
- I/O bound: There is a request to an I/P or O/P
device to read or write. During the I/O bound
instructions, CPU is not doing work and is idle.
- Advantages:
1. Less execution time as compared to batch
system
2. Increased utilization of memory
3. Increased throughput.
Memory Layout for
Multiprogrammed Systems
Several jobs are kept in main memory at the same time, and the
CPU is multiplexed among them.
Time-sharing System
• It is a logical extension of multiprogramming .
• The CPU executes multiple jobs by switching among
them.
• The switches occur so frequently that the user can
interact with each program while it is running.
• It allows many user to share the computer
simultaneously.
• A time shared O.S. uses CPU scheduling and
Multiprogramming to provide each user with a small
portion of time shared computer.
22
Contd..
• Each user has at least one separate program in
memory.
• It is more complex than multiprogrammed O.S.
• It also provide a file system.
• It is used in CPU scheduling.
23
Real-time systems
• A real time system is used when rigid time
requirements have been placed on the
operation of a processor.
• It is used as a control device in a dedicated
application.
• Sensors bring data to the computer and analyze
the data and adjust controls to modify the
sensor inputs.
24
Contd..
• Batch System and time sharing systems are
desirable,which may have no time constraints at all.
• Real time system come into two flavors
• Hard real-time systems -
• Failure if response time too long.
• Secondary storage is limited
• Soft real-time systems -
• Less accurate if response time is too long.
• Useful in applications such as multimedia, virtual
reality.
25
Personal Computing Systems
• Single user systems, portable.
• I/O devices - keyboards, mouse, display screens,
small printers.
• Laptops , Smart cards, Wireless devices.
• Single user systems may not need advanced CPU
utilization or protection features.
• Advantages:
– user convenience, responsiveness, ubiquitous
26
Operating System Structures
• System Components
– Process Management
– Memory Management
– Secondary Storage Management
– I/O System Management
– File Management
– Protection System
– Networking
– Command-Interpreter System.
Process Management
• OS is responsible for
– File creation and deletion
– Directory creation and deletion
– Supporting primitives for file/directory manipulation.
– Mapping files to disks (secondary storage).
– Backup files on archival media (tapes).
I/O System Management
• I/O system in the OS consists of
– Buffer caching and management
– Device driver interface that abstracts device details
– Drivers for specific hardware devices
Protection and Security