chapter 1 introduction
Download
Skip this Video
Download Presentation
Chapter 1: Introduction

Loading in 2 Seconds...

play fullscreen
1 / 38

Chapter 1: Introduction - PowerPoint PPT Presentation


  • 69 Views
  • Uploaded on

Chapter 1: Introduction. Chapter 1: Introduction. What Operating Systems Do Computer-System Organization Computer-System Architecture Operating-System Structure Operating-System Operations Process Management Memory Management Storage Management Protection and Security

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 1: Introduction' - edena


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 1 introduction1
Chapter 1: Introduction

What Operating Systems Do

Computer-System Organization

Computer-System Architecture

Operating-System Structure

Operating-System Operations

Process Management

Memory Management

Storage Management

Protection and Security

Kernel Data Structures

Computing Environments

Open-Source Operating Systems

objectives
Objectives

To describe the basic organization of computer systems

To provide a grand tour of the major components of operating systems

To give an overview of the many types of computing environments

To explore several open-source operating systems

what is an operating system
What is an Operating System?

A program that acts as an intermediary between a user of a computer and the computer hardware

Operating system goals:

Execute user programs and make solving user problems easier

Make the computer system convenient to use

Use the computer hardware in an efficient manner

computer system structure
Computer System Structure

Computer system can be divided into four components:

Hardware – provides basic computing resources

CPU, memory, I/O devices

Machine language: small set of instructions to move data around, do arithmetic, compare values, etc. visible to an assembly language programmer.

Operating system/Kernel

Controls and coordinates use of hardware among various applications and users

Protected from user modification by hardware (kernel mode)

Application programs – define the ways in which the system resources are used to solve the computing problems of the users

Word processors, compilers, web browsers, database systems, video games

User mode

Users

People, machines, other computers

what operating systems do
What Operating Systems Do

Depends on point of view

Single users want convenience, easeofuse and good performance

Don’t care about resourceutilization

But shared computer such as mainframe or minicomputer must keep all users happy

Users of dedicate systems such as workstations have dedicated resources but frequently use shared resources from servers (e.g. file, print servers)

Handheld computers are resource poor, optimized for usability and battery life.

Some computers have little or no user interface, such as embedded computers in devices and automobiles. Their Oss designed to run without user intervention.

two views of an operating system
Two views of an Operating System

OS is a resource allocator

Manages all resources

Orderly and controlled allocation of disk space, memory, CPU time, I/O devices, access to network

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

Present the user with an extended machine: Hides the complexity of the hardware, provides a simpler interface

computer startup
Computer Startup

bootstrap programis loaded at power-up or reboot

Typically stored in ROM or EPROM, generally known as firmware

Initializes all aspects of system

CPU registers, device drivers, memory, etc.

Loads operating system kernel and starts execution

Wait for an event to happen

Event: an interrupt from either hardware or software

computer system organization
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

slide11
CPU
  • Fetch-decode-execute cycle
      • Fetch an instruction from the memory
      • Decode the instruction (determine its type and operands)
      • Fetch operand from memory (if necessary)
      • Execute
  • Pipelined
  • Superscalar CPU
  • Multicore chips: CPU chips with multiple processors (cores) on them
registers
Registers
  • Inside the CPU
  • General (Data) Registers: hold temporary results
    • LOAD from memory to register
    • STORE from register to memory
    • ADD two operands (memory/register)
  • Program Counter (PC)
    • holds the memory address of the next instruction to be fetched
    • incremented after each instruction
  • Stack Pointer (SP): top of the current stack in memory
  • PSW (Flags register)
    • Keeps control bits, flags set by instructions
    • Such as result of last comparison or mode: kernel or user
storage hierarchy
Storage Hierarchy

Storage systems organized in hierarchy

Speed/Access time

Cost/Capacity

Volatility

storage definitions and notation review
Storage Definitions and Notation Review

The basic unit of computer storage is the bit. A bit can contain one of two values, 0 and 1. All other storage in a computer is based on collections of bits. Given enough bits, it is amazing how many things a computer can represent: numbers, letters, images, movies, sounds, documents, and programs, to name a few. A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage. For example, most computers don’t have an instruction to move a bit but do have one to move a byte. A less common term is word, which is a given computer architecture’s native unit of data. A word is made up of one or more bytes. For example, a computer that has 64-bit registers and 64-bit memory addressing typically has 64-bit (8-byte) words. A computer executes many operations in its native word size rather than a byte at a time.

Computer storage, along with most computer throughput, is generally measured and manipulated in bytes and collections of bytes.

A kilobyte, or KB, is 1,024 bytes

a megabyte, or MB, is 1,0242 bytes

a gigabyte, or GB, is 1,0243 bytes

a terabyte, or TB, is 1,0244 bytes

a petabyte, or PB, is 1,0245 bytes

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).

caching
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

registers and cache
Registers and Cache
  • Registers: in CPU, fastest, volatile
  • Cache (possible multiple levels):
    • keeps most accessed memory words
    • Close to or on CPU
    • volatile
main memory
Main Memory
  • Main memory – only large storage media that the CPU can access directly
    • Randomaccess (also called RAM)
    • Typically volatile
secondary storage
Secondary Storage
  • Hard Disk: extension of main memory that provides large nonvolatilestorage capacity
    • One or more metal or glass platters covered with magnetic recording material, rotating
    • A mechanical arm, attached to it heads to read/write per surface
    • Data is written in concentric circles—tracks
    • Cylinder: set of tracks at the same position of every platter
    • Each track is divided into sectors (smallest unit that can be read/written, typically 512 bytes per sector)
    • Seek time: moving arm to desired track
    • Rotational delay: time for the desired sector to rotate under head
secondary storage1
Secondary Storage
  • Solid-state disks:
    • faster than hard disks, nonvolatile
    • Various technologies
    • Becoming more popular
  • Magnetic Tape:
    • back up for disk storage, nonvolatile
    • Needs to be forwarded to get to the requested block, takes minutes
    • Cheap and removable
special memory devices
Special memory Devices
  • ROM: Read Only Memory
    • Small, nonvolatile, comes with computer
    • Low level software, bootstrap loader
  • EEPROM and flash RAM: erasable and rewritable, used similar to ROM
  • CMOS: volatile, but has its own battery
    • Keeps time and date, some config parameters uch as which disk to boot from.
i o devices
I/O Devices
  • I/O Device has two parts
    • Controller
    • The device itself
  • Controller
    • Accepts commands from OS to control the device.
    • Provides a simpler interface to OS
    • E.g. controller accepts a read command 11,206 from disk 2, and converts this linear sector number to cylinder, sector, and head
i o devices1
I/O Devices
  • Device Driver:
    • The software that talks to the controller, giving commands, accepting responses
    • Controller manufacturers supply it with the controller
    • Driver has to be put into kernel
      • Relink with kernel and reboot (older UNIX systems)
      • Make an entry that tells OS it needs a driver and reboot
        • At boot time OS finds and loads the driver (Windows)
      • Getting more and more common: dynamic loading
        • While running OS can install drivers without reboot
        • E.g. USB
i o structure
I/O Structure

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

i o structure1
I/O Structure

Three different ways of I/O

(1) Busy Waiting:

user program issues a system call

Kernel translates into a procedure call to the appropriate driver

The driver starts the I/O and

Loops to continuously poll the device if it is done

When I/O is complete driver puts the data where needed and returns to OS

OS returns the control to caller

DISADVANTAGE: wait loop ties the CPU until I/O is finished

At most one I/O request is outstanding at a time, no simultaneous I/O processing

(2) Interrupt Driven I/O

Driver starts I/O and asks the device to give an interrupt when it is finished

Driver returns to OS

OS blocks the program waiting for I/O, and looks for other work

When controller detects end of transfer it generates an interrupt

common functions of interrupts
Common Functions of Interrupts

When the CPU is interrupted, stops what it is doing

transfers control to the interrupt service routine (part of the driver for the interrupting device

The interrupt service routine executes

On completion, CPU resumes execution

Interrupt architecture must save the address of the interrupted instruction

interrupt handling
Interrupt Handling

The operating system preserves the state of the CPU by storing the registers and the program counter

Determines which interrupt service routine has to run:

Has to do this quickly

A table of pointers to interrupt service routines for each possible interrupt (called interrupt routine table or interrupt vector)

Stored in low memory (first hundred and so locations)

Indexed by unique device number of the interrupting device

After the interrupt is serviced, the saved return address is loaded to the PC and execution resumes

Interrupt service routines: Separate segments of code determine what action should be taken for each type of interrupt

i o structure2
I/O Structure

(3) DMA (Direct Memory Access):

Interrupt-driven I/O is fine for small data transfers, but has high overhead for large amounts of data transfer

DMA: Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention

Done by a DMA chip

CPU sets up the DMA chip telling how many bytes to transfer, the device and memory addresses involved and lets it go

Only one interrupt is generated by DMA per block, rather than the one interrupt per byte

how a modern computer works
How a Modern Computer Works

A von Neumann architecture

computer system architecture
Computer-System Architecture

Most systems use a single general-purpose processor

Most systems have special-purpose processors as well

Multiprocessorssystems growing in use and importance

Also known as parallel systems, tightly-coupled systems

Advantages include:

Increased throughput (more work in less time)

Economy of scale (cheaper than multiple single processor systems, sharing resources)

Increased reliability – fault tolerance: suffer failure of a single component but still continue operation

computer system architecture1
Computer-System Architecture

Two types of Multiprocessor Systems:

Asymmetric Multiprocessing – each processor is assigned a specific task. Boss/worker relationship.

Symmetric Multiprocessing (SMP)– each processor performs all tasks

Peer relationship.

a dual core design
A Dual-Core Design
  • Multicore design
    • Multiple processors on a single chip
    • Faster communication between CPUs
    • Less power than multiple chips
clustered systems
Clustered Systems

Like multiprocessor systems, but multiple systems working together

Usually sharing storage via a storage-area network (SAN)

Provides a high-availabilityservice which survives failures

Some clusters are for high-performance computing (HPC)

Applications must be written to use parallelization

Some have distributed lock manager (DLM) to avoid conflicting operations

E.g. multiple machines having full access to the data in the shared database

operating system structure
Operating System Structure

Multiprogramming (Batch system) needed for efficiency

Single user cannot keep CPU and I/O devices busy at all times

Multiprogramming organizes jobs (code and data) so CPU always has one to execute

A subset of total jobs in system is kept in memory

One job selected and run via job scheduling

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

Switching from one job to another: context switch

Response timeshould be short

Each user has at least one program executing in memory process

If several jobs ready to run at the same time  CPU scheduling

If processes don’t fit in memory, swapping moves them in and out to run

ad