Lecture 3: Basic OS Concepts

Slides:



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

Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc
CSC 360- Instructor: K. Wu Overview of Operating Systems.
Enrique Blanco García © 2004 Introduction to the UNIX environment Enrique Blanco Cover from the book Modern operating systems. A. Tanenbaum.
Winter 2005 CMPE 151: Network Administration Lecture 2.
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.
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.
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.
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.
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.
1 Operating Systems: Principles and Practice Cpr E 308.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
MODERN OPERATING SYSTEMS Chapter 1 Introduction
Lecture 1: Network Operating Systems (NOS) An 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.
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 概 述.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
Operating System Overview
Applied Operating System Concepts
Lecture 3: Basic OS Concepts
Chapter 1: Introduction
Chapter 1: Introduction
Operating Systems Lecture 2.
Chapter Objectives In this chapter, you will learn:
Avani R.Vasant V.V.P. Engineering College
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
What is an Operating System?
Chapter 1: Introduction
Lecture 2: Hardware Review
John Carelli, Instructor Kutztown University
MODERN OPERATING SYSTEMS Third Edition ANDREW S
More examples How many processes does this piece of code create?
Operating System Concepts
Chapter 1: Introduction
Operating Systems Lecture 2.
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 2: Hardware Review
Chapter 1: Introduction
Chapter 1: Introduction
Lecture 6: Multiprogramming and Context Switching
Chapter 1: Introduction
Operating System Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Operating System Concepts
Chapter 1: Introduction
Operating System Introduction
Introduction and Overview
Presentation transcript:

Lecture 3: Basic OS Concepts

Review: Operating Systems History 1945-60: Batch Systems – Cards 1960-70: Spooling Batch Systems – Tapes 1960- : Multiprogramming 1970- : Timesharing 1990- : Real-time, Distributed 2005-: WebOS (Web2.0, etc) 2007-: Mobile OS All programming was done in absolute machine language, vacuum tubes vs transistor

Review: The Operating System Zoo Personal computer operating systems Single user (usually) MS-DOS, Windows, Linux Server operating systems Focus on networking Linux, SunOS, Windows NT Multiprocessor operating systems Real-time operating systems Hard versus soft real-time OS Embedded operating systems Memory, power constraints Smart card operating systems Extreme resource constraints Mobile Operating Systems Android, iOS, Android Wear

Review: Computer Hardware Monitor Bus Components of a simple personal computer

I/O Devices (a) (b) (a) Steps in starting an I/O device and getting an interrupt (b) How the CPU is interrupted

Structure of a large Pentium system An Example: Pentium Structure of a large Pentium system

Overview of this lecture Process File systems System calls

Program vs. Process A process is a program in execution Program is a piece of code Process has “state” (what could this state be?) There could be multiple processes all simultaneously executing the same program Coordinate accesses and sharing of resources Sharing in time – CPU cycles Sharing in space – Memory

Processes Process = program in execution Address space Program (text), data, stack Registers Program counter, stack pointer, etc Processes can be created, suspended, restarted, killed (!) Process scheduler decides which process to run next among all the current processes

Process Creation In UNIX, there is a way for one process to “spawn” more processes A process tree Process A created two child processes, B and C Process B created three child processes, D, E, and F

Processes: Memory Sharing Operating System Physical memory

Inter process communication (UNIX) A pipe is like a pseudo file. Processes set up a pipe in advance. Processes read from or write to a pipe.

Mounting Files (UNIX) Before mounting, After mounting floppy on b, files on floppy/CD-ROM are inaccessible After mounting floppy on b, files on floppy/CD-ROM are part of file hierarchy

File Permissions Example % ls -lR .: total 2 drwxr-x--x 2 guan adm 1024 Dec 17 13:34 A drwxr----- 2 guan adm 1024 Dec 17 13:34 B ./A: total 1 -rw-rw-rw- 1 guan adm 593 Dec 17 13:34 x ./B: -r--rw-rw- 1 guan adm 446 Dec 17 13:34 x -rw----rw- 1 trina adm 446 Dec 17 13:45 y Show an example, man, ls, chmod Copyright © 2002 Thomas W. Doeppner. All rights reserved.

Setting File Permissions #include <sys/types.h> #include <sys/stat.h> int chmod(const char *path, mode_t mode) only the owner of a file and the superuser may change its permissions nine combinable possibilities for mode (read/write/execute for user, group, and others) S_IRUSR (0400), S_IWUSR (0200), S_IXUSR (0100) S_IRGRP (040), S_IWGRP (020), S_IXGRP (010) S_IROTH (04), S_IWOTH (02), S_IXOTH (01) Symbolic mode Chmod o-x file Copyright © 2002 Thomas W. Doeppner. All rights reserved.

Structure of UNIX Shell User Input Kernel (OS)

System Calls Interface between the user and the operating system (kernel) Handle processes, files, directories, time, input/output Switch processor from user to kernel mode In User mode, some instructions are forbidden In Kernel mode, all instructions are allowed

Example Read from file n = read(fd, buffer, nbytes); Change directory s = chdir(dirname); Get time s = time(&seconds);

System Calls For File Management

System Calls For Directory Management

System Calls For Miscellaneous Tasks

Quick Questions Does this belong in the OS? Text editor Compiler Web browser Shell Email client Program which copies files Device driver (program which controls a hardware device)