Lect3_OperatingSystem-2
Lect3_OperatingSystem-2
3-1
Some basic functions of an operation system
3-3
Some Operating Systems functions
• Interface manager
• Human interaction made easy
• Interfacing, abstraction, control and sharing
• Graphical User Interface
• GUI: recognize and point/click
• Command Line Interface
• CLI: remember and type (Mac Terminal, Command Prompt)
• Resource manager
• Efficient use of resources: Memory management
and processor scheduling
• System and data security and protection provider
3-4
3.1 History of Operating Systems
3-5
Figure 3.1 Batch processing
programmer
operator
3-8
Uniprogramming: One CPU, one program, Program runs until
completion.
Multiprogramming: One CPU, many programs. Programs run
without interruption until an I/O request or termination.
Supporting interactive processing by computers running for
several users at the same time, perhaps in 'real-time' applications,
required a change in operating systems.
One solution: Design the OS so that it rotates various jobs in
and out of execution.
Time-sharing: One CPU, many programs. Each program can run
a short amount of time before being interrupted by the system.
3-9
•When computer usage evolved from batch mode to
interactive mode, multiprogramming was no longer a
suitable approach.
•Each user wanted to see his/her program running as if
it was the only program in the computer (parallel
processing).
3-10
Time-sharing
- creates the illusion of several jobs being executed
simultaneously
- originally used for multiple users, each running one
job (to avoid, e.g., one user’s job hogging the CPU)
- now used to allow one user to execute multiple
processes at the same time: multitasking
• Application software
– Perform specific tasks for users
– Spreadsheets, games, etc.
• System software
– Perform tasks common to computer systems in general
– Operating system
– Utility software
• extend the capabilities of the OS
– format disks, copy from disk to CD, compress/decompress data,
handling network communications, etc
3-12
Figure 3.3 A machine’s software
classification
3-13
Utility software: The majority of an installation’s utility
software consists of programs for performing activities
that are fundamental to computer installations but not
included in the operating system. In a sense, utility
software consists of software units that extend the
capabilities of the operating system. The ability to format
a disk or to copy a file from a magnetic disk to a flash
drive is often not implemented within OS.
3-14
Components of an OS
• Shell: portion that communicates with users
– Graphical user interface (GUI)
• Window manager
• Kernel: contains components performing basic
required functions
– File manager
– Device drivers
– Memory manager
– Scheduler and dispatcher
3-15
The shell and the kernel are two important components that
work together to enable the user to interact with the system.
3-17
File Manager
• Coordinates the use of the mass storage facilities:
maintain records (on the storage media) of
– all files stored, including their location
– which users are allowed access to which files
– where free storage space is available
• Directory or folder: user-created group or bundle of
files
• Path: position of a file in directory hierarchy
• File descriptor: information (in main memory) needed
to access a file
3-18
Device Drivers
• Software units that communicate with the
controllers (or sometimes directly with peripheral
devices.)
• Controller: intermediary device that handles
communication between the computer and a
device.
• Drivers
– are uniquely designed for particular types of devices.
– translates generic requests into more technical steps
• Thus, other software do not deal with details.
3-19
Controllers attached to a
machine’s bus
3-20
Memory manager
• Coordinates the use of main memory
• In multi-tasking / multi-user environments
many programs and blocks of data must reside
in main memory concurrently. Hence memory
manager must:
– find and assign memory space for these needs
– ensure the actions of each program are restricted to
its allotted space
– keep track of memory areas no longer occupied
3-21
Memory manager
• When total memory required is greater than
available memory, memory manager moves
programs to and from between main memory
and mass storage (paging)
• The fictional memory space created by paging
is called virtual memory.
• 2 other components of kernel (scheduler and
dispacther).
– Studied in the next section ...
3-22
Getting it Started
• Do we know how the operating system gets started?
3-24
3.3 Coordinating Machine’s Activities
• The words Program and Process are sometimes
used instead of each other, but there is actually
a distinction between the two.
– Program: a static set of directions, whereas
– Process: the dynamic activity of executing a
program (whose properties change with time).
• Process state: current status of the activity (or,
snapshot of machine at a particular time)
– Position in the program being executed (Program
Counter), values in processor registers, etc.
3-25
Process Administration
• Scheduler
– Maintains a record of all processes, introduces new
ones, and removes those that are complete.
– Keeps the process table in main memory. An entry
in the process table has information about a
particular process, such as:
• Memory area assigned to it,
• Priority of the process,
• Whether it is Ready or Waiting, etc.
3-26
Process Administration (continued)
• Dispatcher
– Ensures scheduled processes are actually executed.
– Gives one time slice or quantum to a process that is
ready
– Executes a process switch (or context switch) when
the running process’s time slice is over.
• Interrupt indicates that time slice is over
• Interrupt handler: part of dispatcher
3-27
Figure 3.6 Time-sharing between
process A and process B
3-29
Figure 3.7 A deadlock resulting from
competition for non-shareable railroad
intersections
3-30
•Deadlock problem can be removed by removing any
one of these three conditions.
•Techniques attacking 3rd condition fall into deadlock
detection and correction category.
•Techniques attacking first 2 conditions are known as
deadlock avoidance schemes.
•Convert a non-shareable resource into a shareable one, or
makes it appear shareable (e.g. Spooling)
•Each process can request all its resources at once
3-31
3.5 Security
3-33