Imprint | Privacy Policy

OS Overview

(Usage hints for this presentation)

Computer Structures and Operating Systems 2019
Dr. Jens Lechtenbörger (License Information)

DBIS Group
Prof. Dr. Gottfried Vossen
Chair for Computer Science
Dept. of Information Systems
WWU Münster, Germany

1 Introduction

1.1 Recall: Big Picture of CSOS

  • Computer Structures and Operating Systems (CSOS)
    • CS: How to build a computer from logic gates?

      NAND

      NAND” under CC0 1.0; from GitLab

      • Von Neumann architecture
      • CPU (ALU), RAM, I/O

        CPU

        CPU” under CC0 1.0; cropped and converted from Pixabay

    • OS: What abstractions do Operating Systems provide for applications?
      • Processes and threads with scheduling and concurrency, virtual memory

        Pong in TECS VM

        Pong in TECS VM” under GPLv2; screenshot of VM of TECS software suite

      • What is currently executing why and where, using what resources how?

1.1.1 OS Responsibilities

What does your OS even do?

What does your OS even do?

© 2016 Julia Evans, all rights reserved; from julia's drawings. Displayed here with personal permission.

1.2 Prerequisite Knowledge

  • Be able to write, compile, and execute small Java programs
    • What is an object? What is the meaning of this in Java?
    • How do you execute a program that requires a command line argument?
  • Be able to explain basic data structures (stacks, queues, trees) and algorithms (in particular, hashing)
  • Being able to explain the database transaction concept and update anomalies

2 OS Teaching

2.1 OS Part

  • Sharp cut ahead
    • So far, we followed a book with projects to build a computer bottom up
    • Unfortunately, nothing similar exists to build an Operating System (OS) bottom up
      • (Or is far too technical for our purposes)
  • Thus, the OS part presents major concepts and techniques of modern OSs
    • Some topics build upon each other
    • Some are more isolated
    • Goal: Understand and control your devices
      • Performance
      • Trust

2.2 OS Exercises

  • While the CS part had weekly projects, this will not be the case for the OS part
    • Exercise work (with pen and paper, games, simulators, programs, shell) will be part of JiTT assignments and in-class meetings

2.3 Textbook(s)

2.4 Presentations (1/2)

2.5 Presentations (2/2)

  • As usual, (pointers to) presentations are available in Learnweb
  • Presentations include

    • Learning objectives
    • Explanations for class topics
    • JiTT assignments
      • More on JiTT in a couple of minutes
    • Slides for in-class meetings
      • Topics that I plan to discuss in-class (after your questions have been answered)
    • Some slides contain audio explanations, e.g., the one starting with this bullet point

3 Outlook on Major OS Concepts

3.1 I/O

  • OS manages input/output (I/O) operations
    • Access to hardware
      • E.g., keyboard, disk, network
  • Modern CPUs support interrupts

    • I/O devices use interrupts to signal I/O events
      • CPU executes OS code of interrupt handler

    → Presentation on interrupts

3.2 Manage Computations

  • We start programs/apps
  • The OS manages processes

    • Process = OS management unit
      • Abstraction for computation
        • With resources
      • Processes isolated from each other
    • Potentially, each process with multiple threads
    • Thread = another OS management unit
      • Part of process
      • Defined by instructions to execute
        • E.g., an online game: different threads for game AI(s), GUI events, network handling
      • Threads of same process share resources

3.2.1 Threads

  • OS needs to manage threads

    • Housekeeping information, e.g.:
      • What did each thread do the last time it was on a CPU core?
        • What is the next instruction to execute?
        • In what state (registers, stack, I/O)?

    → Chapter 2 of [Hai17], presentation on threads

  • OS needs to allocate CPU (cores) to different threads

    • (CPU) Scheduling

    → Chapter 3 of [Hai17], presentation on scheduling

3.2.2 CPU Scheduling

CPU scheduling

CPU scheduling

© 2016 Julia Evans, all rights reserved; from julia's drawings. Displayed here with personal permission.

3.3 Controlling Concurrency

  • Processes and threads may need to interact
    • E.g., some producing data, others consuming
      • Shared resources
      • Prevent consumer from getting ahead of producer
      • Prevent producers from overwriting their data
    • Proper relative timing is crucial
    • Need synchronization
      • Recall ACID transactions and locking in DBMS
      • OS concept: Mutual exclusion (MX)

→ Chapter 4 of [Hai17], presentations on MX, MX in Java, MX challenges

3.4 Virtual Memory

  • OS manages main memory (RAM)
  • OS introduces layer of indirection/abstraction
    • Physical addresses (those seen in Hack)
    • Logical/virtual addresses
      • Each process has its own separate virtual address space, starting at address 0
      • OS keeps track where each virtual address is really located in RAM (if at all)
  • Benefits include
    • Protection: Threads of one process can neither “steal” nor “destroy” data of threads in another process
    • Flexibility: Programmers do not need to manage main memory

→ Chapter 6 of [Hai17], presentations Virtual Memory I and Virtual Memory II

3.5 Processes

  • OS unit of management and protection
    • Address space per process
      • Shared by threads of process
  • Files for inter-process communication

→ Chapters 7, 8 of [Hai17], presentation on processes

3.6 Security

  • IT systems are under attack
  • Attacks threaten security goals
  • Security mechanisms protect against attacks

→ Chapter 11 of [Hai17], presentation on security

3.7 Big Picture of OS Sessions

OS Overview image/svg+xml OS Overview Jens Lechtenbörger Summer 2018 Hardware as basis(Discussed in CS part) Applications (Users) System Call Interface WK 20: OS Introduction and Overview Wk 21: I/O and Interrupts Wk 21: Threads as units of computation Wk 22: Thread scheduling Wk 23/25: Concurrency, MX - Primitives provided by OS - Lots of challenges Wk 26: Threads need memory - Instructions and data - OS supports virtual memory Wk 27: Processes and security - OS isolates processes - OS supports access control - OS may support crypto primitives

Bibliography

  • [Hai17] Hailperin, Operating Systems and Middleware – Supporting Controlled Interaction, revised edition 1.3, 2017. https://gustavus.edu/mcs/max/os-book/
  • [Sta14] Stallings, Operating Systems – Internals and Design Principles, Pearson, 2014.
  • [TB15] Tanenbaum & Bos, Modern Operating Systems, Pearson, 2015.

License Information

This document is part of an Open Educational Resource (OER) course on Operating Systems. Source code and source files are available on GitLab under free licenses.

Except where otherwise noted, this work, “OS Overview”, is © 2017, 2018, 2019 by Jens Lechtenbörger, published under the Creative Commons license CC BY-SA 4.0.

No warranties are given. The license may not give you all of the permissions necessary for your intended use.

In particular, trademark rights are not licensed under this license. Thus, rights concerning third party logos (e.g., on the title slide) and other (trade-) marks (e.g., “Creative Commons” itself) remain with their respective holders.