operating systems
Download
Skip this Video
Download Presentation
Operating Systems

Loading in 2 Seconds...

play fullscreen
1 / 28

Operating Systems - PowerPoint PPT Presentation


  • 215 Views
  • Uploaded on

Operating Systems. Concepts and Principles monolithic and micro kernels processes and threads their management and synchronisation interprocess communication interrupts and signals virtual memory - paging and segmentation Implementation Techniques resource allocation

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 'Operating Systems' - Samuel


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
operating systems
Operating Systems: IntroOperating Systems
  • Concepts and Principles
    • monolithic and micro kernels
    • processes and threads
      • their management and synchronisation
      • interprocess communication
    • interrupts and signals
    • virtual memory - paging and segmentation
  • Implementation Techniques
    • resource allocation
    • time management - process scheduling
    • memory management - usage models and page allocation
    • file systems
    • case studies - Kops, Linux, NT etc.
coursework
Operating Systems: IntroCoursework
  • To Be Announced
    • probably involving some programming
    • deadline - mid-term
  • Essay - in-depth comparison of PDA Operating Systems
    • structure, scheduling, memory management, security etc.
    • deadline - end of term

Tutorials only when needed

textbooks
Operating Systems: IntroTextbooks
  • William Stallings, Operating Systems, Internals & Design Principles, 4th edition, Prentice-Hall, 2001.
  • Abraham Silberschatz & Peter Galvin, Operating System Concepts, 5th edition, Addison-Wesley, 1998.
  • Gary Nutt, Operating Systems, A Modern Perspective, 2nd edition, Addison-Wesley, 2000.
  • D.A.Solomon & M.E.Russinovitch, Inside Windows 2000, 3rd edition, MicroSoft Press, 2000.
  • D.Boling, Programming MicroSoft Windows CE, MicroSoft Press, 1998.
  • Michael Beck et al., Linux Kernel Internals, 2nd edition, Addison-Wesley, 1997.
  • John O’Gorman, Operating Systems with Linux, Palgrave, 2001.
motivation
Operating Systems: IntroMotivation
  • An Automated Teller Machine (ATM) process
    • process to deposit an amount into an account:
      • deposit (account, amount) {
        • read ( account, balance ); // read balance from database
        • balance = balance + amount; // add deposit amount
        • write (account, balance ); // update database
      • }
    • process to withdraw an amount from an account:
      • withdraw ( account, amount ) {
        • read (account, balance); // read balance from database
        • balance = balance - amount; // subtract withdrawal amount
        • write ( account, balance); // update database
      • }
    • concurrent processes?
slide5
Operating Systems: Intro
  • To sum the elements of a matrix
    • in row order:

sum = 0;

for (row=0; row

for (col=0; col

sum = sum + array[row,col];

} }

cout << “Array Sum =“ << sum << endl;

    • in column order:

sum = 0;

for (col=0; col

for (row=0; row

sum = sum + array[row,col];

} }

cout << “Array Sum =“ << sum << endl;

    • any difference?
operating systems1
Operating Systems: IntroOperating Systems
  • Main purpose is to facilitate the execution of user application programs
    • bare hardware is extremely messy and difficult for users to program
      • processors
      • memory
      • peripheral devices
      • concurrency
      • interrupts
      • files
      • networks
slide7
Operating Systems: Intro
  • Modern operating systems structured around concept of a process

process = “program in execution”

    • a process is not the same as a program
    • programs are passive, processes are active
    • a process consists of an executable program, associated data and its execution context
  • A process runs in a framework which provides a Virtual Machine for it
    • a Virtual Machine is a simplified machine with:
      • user-level processor
      • virtual memory
      • high-level facilities
      • a machine with one user
slide8
Operating Systems: Intro
  • An OS supports execution of many concurrent processes
    • many co-existing virtual machines
    • each run alternately - pseudo-concurrently
    • OS issues revolve around process management
      • how and when to create & destroy processes
      • how to avoid interference between processes
      • how to achieve cooperation between processes
slide9
Operating Systems: Intro
  • An OS manages resource requirements of processes
    • time
    • memory
    • files
    • I/O device access
    • processors
  • An OS aims to be efficient
    • for user
    • for system manager
slide10
Operating Systems: Intro
  • A process can be in one of several states
    • newly created
    • running
    • blocked
      • waiting for some event to occur
      • in main memory
      • moved out to disc
    • ready to run
    • terminated
slide11
Operating Systems: Intro
  • Overheads in swapping execution between processes
    • saving and restoring contexts
    • loss of cache contents
  • Places limits on how often execution should be swapped
    • performance will plummet if too frequent
slide12
Operating Systems: Intro
  • A relatively new mechanism to improve overheads is the Thread
    • a lightweight process
    • several threads within one process or virtual machine
    • much smaller context to preserve
    • must cooperate
    • must not compete
    • can be separately scheduled
    • can run concurrently on multiprocessor systems
    • often also a very convenient programming paradigm
interfaces
Operating Systems: IntroInterfaces

user

user

user

user

user

application

application

application

application

application

process

process

process

process

process

Operating System

Hardware

slide14
Operating Systems: Intro
  • Communications between OS and processes
    • from process to OS - system calls
    • from OS to process - signals
slide15
Operating Systems: Intro
  • Communications between OS and Hardware
    • from OS to hardware - register & status settings
    • from hardware to OS - interrupts and exceptions
slide16
Operating Systems: Intro
  • Communications between processes
    • signals
    • message passing
    • via buffers
    • shared virtual memory
    • pipes
    • sockets
  • Communications between users and processes
    • keyboard, mouse, touch-screen
    • bit-mapped text and graphics display screens with windows
    • printers, plotters
interrupts
Operating Systems: IntroInterrupts
  • An interruption in the normal execution flow of a processor
    • a mechanism for causing the processor to suspend its current computation and take up some new task
      • old context must be preserved
      • control can be returned to the original task at some later time
      • new context started
  • Reasons:
    • control of asynchronous I/O devices
    • exceptional conditions arising from execution
slide18
Operating Systems: Intro
  • OS sets up an Interrupt Vector with service routine entry points
    • one entry per I/O device or I/O channel
    • a dormant context set up for each routine which can be activated on demand
    • further interrupts usually switched off during initial interrupt servicing
  • Example: Intel x86 interrupt vector entries:

0 : divide error

. . .

14: page fault

32: timer

33: keyboard

. . .

36: serial port 1

37: parallel port 2

38: floppy controller

. . .

46: hard disc

slide19
Operating Systems: Intro
  • An OS can be viewed as an event-driven system
    • just reacts to events as they occur
  • Interrupts need to be serviced carefully and quickly by the OS
    • cost similar to a process switch
    • too many interrupts will kill performance
  • Alternative to interrupts is Polling
    • process (or OS) continually polls I.e. inspects, device status registers awaiting some condition e.g. transfer completed
    • wastes time looping until condition occurs
    • much simpler to program than using interrupts but inefficient
privilege
Operating Systems: IntroPrivilege
  • Processors run at various levels of privilege
    • user-level
      • only the types of instruction needed by applications programs
      • only access to permitted areas of virtual memory
    • supervisor or kernel level
      • all types of instruction including I/O instructions
      • access to system registers
        • virtual memory registers
        • interrupt vectors
      • access to all areas of virtual memory
      • ability to switch interrupts on and off
    • may be intermediate levels on some architectures
    • each level may have its own processor registers to speed context switching
what s part of an operating system
Operating Systems: IntroWhat’s part of an Operating System?
  • Process management
  • Interrupt handling
  • Device drivers
  • File system
  • Networking
  • Applications?
    • Web browser?
    • Email?
  • Windows?
  • Command interpreters?
kinds of operating system
Operating Systems: IntroKinds of Operating System
  • For single-user workstation
  • For multiple-user server
    • file,compute, mail, web servers etc.
  • For mainframe systems
    • transaction processing
    • database systems
  • For real-time systems
    • time-critical applications
      • industrial process control
    • hard rather than soft deadlines
slide23
Operating Systems: Intro
  • All built with the same concurrent multi-process organisation
  • Main difference is in process scheduling
    • single user system needs only to meet one user’s expectations
      • overall efficiency less important
    • multiple user system needs to be equitable between users
      • efficiency important
    • transaction processing system needs to give good response
      • database queries
    • real-time system may need to pre-allocate processor time to guarantee meeting deadlines
      • overall efficiency may need to suffer
slide24
Operating Systems: Intro
  • Only exception to multiple-process organisation is embedded systems
    • dedicated single-purpose processors
      • multi-media, telecoms
        • MPEG decoders, GSM phones, portable web browsers
        • washing machine controllers!
      • avionics
        • FADECs, GPS, FMS
    • absolute reliability required
    • very conservatively programmed
  • System Level Integrated circuits
    • usually have a processing core which requires a real-time OS
    • often multiprocessors with a general-purpose CPU plus a DSP processor
      • ARM + OAK
operating system structure
Operating Systems: IntroOperating System Structure
  • How to partition OS functions?
    • process management and scheduling, memory management, interrupt handling, device drivers etc.
  • Monolithic OS
    • each function coded as a separate procedure
    • linked into one executable code object
    • event-driven core which calls appropriate procedures when required
      • driven by interrupts and system calls from processes
    • Linux
      • modules can be dynamically linked and unlinked as required
slide26
Operating Systems: Intro
  • Micro-kernel OS
    • each function coded as a separate process
      • system processes
    • only the minimum possible function in the core kernel
      • virtual memory organising
      • interrupt handling
      • process dispatching
    • appropriate system process activated as soon as possible to deal with all other functions
      • system processes will have higher privilege and usually higher priority than user processes
    • Windows NT
  • Intermediate flavours
    • some system processes but not a minimal micro-kernel
slide27
Operating Systems: Intro

Windows NT Structure

Hardware

slide28
Operating Systems: Intro
  • Advantages and disadvantages
    • monolithic:
      • faster switching to kernel functions
      • simple interfaces between functions i.e. procedure calls
      • easier access to data structures shared between functions
      • larger memory resident core
      • may become too large to maintain easily
    • micro-kernel
      • better partitioning - should be easier to implement and maintain
      • smaller memory resident core
      • slower switching to system processes
      • inter-system-process communications may be slower
ad