COP 4610:Introduction to Operating Systems CGS 5765: Principles of Operating Systems Instructor: Xiuwen Liu Department of Computer Science Florida State University Please pick up the syllabus from the front Outline • Class organization – Syllabus • Programming environment at Computer Science • Introduction to Operating Systems • A survey 5/29/2016 COP4610 2 Class organization • Class syllabus • Class web page • Comments – Grading – Academic honor code • Programs you submitted must be your own • While discussions of class materials and assignments are allowed, discussion and copying of solutions is strictly prohibited. 5/29/2016 COP4610 3 Class Email List • Class email list – I sent a message with the subject “We are going to have the first recitation on Aug. 27” on Monday, Aug. 25 – If you have not received the email, or would like to use another email, please send me an email with your email address • Some of you did not receive the message because of problems such as wrong email address in your record – I will send important announcements through the mailing list 5/29/2016 COP4610 4 Recitation Session • Recitation session will be taught by the instructor • You are required to attend the same session as you registered • Recitation session will focus on – Questions and answers – Programming examples – First recitation session is this Wednesday, Aug. 27. 5/29/2016 COP4610 5 Textbook • You are required to read the chapters in the textbook – You can skip sections only when specified – You are NOT required to read programming examples in the dotted boxes – However, you are required to know programming examples given in class and those related to programming projects • You may be tested on the materials in the textbook but not fully covered in the class – I will specify those sections clearly for self studying – The majority on quizzes and exams will be covered in the class 5/29/2016 COP4610 6 Textbook - continued • Some comments on the textbook – This class focuses on basic principles – All the programming assignments will be done in Unix / Linux environment – Comments from amazon.com 5/29/2016 COP4610 7 Programming Environment • linprog consists of four linux machines • program consists of four Sun workstations – Three programming assignments must be done on either linprog or program – Doing the assignments on other machines is not allowed 5/29/2016 COP4610 8 Programming Environment – cont. • Access – ssh to those machines • ssh linprog • ssh program 5/29/2016 COP4610 9 Linux/Unix Tutorial • You are expected to know how to use Linux/Unix – – – – How to edit a program – e.g., emacs, pico, vi How to compile a program – gcc, g++ How to run a program How to navigate through your files – cd, mkdir, mv, rm, rmdir, ls • On-line resources – Unix Guide 5/29/2016 COP4610 10 Expectations • You are expected to have a strong desire to learn something new (and may be difficult sometimes) • You are expected to be an Operating System expert • You are expected to know how to read and understand manuals – System calls – Unix commands 5/29/2016 COP4610 11 Expectations – cont. • System call manual pages – Syntax • Function prototype • How to call a function – Semantics • The meanings of the function • What it does with different parameter values • fork example 5/29/2016 COP4610 12 System Overview • A computer system consists of hardware and software that are combined to provide a tool to solve specific problems – Hardware includes CPU, memory, disks, printers, screen, keyboard, mouse ... – Software includes • System software – A general environment to create specific applications • Application software – A tool to solve a specific problem 5/29/2016 COP4610 13 System Overview – cont. 5/29/2016 COP4610 14 Hardware Resources • Processor: execute instructions • Memory: store programs and data • Input/output (I/O)controllers: transfer to and from devices • Disk devices: long-term storage • Other devices: conversion between internal and external data representations 5/29/2016 COP4610 15 Hardware Resources – cont. 5/29/2016 COP4610 16 Hardware Interface – cont. • Everything that a programmer needs to know in order to write programs that perform desired operation on the hardware – Disk drive is an example • Disk interface provides functions to move disk head, transfer data – Monitor • Monitor interface provides functions to move the cursor, display characters/graphics 5/29/2016 COP4610 17 Software Classification • System software – Provides a general programming environment in which programmers can create specific applications • Application software – Intended to solve a specific problem 5/29/2016 COP4610 18 Software Classification - continued 5/29/2016 COP4610 19 What is an Operating System? • The operating system is the part of the system software that manages the use of the hardware used by other system software and all application software – It is the system program that acts between the hardware and the user programs 5/29/2016 COP4610 20 What is an Operating System? - continued • It provides services to user programs – Through system calls / message passing • File system services • Memory services • I/O services • It hides hardware from user programs – When your program shows a message on the monitor, it does not need to know the details – When your program generates a new file, it does not need to where the free space is on your hard drive 5/29/2016 COP4610 21 Differences between OS and System Software • Major differences between OS and general system software – General system software relies on the abstractions provided by OS – OS abstracts the hardware directly – OS provides the fundamental trusted mechanisms for resource sharing – A general purpose OS is domain-independent 5/29/2016 COP4610 22 Operating System Functions • Resource manager – manage hardware and software resources – Resource abstraction and sharing • A nicer environment – implement a virtual machine for processes to run in • A program in execution is called a process – a nicer environment than the bare hardware 5/29/2016 COP4610 23 Resource Management Functions • Transform physical resources to logical resources – Resource abstraction • Make the hardware resources easier to use • Multiplex one physical resource to several logical resources – Create multiple, logical copies of resources • Schedule physical and logical resources – Decide who gets to use the resources 5/29/2016 COP4610 24 Resource Abstraction • Provides an abstract model of the operation of hardware components – Like data abstraction in Object-Oriented programming • Interface functions • Internal functions and status 5/29/2016 COP4610 25 A Disk Device Abstraction • Three interface functions – Load(block, length, device) – seek(device, track) – out(device, sector) 5/29/2016 COP4610 26 A Disk Device Abstraction – cont. • An abstract function for writing 5/29/2016 COP4610 27 Resource Abstraction – cont. • Multi-level abstractions – Disk controller -> disk driver -> file system 5/29/2016 COP4610 28 Resource Sharing • Two types of sharing – Time multiplexed sharing • time-sharing • schedule a serially-reusable resource among several users – Space multiplexed sharing • space-sharing • divide a multiple-use resource up among several users 5/29/2016 COP4610 29 Time-multiplexing the Processor - Called multiprogramming 5/29/2016 COP4610 30 Time-multiplexing the Processor – cont. - Resulted in concurrent execution or concurrency 5/29/2016 COP4610 31 Time-multiplexing the Processor – cont. - Multiprogramming can improve the overall system performance 5/29/2016 COP4610 32 Space-multiplexing Memory 5/29/2016 COP4610 33 Time-multiplexing I/O Devices 5/29/2016 COP4610 34 Space-multiplexing the Disk 5/29/2016 COP4610 35 Issues in Resource Sharing • Resource isolation and sharing – Protection – Sharing • Resource allocation – Scheduling 5/29/2016 COP4610 36 Survey • This survey consists of a few questions – The purpose is to give me a better knowledge of your background so that I may do a better job – It will be used as evidence for attendance – It will not be used for any grading • We will have the first recitation this week – This Wednesday, Aug. 27, 2001 5/29/2016 COP4610 37