Docsity

Operating System Structures - Operating System - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Operating System Structures - Operating System - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

1

Chapter 2: Operating-System

Structures

  • Operating system design
  • Interface provided to users & programmers
    • System calls (programmer access)
    • User level access to system
  • Services

2

System Structure

  • Layered approach
    • Operating system divided into layers
    • Higher levels use only services of lower levels
    • Basic principle of abstract data types (classes)

Figure 2.

Example

4

BlockLinkedList

BlockGroup FreeList

Directory

5

Original Unix O/S:

Kernel Approach

Figure 2.13, p. 69 “monolithic structure” Docsity.com

7

Microkernel Approach

  • More like a client-server system
  • Kernel supports efficient message passing
    • Plus some other low-level services such as interrupt handling, loading device drivers
  • Much of former kernel runs in user mode (not kernel mode) - E.g., file system (server) may run in user mode
  • Mach (some versions), and QNX (http://www.qnx.com/) operating systems organized this way
  • QNX is real-time; small (micro) kernel can be advantageous to real-time systems

8 http://en.wikipedia.org/wiki/Microkernel Docsity.com

10

Mac OS X: “Microkernel”

Approach (not fully)

Figure 2.

Emphasis : Mach and BSD Unix both run in kernel mode

11

Solaris: Modular approach

  • “Perhaps the best current methodology for operating-system design involves using object- oriented programming techniques to create a modular kernel” (p. 72)
  • modules are typically dynamically loadable (e.g., Solaris, Linux, Mac OS X)

Fig 2.

Process Interfaces to the System

  • In what we’ve been talking about so far, a

process can either execute machine

language code or it can make system calls

  • What other kinds of process interfaces are

possible?

  • API or library interfaces; e.g., POSIX
  • Virtual machine interface

13

14

Virtual Machines

  • Processes provided with an interface virtually identical to the bare hardware
  • Each process is provided with a (virtual) copy of the underlying computer
  • E.g., IBM VM mainframe operating system
  • Devices are an issue
    • e.g., Disks must be partitioned
  • Each user runs an operating system on their own virtual machine - Some instructions run directly on hardware - Some instructions (e.g., I/O) are interpreted

Hosted Virtual Machine

16

18

Java Virtual Machine (JVM)

  • Specification for an abstract computer
    • http://java.sun.com/docs/books/jvms/
    • http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
  • Instructions specified as “bytecode”s
  • Architecture neutral
  • Java program code is compiled (javac) into files containing bytecode
  • JVM includes
    • Class loader
    • Bytecode verifier
    • Bytecode interpreter

Services - 1

  • User Interface
    • GUI and command line are the most common for general purpose operating systems
  • Program execution
    • System must be able to load a machine language program into RAM memory and run that program
  • Resource allocation
    • Multiple processes or users: Need to share, allocate, and manage resources
    • Examples of types of resources: CPU cycles (time), main memory, disk files, I/O devices (printers, USB flash drives etc). 20

Services - 2

  • I/O operations
    • All I/O that a program does is typically carried out by the O/S
    • This is for efficiency and protection
  • File-system manipulation
    • creating, reading, writing files & directories
  • Communications
    • Between processes on the same computer and between processes across different computers
    • e.g., Shared memory & message passing 21