Operating System Structure



Similar documents
Operating System Structures

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Example of Standard API

CS420: Operating Systems OS Services & System Calls

System Structures. Services Interface Structure

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Chapter 2 System Structures

CS3600 SYSTEMS AND NETWORKS

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

OPERATING SYSTEM SERVICES

COS 318: Operating Systems

Operating System Components

CS161: Operating Systems

How To Write A Windows Operating System (Windows) (For Linux) (Windows 2) (Programming) (Operating System) (Permanent) (Powerbook) (Unix) (Amd64) (Win2) (X

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Operating System Components and Services

Overview of Operating Systems Instructor: Dr. Tongping Liu

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

FAME Operating Systems

Chapter 3 Operating-System Structures

Lecture 1 Operating System Overview

Linux Kernel Architecture

CPS221 Lecture: Operating System Structure; Virtual Machines

Components of a Computer System

Operating System Organization. Purpose of an OS

ELEC 377. Operating Systems. Week 1 Class 3

Operating System Structures

OS Concepts and structure

LSN 10 Linux Overview

The Plan Today... System Calls and API's Basics of OS design Virtual Machines

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

CHAPTER 15: Operating Systems: An Overview

OPERATING SYSTEMS STRUCTURES

Star System Deitel & Associates, Inc. All rights reserved.

Operating Systems and Networks


Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Operating Systems. Lecture 03. February 11, 2013

Introduction. What is an Operating System?

Operating- System Structures

Chapter 3: Operating-System Structures. Common System Components

theguard! ApplicationManager System Windows Data Collector

Chapter 15 Windows Operating Systems

Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM

Operating Systems OS Architecture Models

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. Linux Basics

Have both hardware and software. Want to hide the details from the programmer (user).

I/O. Input/Output. Types of devices. Interface. Computer hardware

Introduction to Virtual Machines

Linux/UNIX System Programming. POSIX Shared Memory. Michael Kerrisk, man7.org c February 2015

Lesson 06: Basics of Software Development (W02D2

Operating System Software

CHAPTER 1: OPERATING SYSTEM FUNDAMENTALS

Operating System Overview. Otto J. Anshus

INTRODUCTION TO OPERATING SYSTEMS

4.1 Introduction 4.2 Explain the purpose of an operating system Describe characteristics of modern operating systems Control Hardware Access

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Operating Systems. Design and Implementation. Andrew S. Tanenbaum Melanie Rieback Arno Bakker. Vrije Universiteit Amsterdam

Outline. Operating Systems Design and Implementation. Chap 1 - Overview. What is an OS? 28/10/2014. Introduction

Minix Mini Unix (Minix) basically, a UNIX - compatible operating system. Minix is small in size, with microkernel-based design. Minix has been kept

Introduction. General Course Information. Perspectives of the Computer. General Course Information (cont.) Operating Systems 1/12/2005

Operating Systems 4 th Class

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

System Calls and Standard I/O

ReactOS is (not) Windows. Windows internals and why ReactOS couldn t just use a Linux kernel

EXPLORING LINUX KERNEL: THE EASY WAY!

CSE 265: System and Network Administration. CSE 265: System and Network Administration

RELIABLE OPERATING SYSTEMS

Encryption Wrapper. on OSX

A Comparison of Distributed Systems: ChorusOS and Amoeba

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Introduction. System Calls

Chapter 4. System Software. What You Will Learn... Computers Are Your Future. System Software. What You Will Learn... Starting the Computer

UNISOL SysAdmin. SysAdmin helps systems administrators manage their UNIX systems and networks more effectively.

PARALLELS SERVER BARE METAL 5.0 README

Programming for GCSE Topic H: Operating Systems

Operating Systems. Privileged Instructions

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

CIS 551 / TCOM 401 Computer and Network Security

Security Overview of the Integrity Virtual Machines Architecture

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Chapter 6, The Operating System Machine Level

Sun xvm VirtualBox Product Overview

Operating Systems. Rafael Ramirez (T, S)

PARALLELS SERVER 4 BARE METAL README

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

Shellshock Security Patch for X86

CSE 265: System and Network Administration. CSE 265: System and Network Administration

Transcription:

Operating System Structure Lecture 3 Disclaimer: some slides are adopted from the book authors slides with permission

Recap Computer architecture CPU, memory, disk, I/O devices Memory hierarchy Architectural support for OS Interrupt, timer User/kernel mode, privileged instructions MMU Synchronization instructions 2

OS services Today User s perspective What are the major functionalities of an OS? OS interface How applications interact with the OS? OS structure What are possible structures of an OS? 3

A View of Operating System Services User Mode Kernel Mode Hardware 4

Operating System Services User interface Command-Line Interface (CLI) vs. Graphical User Interface (GUI) 5

Command-Line Interface (CLI) Command-line interpreter (shell) Many flavors: bash, csh, ksh, tcsh, Usually not part of the kernel, but an essential system program Allow users to enter text commands Some commands are built-in E.g., alias, echo, read, source, Some are external programs E.g., ls, find, grep, Pros and Cons. + Easy to implement, use less resources, easy to access remotely + Easy to automate E.g., $ grep bandwidth /tmp/test.txt awk '{ print $2 } Difficult to learn 6

Graphic User Interface (GUI) GUI Mouse, keyboard, monitor Invented at Xerox PARC, then adopted to Mac, Window, Pros and Cons + Easy to use - Use more h/w resources The first commercial GUI from Xerox Star workstation. (source: Wikipedia) Many systems support both CLI and GUI 7

Operating System Services File-system service Read/write /create/delete/search files and directories See file information (e.g., file size, creation time, access time, ) Permission management (read only, read/write, ) Communications Share information between processes in the same computer (Inter-process communication - IPC) or between computers over a network (TCP/IP) 8

Operating System Services Resource allocation CPU cycles, main memory space, file space, I/O devices Accounting Keeping track of who uses what for how much Security Login, administrators vs. normal users vs. guests 9

Operating System Services Protection Prevent memory corruption between multiple user programs and between user programs and the kernel Detect and report errors Divide by zero, access violation, hardware faults, 10

System Calls Programming interface to the services provided by the OS Typically written in a high-level language (C) Most programmers do not directly use system calls They use more high level APIs (i.e., libraries) But system programmers (or you) do use system calls Two most popular system call APIs Win32 API for Windows POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X) 11

Example Copy the contents of one file to another file int main(int argc, char *argv[]) { int src_fd, dst_fd; char buf[80]; int len; src_fd = open(argv[1], O_RDONLY); dst_fd = open(argv[2], O_WRONLY O_CREAT O_TRUNC); while ((len = read(src_fd, buf, 80)) > 0) { write(dst_fd, buf, len); } } printf( Done\n ); return 0; 12

Example Copy the contents of one file to another file int main(int argc, char *argv[]) { int src_fd, dst_fd; char buf[80]; int len; src_fd = open(argv[1], O_RDONLY); dst_fd = open(argv[2], O_WRONLY O_CREAT O_TRUNC); while ((len = read(src_fd, buf, 80)) > 0) { write(dst_fd, buf, len); } } printf( Done\n ); return 0; Syscalls: open, read, wrtie Non-syscall: printf 13

System Call API Description $ man 2 read 14

API - System Call - OS 15

Standard C Library Example C program invoking printf() library call, which calls write() system call 16

Types of System Calls Process control Create/terminate process, get/set process attributes, wait for time/event, allocate and free memory File management create, delete, open, close, read, write, reposition get and set file attributes Device management request device, release device, read, write, reposition, get device attributes, set device attributes Communications create, delete communication, send, receive messages Protection Control access to resources, get/set permissions, allow and deny user access 17

Examples of Windows and Unix System Calls 18

Operating System Structure Simple structure MS-DOS Monolithic kernel UNIX Microkernel Mach 19

MS-DOS Structure Written to provide the most functionality in the least space Minimal functionalities Not divided into modules Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated 20

UNIX: Monolithic Kernel Implements CPU scheduling, memory management, filesystems, and other OS modules all in a single big chunk User Application System call Process Management User Application Kernel Accounting User Application Protection boundary Memory Management Filesystem Disk I/O TCP/IP Device Drivers Pros and Cons + Overhead is low + Data sharing among the modules is easy Too big. (device drivers!!!) A bug in one part of the kernel can crash the entire system 21

Loadable Kernel Module Dynamically load/unload new kernel code Linux and most today s OSes support this User Application System call Process Management User Application Kernel Accounting User Application Protection boundary Memory Management Filesystem Disk I/O TCP/IP Device Drivers Pros and Cons + Don t need to have every driver in the kernel. + Easy to extend the kernel (just like micro kernel. See next) A bug in a module can crash the entire system 22

Microkernel Moves as much from the kernel into user space Communicate among kernels and user via message passing Application Program File System Device Driver user mode messages messages Interprocess Communication memory managment CPU scheduling kernel mode microkernel hardware Pros and Cons + Easy to extend (user level driver) + More reliable (less code is running in kernel mode) - Performance overhead of user space to kernel space communication 23

Hybrid Structure Most modern operating systems are actually not one pure model Hybrid combines multiple approaches to address performance, security, usability needs Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality Windows mostly monolithic, plus microkernel for different subsystem personalities Apple Mac OS X hybrid, layered Below is kernel consisting of Mach microkernel and BSD Unix parts, plus I/O kit and dynamically loadable modules (called kernel extensions) 24

OS Structure Comparison Source: http://en.wikipedia.org/wiki/monolithic_kernel 25

Administrative Project 1 will be announced on Thursday You need to form a team Send your team members to the TA 26