Operating Systems - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Operating Systems

Description:

Interrupts are handled much like calling a function or method in a ... ENIAC. History of Operating Systems. Automation in the 1950s using punch cards. computer ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 35
Provided by: DavidGol3
Learn more at: http://assets.strose.edu
Category:

less

Transcript and Presenter's Notes

Title: Operating Systems


1
OperatingSystems
CSCI-4210-01Spring 2009
  • David Goldschmidt, Ph.D.
  • Computer Science
  • The College of Saint Rose

2
ReviewInterrupt Mechanism
  • Interrupts are handled much like calling a
    function or method in a programming language

I/O devicestypically use abuffering strategy
3
What is an Operating System?
  • An Operating System is the software interface
    between hardware and users
  • Operating systems
  • Execute user and system programs
  • Manage and coordinate computer hardware
  • Use computer hardware efficiently
  • Serve as resource allocators
  • Are typically interrupt-driven

4
Design Goals of an Operating System
  • From a users perspective, an operating system
    should be
  • easy to use
  • easy to learn
  • reliable
  • safe
  • fast
  • System goals ofan operating system typically
    include
  • reliability
  • flexibility
  • extensibility
  • speed
  • efficiency
  • maintainability

5
Functional Components
  • Functional components of anoperating system
    include
  • Process manager
  • Memory manager
  • Virtual memory manager
  • File manager
  • Device manager

6
History of Operating Systems
  • In the beginning
  • the 1940s

ENIAC
7
History of Operating Systems
  • Automation in the 1950s using punch cards

8
Batch Jobs
  • A job is a unit of work submitted by a user
    tothe operating system, typically consisting of
  • a program either in a sourcelanguage or in
    binary form
  • a set of input data used bythe program when it
    executes

9
History of Operating Systems
  • IBM 360 introduced
  • in 1964

10
Multiprogramming
11
Multiprogramming
  • In multiprogramming, several jobs reside in
    memory simultaneously
  • CPU use is sharedand managed by theoperating
    system

12
Multiprogramming
  • Multiprogramming provides efficient use of the
    computer (CPU) and its resources (e.g. I/O)
  • One user cannot keep theCPU and I/O devices
    busyat all times
  • Each running program iscalled a job
  • Multiprogramming organizesjobs such that the CPU
    alwayshas exactly one to execute

13
Multiprogramming
  • Computer is often idle why?
  • CPU and hardware muchfaster than I/O
  • When a user or process isblocked waiting for
    I/O,the operating system switchesto another job
  • A subset of jobs is storedin memory, awaiting
    CPUor other resources

14
Timesharing (Multitasking)
  • To ensure fairness, consider a timesharing scheme
    in which the CPU cycles through all jobs
  • Each job (process) is givena fixed amount of CPU
    time
  • Switching from one runningprocess to another is
    calleda context switch
  • A process may relinquish itstime if blocked on
    an I/O request

15
Timesharing (Multitasking)
  • Unless blocked on I/O, processes line
    up,awaiting their turn with the CPU
  • CPU scheduling algorithmis necessary to
    efficientlydecide the order in whichprocesses
    execute
  • If processes do not fit intomemory, the
    operating systemwill swap them in and out
    ofmemory from virtual memory

16
History of Operating Systems
  • Personal computer revolution
  • of the late 1970s and early 1980s

17
History of Operating Systems
18
History of Operating Systems
  • World Wide Web and Internet revolution
  • of the 1990s and early 2000s

19
External View of a Computer
20
Operating System Structure
  • Using a layered approach, the operating system is
    divided into N levels or layers
  • Layer 0 is the hardware
  • Layer N is the top-leveluser interface
  • Each layer uses functionsand services of lower
    layers
  • Layer 1 often is the kernel

21
Operating System Structure
22
Operating System Kernel
  • The core program running in anoperating system
    is the kernel
  • When a computer is switched on,a bootstrap
    program executes from ROM
  • Bootstrap program initializes all aspects of the
    system, then loads the operating system kernel
    and starts its execution

23
User and Kernel Modes
  • Dual-mode operation provides a user mode anda
    kernel mode of operation
  • Allows the operating system to protect itself and
    other system components

24
User and Kernel Modes
  • Kernel relinquishes control to a user
    process,but may set a timer to ensure a process
    does not run beyond its allotted time
  • Avoid infinite loops, memory leaks, memory hogs,
    etc.
  • Not entirely effective in practice?
  • How many times have you fought to stop a runaway
    process?
  • Kernel also provides securityvia privileged
    instructions

25
Operating System Services
  • An operating system provides services to its
    users
  • Program execution
  • Load programs into memory, run/suspend/halt
    programs, handle/display errors
  • I/O operations
  • Seamlessly interact with I/O devices,
    includingdisks, networks connection, etc.
  • Filesystem manipulation
  • Read/write/traverse filesystem directories,read/w
    rite files, enforce permissions, search for
    files, etc.

26
Operating System Services
  • Other services an operating system provides
  • Inter-Process Communications (IPC)
  • Processes exchange information via shared
    memory,message passing, sockets, pipes, files,
    etc.
  • Might span multiple computer systems
  • Error detection and recovery
  • Errors arise in CPU, memory, I/O
    devices,processes, etc.
  • Operating system should detect and recover from
    errors, ensuring correct and consistent operations

27
System Calls via APIs
  • Operating system services available to usersvia
    GUI and CLI, which are just software programs
  • System calls are made via programming
    interfacecalled an Application Program Interface
    (API)
  • Common operating system APIs
  • Win32 API for Windows
  • POSIX API for POSIX-based systems,including
    UNIX, Linux, Mac OS X
  • Java API for Java Virtual Machine
  • C Standard Library

28
System Calls via APIs
  • Types of system calls include
  • Process control (e.g. start/suspend/stop a
    process)
  • Debugging information, too
  • File management
  • Device management
  • Information retrieval and maintenance
  • Current date/time, number of current users, OS
    version, amount of free memory, process
    information, etc.
  • Communications (e.g. IPC, network)

29
System Calls via APIs
  • System call sequence for a file copy program

30
System Calls via APIs
  • The API successfully hides the implementation
    detailsof the operating system
  • Programmer just needs to obeythe API
    specifications
  • Change the operating system,but maintain the API
    such thatit is backwards compatible
  • Deprecate old behavior over long period of time

31
System Calls via APIs
32
System Calls via APIs
  • Example using theprintf() functionfrom C

33
System Calls via APIs
  • Pass parameters to the operating systemvia
    registers or a block of data in memory

34
Reading Assignments
  • Read this week
  • Chapters 1 and 2of the Garrido book
Write a Comment
User Comments (0)
About PowerShow.com