CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,

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.
CSCI 1730 April 1 st, Materials Class notes slides & some “plain old” html & source code examples linked from course calendar board notes & diagrams.
EEE 435 Principles of Operating Systems Operating System Concepts (Modern Operating Systems 1.5)
Operating system services Program execution I/O operations File-system manipulation Communications Error detection Resource allocation Accounting Protection.
Chap 2 System Structures.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved Processes Figure 1-5.
1 UNIX 1 History of UNIX 2 Overview of UNIX 3 Processes in UNIX 4 Memory management in UNIX 5 The UNIX file system 6 Input/output in UNIX.
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.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Chapter 1 Introduction 1.1 What is an operating system
Introduction to Kernel
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
MODERN OPERATING SYSTEMS Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Guide To UNIX Using Linux Third Edition
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
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
System Calls 1.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
CS 149: Operating Systems January 29 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Threads, Thread management & Resource Management.
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 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 Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
CSC 322 Operating Systems Concepts Lecture - 19: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Pertemuan 3 Konsep Sistem Operasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
CSC 322 Operating Systems Concepts Lecture - 20: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Chapter 16 - File Systems –Persistent storage: storage that will continue to exist after a program that uses or creates it completes. –Sometimes called.
Files & File system. A Possible File System Layout Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
CSC 322 Operating Systems Concepts Lecture - 7: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Threads, Thread management & Resource Management.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Lecture 19 Linux/Unix – File System
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.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
操作系统原理 OPERATING SYSTEM Chapter 1 Introduction 概 述.
What is a Process ? A program in execution.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
What is an operating system? Tool to make programmer's job easy Resource allocator – Must be fair; not partial to any process – Must discriminate between.
ECE 456 Computer Architecture Lecture #9 – Input/Output Instructor: Dr. Honggang Wang Fall 2013.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
Introduction to Operating Systems Concepts
Introduction to Kernel
Avani R.Vasant V.V.P. Engineering College
Protection of System Resources
CS 3305 System Calls Lecture 7.
CSC 322 Operating Systems Concepts Lecture - 16: by
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 1 Introduction to Operating System Part 5
Introduction to Operating Systems
CS510 Operating System Foundations
Lecture 4: File-System Interface
Presentation transcript:

CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-1) Ahmed Mumtaz Mustehsan, CIIT, Islamabad

A process is a Program in execution. A process is fundamentally a container that holds all the information needed to run a program. It requires a system call to create and delete a process. Address space of a process (0 to maximum memory a process can access. ) Address space contains: The instructions, the data, stack, a set of resources, registers (including PC and SP), a list of open files, set alarms, lists of related processes, and other information needed to run the program. Processes Lecture 42Ahmed Mumtaz Mustehsan, CIIT, Islamabad

Process Table: (Data structure one per process) Operating system table called the process table, which is an array (or linked list) of structures, One for each process currently in existence. Keeps info about process other than the contents of its own address space Context Switching: OS stops one process and starts another When a process is suspended temporarily, it must later be restarted in exactly the same state it had when it was stopped. Processes Lecture 43Ahmed Mumtaz Mustehsan, CIIT, Islamabad

A process can communicate with another process called Inter process communications. (IPC) process can communicate with each other on the same computer or across the network. Different methods exists for IPC. Process has a UID’s and group ID’s (GID) that uniquely identifies each project. Inter Process Communication (IPC) Lecture 44Ahmed Mumtaz Mustehsan, CIIT, Islamabad

A Process Tree Shell (command interpreter) Reads command from terminal; creates processes Process creates child processes. e.g. Process A created B and C processes. Process C Creates D, E and F The parent and child processes organized in a Tree structure Lecture 45Ahmed Mumtaz Mustehsan, CIIT, Islamabad

OS hides the peculiarities of the disks and other I/O devices and present the programmer with a nice, clean abstract model of device independent files Directory as a way of grouping files together. Directory hierarchy can be specified by giving its path name from the top of the directory called the root directory. Absolute path names consist of the list of directories that must be traversed from the root directory to get to the file, with slashes separating the components Requires system calls to create a file, delete a file, open and close a file. File System Lecture 46Ahmed Mumtaz Mustehsan, CIIT, Islamabad

The directory is organized as a tree Root directory at the top. Path proceeds from the root (e.g. faculty/prof brown/courses) File directory Lecture 47Ahmed Mumtaz Mustehsan, CIIT, Islamabad

A CD-ROM is mounted on directory b. Mounting Files in UNIX Lecture 48Ahmed Mumtaz Mustehsan, CIIT, Islamabad

Special files are provided in order to make I/O devices look like files Use same calls for I/O as for files, OS treats them as files. Block special files (disks) Character special files (line printers, modems) Example: UNIX mount command mount at location or address /dev e.g. /dev/lp is line printer Special files Lecture 49Ahmed Mumtaz Mustehsan, CIIT, Islamabad

A and B write into the pipe and read from the pipe. UNIX Pipe Processes communicate by writing into/reading from a file in Unix A pipe is a sort of pseudo file used to connect two Processes. Implementation of a pipe is like a file. When process A wants to send data to process B, it writes on the pipe as if writing to output file. Process B can read the data by reading from the pipe as if reading from an input file. Lecture 410Ahmed Mumtaz Mustehsan, CIIT, Islamabad

File/ data protection in UNIX uses rwx bits for each file 3 bits for owner, 3 for group, 3 for everyone else rwxrwxrwx rwxr-x--x r-xr-xr-x rwx I/O, Protection/Shell Lecture 411Ahmed Mumtaz Mustehsan, CIIT, Islamabad

UNIX has flavors such as (sh, bash, csh, ssh ) sort file2 It invokes the sort program with input taken from file1 and output sent to file2. cat file 1 file 2 file3 | sort > /dev/lp Invokes the cat program to concatenate three files and send the output to sort to arrange all the lines in alphabetical order. The output of sort is redirected to the file /dev/lp, typically the printer. cat file1 file2 file3 | sort >/dev/lp & Starts up the sort as a background job Shell (command interpreter) Lecture 412Ahmed Mumtaz Mustehsan, CIIT, Islamabad

Interface between user programs and OS Varies from Operating system to operating system call is issued by user program Call uses a library procedure of the same name Library routine puts machine into kernel modes (by issuing a special instruction) Finds actual routine for system call in a table Does the work involved in the call Returns to user program System Calls Lecture 413Ahmed Mumtaz Mustehsan, CIIT, Islamabad

count = read (fd, buffer, nbytes) fd is a file descriptor. When a file is opened, permissions are checked. If access is allowed, a number (fd) is returned. Then file can be read/written nbytes is number of bytes in file buffer is where read deposits the bytes (call be reference) UNIX Read System Call Lecture 414Ahmed Mumtaz Mustehsan, CIIT, Islamabad

read (fd, buffer, nbytes). System Calls Lecture 415Ahmed Mumtaz Mustehsan, CIIT, Islamabad

System Calls for Process Management Lecture 416Ahmed Mumtaz Mustehsan, CIIT, Islamabad

. System Calls for File Management Lecture 417Ahmed Mumtaz Mustehsan, CIIT, Islamabad

System keeps track of it Regular, special Date of creation Size Access status of file via stat command File mode Lecture 418Ahmed Mumtaz Mustehsan, CIIT, Islamabad

. System Calls for Directory and File Management Lecture 419Ahmed Mumtaz Mustehsan, CIIT, Islamabad

In Unix, each file is identified by an i-number i-number indexes into i-node table Link creates a new directory entry with same i- number Has a new name (note instead of memo) Linking Lecture 420Ahmed Mumtaz Mustehsan, CIIT, Islamabad

mount(“/dev/fd0”, “/mnt”, 0) is system call File comes from drive 0 and is mounted on binary file /mnt. Third parameter tells if it is read or read-write Result is that file on drive zero can be accessed from a directory Saw this example before with CD-same mechanism for memory sticks and portions of hard drives Mount System Call Lecture 421Ahmed Mumtaz Mustehsan, CIIT, Islamabad

Other System Calls Lecture 422Ahmed Mumtaz Mustehsan, CIIT, Islamabad

The Win32 API calls that roughly correspond to the UNIX calls Windows Win32 API Lecture 423Ahmed Mumtaz Mustehsan, CIIT, Islamabad

Monolithic Systems Layered System Microkernel Client Server Model Virtual Machines Exokernel Operating Systems Structure Lecture 424Ahmed Mumtaz Mustehsan, CIIT, Islamabad