MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.

Slides:



Advertisements
Similar presentations
OPERATING SYSTEMS Lecturer: Szabolcs Mikulas Office: B38B
Advertisements

Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Operating System.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
Winter 2005 CMPE 151: Network Administration Lecture 2.
OPERATING SYSTEM LESSON 2. INTRODUCTION TO OPERATING SYSTEM Computer Hardware’s complexity Operating Systems (OS) hide this complexity from users OS manages.
Chapter 1 Introduction
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Chapter 1 Introduction 1.1 What is an operating system
1 What is an operating system? CSC330Patricia Van Hise.
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
Principles of Operating System 2014
CS 6560 Operating System Design Lecture 1. Overview 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
 What is OS? What is OS?  What OS does? What OS does?  Structure of Operating System: Structure of Operating System:  Evolution of OS Evolution of.
Operating Systems.
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S. TANENBAUM ALBERT S. WOODHULL Yan hao (Wilson) Wu University of the Western.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
1 Operating System Overview. 2 Today’s Objectives Explain the main purpose of operating systems and describe milestones of OS evolution Explain fundamental.
Operating Systems Principles Lecture 1: Introduction 主講人:虞台文.
Chapter 1 Introduction 1.1 What is an operating system
ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction. ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction Mi-Jung Choi DPNM Lab. Dept. of CSE,
1 Instructor :Erdal Kose Office hours: Tuesday 9:00-9:30 pm. Mail box : 2109 Ingersoll Hall (Erdal ) Web site :
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 E-Main: Phone:
1 Introduction. 2 A computer system consists of –hardware –system programs –application programs.
MODERN OPERATING SYSTEMS Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
1 Operating Systems: Principles and Practice Cpr E 308.
MODERN OPERATING SYSTEMS Chapter 1 Introduction
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Operating System Overview Tarek Abdelzaher Lawrence Angrave Vikram Adve.
Operating Systems.
Chapter 1 Introduction  What is an operating system  History of operating systems  The operating system zoo  Computer hardware review  Operating system.
操作系统原理 OPERATING SYSTEM Chapter 1 Introduction 概 述.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Operating Systems A Biswas, Dept. of Information Technology.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 0: Historical Overview.
OS HISTORY Module 1.3 Richard Newman University of Florida.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Introduction to Operating Systems Concepts
Operating System Overview
Lecture 3: Basic OS Concepts
Operating System.
Evolution of Operating Systems
Introduction to Operating System (OS)
Chapter 1: Introduction
OS Basics Module 1.2 Richard Newman University of Florida.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Today’s agenda Hardware architecture and runtime system
Introduction to Operating Systems
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Introduction to Operating Systems
Lecture 3: Basic OS Concepts
Introduction to Computer Systems
Operating System Introduction
Operating Systems Principles Lecture 1: Introduction
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Operating System Introduction
Introduction and Overview
Presentation transcript:

MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Outline What is an operating system The history of Operating System Hardware of operating system Important concepts of Operating System

What Is An Operating System A modern computer consists of: One or more processors Main memory Disks Printers Various input/output devices Managing all these components requires a layer of software – the operating system Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

What is an Operating System? A modern computer is very complex.  Networking  Disks  Video/audio card  …. It is impossible for every application programmer to understand every detail A layer of computer software is introduced to provide a better, simpler, cleaner model of the resources and manage them

What Is An Operating System Figure 1-1. Where the operating system fits in. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

What is an Operating System? Users use various OS  Windows, Linux, Mac OS etc. User interacts with shell or GUI  part of OS?  they use OS to get their work done Is device driver part of OS?

What is an Operating System? On top of hardware is OS Most computers have two modes of operation:  Kernel mode and user mode  OS runs in kernel mode, which has complete access to all hardware and can execute any instruction  Rest of software runs in user mode, which has limited capability  Shell or GUI is the lowest level of user mode software

What is an operating system? Two functions:  From top to down: provide application programmers a clean abstract set of resources instead of hardware ones  From down to top: Manage these hardware resources

The Operating System as an Extended Machine Figure 1-2. Operating systems turn ugly hardware into beautiful abstractions. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

As an extended machine Abstraction:  CPU—process  Storage –- files  Memory– address space 4 types of people:  Industrial engineer: design hardware  Kernel designer  Application programmer: OS’s user  End users

The Operating System as a Resource Manager Allow multiple programs to run at the same time Manage and protect memory, I/O devices, and other resources Includes multiplexing (sharing) resources in two different ways: In time In space Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

As a resource manager Modern OS runs multiple programs of multiple users at the same time  Imagine what would happen if several programs want to print at the same time?  How to account the resource usage of each process?  Resources can be multiplexed: How to ensure fairness and efficiency?

summary Operating system is a software  Is a complex software  Runs in kernel mode  Manages hardware  Provide a friendly interface for application programmer

History of Operating Systems Generations: (1945–55) Vacuum Tubes (1955–65) Transistors and Batch Systems (1965–1980) ICs and Multiprogramming (1980–Present) Personal Computers Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

1 st : vacuum tubes Large and slow Engineers design, build, operate and maintain the computer All programming is done with machine language, or by wiring circuits using cables insert plugboards into the computer and operate The work is mainly numerical calculations

2 nd : transistors and batch systems Also called mainframes Computers are managed by professional operators Programmers use punch card to run programs; operators operate (load compiler, etc ) and collect output to the user Complains soon come:  Human Operation between computer operation  Lead to batch system  Collect a batch of jobs in the input room, then read them into a magnetic tape; the same for output

2 nd : Transistors and Batch Systems (1) Figure 1-3. An early batch system. (a) Programmers bring cards to (b)1401 reads batch of jobs onto tape. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Transistors and Batch Systems (2) Figure 1-3. (c) Operator carries input tape to (d) 7094 does computing. (e) Operator carries output tape to (f) 1401 prints output. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Transistors and Batch Systems (4) Figure 1-4. Structure of a typical FMS job. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

3 rd : IC and Multiprogramming OS/360: a dinosaur stuck in a tar pit  Aims to adapts 1401/7904, covers all trades of life  However, OS/360 introduces several key techniques Multi-programming: solve the problem of CPU idling Spooling: simultaneous peripheral operation on line  Whenever a job finishes, OS load a new job from disk to the empty-partition

Figure 1-5. A multiprogramming system with three jobs in memory. 3 rd : ICs and Multiprogramming Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

3 rd : Ics and Multiprogramming Problems:  3 rd generation OS was well suited for big scientific calculations and massive data processing  But many programmers complain a lot… for not be able to debug quickly…. Why?  And the solution to this problem would be….?  Timesharing: A variant of multiprogramming Provide both fast interactive service but also fits big batch work

3 rd : IC and Multiprogramming A system to be remembered: MULTICS  A machine that would support hundreds of simultaneous timesharing users– like the electricity system (like a web server nowadays)  Introduces many brilliant ideas but enjoys no commercial success  Its step-child is the well-known and time-honored UNIX  System V/ FreeBSD, MINIX, Linux

4 th : personal computers Computers have performance similar to 3 rd generation, but prices drastically different CP/M  First disk-based OS 1980, IBM PC, Basic Interpreter, DOS, MS- DOS GUI--Lisa—Apple: user friendly MS-DOS with GUI– Win95/98/me— winNT/xp…

Summary 4 generations OS Develops with hardware and user needs Multi-user, multi-programming, time-sharing

Computer Hardware Review Figure 1-6. Some of the components of a simple personal computer. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Hardware: processor Brain of computer  Fetches instruction from memory and execute  Cycle of CPU: fetch, decode, execute  CPU has registers to store variable and temporary result: load from memory to register; store from register to memory  Program counter: next instruction to fetch  Stack pointer: the top of the current stack  PSW: program status word, priority, mode…

CPU Pipelining Figure 1-7. (a) A three-stage pipeline. (b) A superscalar CPU. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

CPU Pipeline Accelerate the execution Cause headaches to OS/compiler writers For superscalar: instructions are often executed out of order

Figure 1-8. (a) A quad-core chip with a shared L2 cache. (b) A quad-core chip with separate L2 caches. Multithreaded and Multicore Chips Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 1-9. A typical memory hierarchy. The numbers are very rough approximations. Memory (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

memory Memory is where computer fetch and store data, ideally, it should be both chip/large The best people can do, is to construct a memory hierarchy Cache lines:  Memory divided into cache lines; the mostly used ones are stored in caches  Cache hit, cache miss  Cache: whenever there is disparity in usage or speed; used to improve performance

Questions when dealing with cache: When to put a new item into the cache. Which cache line to put the new item in. Which item to remove from the cache when a slot is needed. Where to put a newly evicted item in the larger memory. Memory (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Structure of a disk drive. Disks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Disks Cheap and large: two orders better than RAM Slow: three orders worse than RAM Mechanical movement to fetch data One or more platter—rotate– rpm Information is stored on concentric circles Arm, track, cylinder, sector Disk helps to implement Virtual Memory  When no enough memory is available, disks are used as the storage, and memory as cache

Figure (a) The steps in starting an I/O device and getting an interrupt. I/O Devices Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

I/O devices Two parts: a controller and a device Controller: to provide a simpler interface to OS Device driver: talks to controller, give commands and accepts response Busy waiting/interrupt/DMA

Buses Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Booting the Computer BIOS—basic input/output system  On the parentboard, low-level I/O software  Checks RAM, keyboard and other basic devices  Determine the boot device: floppy, CD-ROM, disk  First sector of the boot-device is read into memory  The sector contains program to check which partition is active  Then a secondary boot-loader is read into memory and reads in operating system from the active partition

The Operating System Zoo Mainframe operating systems Server operating systems Multiprocessor operating systems Personal computer operating systems Handheld operating systems Embedded operating systems Sensor node operating systems Real-time operating systems Smart card operating systems Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Processes Address spaces Files Input/Output Protection The shell Ontogeny recapitulates phylogeny Large memories Protection hardware Disks Virtual memory Operating System Concepts Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

processes Process  Address space: 0-4G; executable program, program’s data, and its stack  Other resources like: registers, files, alarms, related processes, and other information  A process is fundamentally a container that holds information for a program to run

Processes Figure A process tree. Process A created two child processes, B and C. Process B created three child processes, D, E, and F. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Address Space The memory used by a process, in concept MOS allows multiple processes in memory simultaneously Some processes need more memory than physically available– virtual memory

Figure A file system for a university department. Files (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure (a) Before mounting, the files on the CD-ROM are not accessible. (b) After mounting, they are part of the file hierarchy. Files (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Two processes connected by a pipe. Files (3) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

System calls System calls is the interface users contact with OS and hardware System calls vary from system to system, but the underlying concepts are similar

Figure The 11 steps in making the system call read(fd, buffer, nbytes). System Calls Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Some of the major POSIX system calls. System Calls for Process Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Some of the major POSIX system calls. System Calls for File Management (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Some of the major POSIX system calls. System Calls for File Management (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Some of the major POSIX system calls. Miscellaneous System Calls Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure A stripped-down shell. A Simple Shell Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Processes have three segments: text, data, and stack. Memory Layout Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure (a) Two directories before linking /usr/jim/memo to ast’s directory. (b) The same directories after linking. Linking Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure (a) File system before the mount. (b) File system after the mount. Mounting Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure The Win32 API calls that roughly correspond to the UNIX calls of Fig Windows Win32 API Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Monolithic systems – basic structure: A main program that invokes the requested service procedure. A set of service procedures that carry out the system calls. A set of utility procedures that help the service procedures. Operating Systems Structure Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Structure of the THE operating system. Layered Systems Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure Structure of the MINIX 3 system. Microkernels Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure The client-server model over a network. Client-Server Model Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure (a) A type 1 hypervisor. (b) A type 2 hypervisor. Virtual Machines (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

The C language Header files Large programming projects The model of run time The World According to C Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

World according to C Operating systems are large C programs consisting of many pieces written by many programmers C language  Data types, variables, control statements…  Header files: declaration, definition, macros…  For a large programming project

Figure The process of compiling C and header files to make an executable. The Model of Run Time Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Large programming projects C preprocessor:  Gets the header, expand macros, handling conditional compilation Compiler .c -.o Linker  Combine all.o to an executable program; traditionally a.out

Gcc: preprocess-assemble-compile- link gcc -E hello.c –o hello.i gcc -S hello.i -o hello.s gcc -c hello.s –o hello.o gcc hello.o –o hello ldd hello