Professional Documents
Culture Documents
OPERATING SYSTEMS
LESSON - 1
Computer Engineering
WEEK TOPICS
Week 8 : Vize
Week 15 : Final
Introduction
Sources:
- Modern Operating Systems, 3rd Edition by Andrew S.
Tanenbaum, Prentice Hall, 2008.
- Computer Operating Systems (BIS), Ali Saatçi, 2nd
Edition,
Knives Bookstore.
WHAT IS AN OPERATING A computer system is a structure consisting of hardware,
operating system, application programs and users.
SYSTEM?
The operating system (OS) is the system software that acts
as an intermediary between the user (?) and the computer
hardware.
System software that controls computer resources and
forms the base on which application programs can be
written and run.
It is basically a resource manager.
Basic Elements of a Computer a
System
- Processor (Main processing unit - CPU)
- Main Memory
- Also known as true memory or primary memory.
- It is a volatile memory as its information is lost when
the power is cut.
- I/O modules
- Secondary memory drives
- Communication units
- Terminals (end units)
- System BUS (Address bus, Data bus, Control bus)
- It provides communication between processes,
memory and I/O modules.
High Level Components of a Computer
System
A. Processor (CPU) :
Registers visible to the user:
• With these, the programmer minimizes a na memory usage by
organizing the register usage in the best way.
• It can be used by machine language (asembly).
• They can be used with all programs (application programs,
system programs).
Recorder types :
Data and address registrars
• Memory Address Registers (MAR): Holds the address of the data
that the CPU wants to read or write.
• Memory Data Register (MBR) : This register holds the contents of
the data or instruction in the address region of the MAR.
• I/O Address Register (I/O AR): This register is used to specify the
address of a particular I/O device.
• I/O Address Register (I/O AR): Used to exchange data between
an I/O module and the processor.
High Level Components of a Computer
System
A. Processor (CPU) registers:
Control and status recorders :
It is used by the processor through the operating system to run the
processor in a controlled manner to ensure that programs run
regularly. These are:
• Program Counter (Pogram Counter, PC): Contains the address
of a command to be executed.
• Instruction Register (IR) : Contains the instruction to be
executed.
• Program status word (PSW): Controls conditional operations,
interrupt handling and management/user mode. The PSW bits
are set by the processor hardware as a result of operations.
These bits can be accessed by a program but cannot be
changed. For example: positive, negative, zero and overflow
results.
• Accumulator Register (AC): This register is inside the ALU. It is
used in arithmetic or logical operations of the ALU. This register
holds the input data, intermediate and final results. Final results
are transferred to main memory via MBR.
High Level Components of a Computer
System
Command and execution strategy:
1.The processor receives the command to be executed from the
memory address indicated by the PC.
2.The PC then increments its content to hold the address of the next
command to be received.
Commands taken from memory are placed in the instruction register
(IR). Command types:
- Processor - Memory : They provide data transfer between the
processor and memory.
- Processor - I/O : Allows data transfer with a peripheral.
- Data Processing : Arithmetic and logic operations on data.
- Control : They change the execution order.
Interrupt Request (IRQ)
The operating system is a software system that aims to maximize In terms of the user;
the efficiency of the use of these resources while sharing the - It provides a presentation layer on top of the hardware.
hardware and software resources that make up the computer system - We have developed a complex hardware structure into a useful
in a way that allows an easy, fast and secure operating service and comprehensible structure.
between users. transforms it.
The basic functions of operating systems are. - Run user programs and solve users' problems
- Define "user interface", solve
- Ensure system startup, From a System Perspective;
- Sharing hardware between users, - The program closest to the hardware is the system resource
- Enabling users to share data, manager.
- To perform entry / exit operations, - Resources; CPU time, memory space, file system space, I/O...
- Correcting mistakes, - Time
- Providing a programming interface (API: Application program - Alan
interface). - The most efficient, fastest and fairest way to allocate resources,
processes and jobs
to divide it in such a way
- Protecting applications and processes
- Manage and control I/O devices.
History of Operating Systems:
the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
STRUCTURE OF OPERATING SYSTEMS
Operating System Architectures : Layered
The system consists of several levels. Each level performs relational
sub-functions. Each level depends on the next lower level to
execute more simple functions. This allows a problem to be
decomposed into many sub-problems.
STRUCTURE OF OPERATING
SYSTEMS
Structure of the MS-DOS System
MS-DOS was written to provide many functions in a small memory
space:
- It is not divided into modules;
- Interfaces and functional levels are not strictly separated.
STRUCTURE OF OPERATING
SYSTEMS
Windows 2000 (W2K)
Uses today's powerful 32/64 bit (i386, i586, x86_64)
microprocessors
- Enables multitasking in a single user environment
- It has Client/Server usage feature.
- Thanks to its modular structure, it provides flexibility.
- Works on different hardware platforms
- Supports applications written for other operating systems
- Changes in micro-kernel architecture:
- It is not a microkernel in the strict sense
- Most system functions other than the microkernel are in kernel
mode
can be operated.
- Any unit can be removed, updated or replaced.
STRUCTURE OF OPERATING SYSTEMS
• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
• Controls execution of programs to prevent
errors and improper use of the computer
Operating System Definition (Cont.)
• No universally accepted definition
• “Everything a vendor ships when you order
an operating system” is a good
approximation
• But varies wildly
• “The one program running at all times on the
computer” is the kernel.
• Everything else is either
• a system program (ships with the operating
system) , or
• an application program.
Computer Startup
• bootstrap program is loaded at power-
up or reboot
• Typically stored in ROM or EPROM,
generally known as firmware
• Initializes all aspects of system
• Loads operating system kernel and starts
execution
Computer System Organization
• Computer-system operation
• One or more CPUs, device controllers connect through
common bus providing access to shared memory
• Concurrent execution of CPUs and devices competing
for memory cycles
Computer-System Operation
• I/O devices and the CPU can execute
concurrently
• Each device controller is in charge of a
particular device type
• Each device controller has a local buffer
• CPU moves data from/to main memory
to/from local buffers
• I/O is from the device to local buffer of
controller
• Device controller informs CPU that it has
finished its operation by causing an interrupt
Common Functions of Interrupts
• Interrupt transfers control to the interrupt
service routine generally, through the
interrupt vector, which contains the
addresses of all the service routines
• Interrupt architecture must save the
address of the interrupted instruction
• A trap or exception is a software-
generated interrupt caused either by an
error or a user request
• An operating system is interrupt driven
Interrupt Handling
Computer manufacturers often round off these numbers and say that a
megabyte is 1 million bytes and a gigabyte is 1 billion bytes. Networking
measurements are an exception to this general rule; they are given in bits
(because networks move data a bit at a time).
Storage Structure
• Main memory – only large storage media that the CPU can access directly
• Random access
• Typically volatile
• Secondary storage – extension of main memory that provides large
nonvolatile storage capacity
• Hard disks – rigid metal or glass platters covered with magnetic recording
material
• Disk surface is logically divided into tracks, which are subdivided into
sectors
• The disk controller determines the logical interaction between the device
and the computer
• Solid-state disks – faster than hard disks, nonvolatile
• Various technologies
• Becoming more popular
Storage Hierarchy
• Storage systems organized in hierarchy
• Speed
• Cost
• Volatility
• Caching – copying information into faster
storage system; main memory can be
viewed as a cache for secondary storage
• Device Driver for each device controller
to manage I/O
• Provides uniform interface between controller
and kernel
Storage-Device Hierarchy
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
• If it is, information used directly from the cache (fast)
• If not, data copied to cache and used there
• Cache smaller than storage being cached
• Cache management important design problem
• Cache size and replacement policy
Direct Memory Access Structure
• Used for high-speed I/O devices able to
transmit information at close to memory
speeds
• Device controller transfers blocks of
data from buffer storage directly to main
memory without CPU intervention
• Only one interrupt is generated per
block, rather than the one interrupt per
byte
How a Modern Computer Works
• File-System management
• Files usually organized into directories
• Access control on most systems to determine who can access what
• OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
Mass-Storage Management
• Usually disks used to store data that does not fit in main memory or
data that must be kept for a “long” period of time
• Proper management is of central importance
• Entire speed of computer operation hinges on disk subsystem and its
algorithms
• OS activities
• Free-space management
• Storage allocation
• Disk scheduling
• Some storage need not be fast
• Tertiary storage includes optical storage, magnetic tape
• Still must be managed – by OS or applications
• Varies between WORM (write-once, read-many-times) and RW
(read-write)
Performance of Various Levels of Storage
• Distributed computiing
• Collection of separate, possibly heterogeneous,
systems networked together
• Network is a communications path, TCP/IP most common
• Local Area Network (LAN)
• Wide Area Network (WAN)
• Metropolitan Area Network (MAN)
• Personal Area Network (PAN)
• Network Operating System provides features
between systems across network
• Communication scheme allows systems to exchange
messages
• Illusion of a single system
Computing Environments – Client-Server
Client-Server Computing
Dumb terminals supplanted by smart PCs
Many systems now servers, responding to requests generated
by clients
Compute-server system provides an interface to client to
request services (i.e., database)
File-server system provides interface for clients to store and
retrieve files
Computing Environments - Peer-to-Peer