CS105 INTRODUCTION TO COMPUTER CONCEPTS OPERATING SYSTEMS LAYER Instructor: Cuong (Charlie) Pham.

Slides:



Advertisements
Similar presentations
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
Advertisements

Operating System CS105. Objectives Role of an operating system Manages resources – Memory – CPU – Secondary storage – I/O devices Memory CPU Hard Disk.
Chapter 10 Operating Systems.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Chapter 10: File-System Interface
Chapter 11 File Systems and Directories Nell Dale John Lewis.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 3: CPU Scheduling
File System CS105. File Systems A method of storing and organizing computer files and their data Usually reside on secondary storage devices – Hard disks.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
11/7/06 1 Hofstra University - CSC005 Chapter 11 File Systems and Directories.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Chapter 10 Operating Systems.
Chapter 11 File Systems and Directories Chapter Goals Describe the purpose of files, file systems, and directories Distinguish between text and.
Computer Systems Week 10: File Organisation Alma Whitfield.
Chapter 11 File Systems and Directories. 2 Chapter Goals Describe the purpose of files, file systems, and directories Distinguish between text and binary.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Chapter 10 Operating Systems Nell Dale • John Lewis.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CPS120: Introduction to Computer Science Operating Systems Nell Dale John Lewis.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
Chapter 10 Operating Systems.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
Chapter 10: File-System Interface 10.1 Silberschatz, Galvin and Gagne ©2011 Operating System Concepts – 8 th Edition 2014.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
3.1 : Resource Management Part2 :Processor Management.
10-1 Software Categories Application software Software written to address specific needs—to solve problems in the real world Word processing programs,
CPS120: Introduction to Computer Science File Systems and Directories Nell Dale John Lewis.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Chapter 11 File Systems and Directories. 2 File Systems (Chapter 11.1) File: 1. A named collection of related data. 2.smallest amount of information that.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally FILE SYSTEM.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
W4118 Operating Systems Instructor: Junfeng Yang.
SVBIT SUBJECT:- Operating System TOPICS:- File Management
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
File-System Management
Scheduling (Priority Based)
CPU Scheduling.
Process management Information maintained by OS for process management
Chapter 6: CPU Scheduling
Introduction What is an operating system bootstrap
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Operating System Concepts
Chapter 10 Operating Systems.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Lecture 4: File-System Interface
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

CS105 INTRODUCTION TO COMPUTER CONCEPTS OPERATING SYSTEMS LAYER Instructor: Cuong (Charlie) Pham

Outline  Operating Systems  Timelines  Statistics  Roles Resource Management CPU Scheduling  File System CS105 Section 1 - Lecture 6 2 3/1/2012

CS105 Section 1 - Lecture 6 3

3/1/2012 CS105 Section 1 - Lecture 6 4 _Nix

Mac OS 3/1/2012 CS105 Section 1 - Lecture 6 5

OS Market Share 3/1/2012 CS105 Section 1 - Lecture 6 6

What is an OS?  Application software: Software written to address specific needs- to solve problems in the real world  System software: Software that manages a computer system and interact with hardware  OS: System software that manages computer resources and provides an interface for system interaction 3/1/ CS105 Section 1 - Lecture 6 Human Users Application Software Operating System Other system software Hardware

Resource Management  Recall: Executing program resides in main memory  Processed in the CPU by fetch- execute cycle  In the real world, we have multiple programs running  Multiprogramming: technique for keeping multiple programs in main memory competing for CPU  Memory management: Keeping track of programs in memory and their addresses (location in memory)  Each active program (in execution) in memory is called a process  Keeping careful track of processes and their different states is known as process management  Keeping track of processes getting CPU time is CPU scheduling  OS itself is a software that gets CPU time as well 3/1/2012 CS105 Section 1 - Lecture 6 8

CPU Scheduling How do processes get CPU time? How does the OS make sure that the CPU is ‘shared nicely’ by the processes?  CPU scheduling is the act of determining which process in the ready state should be moved to the running state  Non preemptive scheduling: Decisions made by the CPU when the current process in the running state gives up the CPU voluntarily  Preemptive scheduling: Decisions made when the OS favors another process and switches the current process for another one  Turnaround time : CPU scheduling metric that measures the elapsed time between a process’s arrival and its completion  Expect average time to be small! 3/1/2012 CS105 Section 1 - Lecture 6 9

First come first served (FCFS)  Processes are moved to the CPU in the order they arrive  Gantt chart: a bar chart used to display a schedule ProcessTime/ms P1P1 24 P2P2 3 P3P3 3 P1P1 P2P2 P3P Average turnaround time = ( )/3 = 27 ms 3/1/2012 CS105 Section 1 - Lecture 6 10

Shortest job first (SJF)  Processes with the shortest service time are processed first ProcessTime/ms P1P1 24 P2P2 3 P3P3 3 P2P2 P3P3 P1P1 030 Average turnaround time = (3+6+30)/3 = 13 ms 36 3/1/2012 CS105 Section 1 - Lecture 6 11

Round Robin (RR)  Processing time is distributed equitably among all ready processes.  Time slice: The amount of time given to each process. The CPU will give up the process for another one once the time is up. ProcessTime/ms P1P1 24 P2P2 3 P3P3 3 P1P1 P2P2 P3P3 P1P1 P1P1 P1P1 P1P1 P1P1 030 Average turnaround time = ( )/3 = ms 47 Time slice is 4 ms /1/2012 CS105 Section 1 - Lecture 6 12

Performance characteristics Which scheduling algorithm is better?  Hard to determine based on this example!  Each algorithm is optimal for specific set of processes  Round Robin  Good average turnaround time  Interactive or timesharing systems  Most widely used and fair  Shortest job first  Best average turnaround time  Comes with overhead since CPU service time needs to be determined and processes sorted accordingly AlgorithmAverage Turnaround time/ms FCFS27 SJF13 RR /1/2012 CS105 Section 1 - Lecture 6 13

File Systems  A method of storing and organizing computer files and their data  Usually reside on secondary storage devices  Hard disks  File: A named collection of related information stored in a secondary storage device  File System: is the logical view that an OS provides so that users can manage data as a collection of files  Files can be grouped into directories 3/1/2012 CS105 Section 1 - Lecture 6 14

File Attributes  Name: The symbolic file name is the only information kept in human-readable form  Type: This is needed for the OS in order to decode/process data in the file  Different systems support different types such as.txt,.doc,.jpg,.bmp  Each file has its own unique structure  Location: Address of the device and the location on that device  Size: Number of bytes, words  Protection: Access-control information on who can read, write or execute  Time, date, user-identification  Creation, last modification, last use  Useful for protection, security and usage monitoring 3/1/2012 CS105 Section 1 - Lecture 6 15

File Operations Operating system must do some basic file operations:  Create a file : Allocate space, record name and location  Writing a file: Data entry  Reading a file  Deleting a file: Release file space  Truncate a file: Erase user content data in a file Other operations include:  Appending new information to a file  Renaming an existing file  Copying an existing file  Opening/Closing an existing file 3/1/2012 CS105 Section 1 - Lecture 6 16

File Access File pointer: Location in a file where the next read/write operation takes place – Can be use controlled Sequential file accessDirect file access Beginning End Beginning End Current file pointer RewindRead or write File Current file pointer Jump to any logical record 3/1/2012 CS105 Section 1 - Lecture 6 17

File Protection  Information in a computer system  Reliability or guarding against physical damage, hardware problems  Protection  Ensure reliability by backing up data  Depends on the user, once a day  Protection  Single user system – storage and locking in dvds  Multiple use system – things become tricky!  Each user can have various levels of access to their own files and other user’s files  Controlled access ReadWrite/DeleteExecute OwnerYes No GroupYesNo WorldNo 3/1/2012 CS105 Section 1 - Lecture 6 18

Directories  Directory: Named collection of files  Why do we need directories:  Organizational purposes for the user  Directory tree: A structure showing the nested directory organization of the file system  Root directory: The directory at the topmost level in which all others are contained  Working directory: The currently active subdirectory  Cannot have two files with the same name under one subdirectory/folder 3/1/2012 CS105 Section 1 - Lecture 6 19

Directory Trees Notes.doc Powerpoint.exe WinWord.exe C:\ WINDOW S My DocumentsPrograms directions.txt landscape.jpg Downloads landscape.jpg Terminator2.mov Letters cancelMag.doc Applications calState.doc umass.doc CS150 homework.doc Calc.exe Drivers E55IC.ICM ATNS2XX.DL System 3dMaze.scr adobep4.hlp QTImage.qtx MS Office WinZip WinZip32.exe whatsnew.txt Root Sub Directory 3/1/2012 CS105 Section 1 - Lecture 6 20

Path names  To use a particular file, you have to indicate their path:  Mouse clicks – graphical interface of the OS  Text designation of the location of the file on disk which called a path  Absolute path: A path that begins at the root and lists all successive directories  Example: C:\My Documents\Downloads\Terminator2.mov  Relative path: A path that begins in the current working directory  Example: Current working directory: C:\My Documents\Letters Access umass.doc : Applications\umass.doc  Working our way back up: (..) Parent directory (.) current directory  Example:..\landscape.jpg ..\..\Programs\WinZip\whatsnew.txt 3/1/2012 CS105 Section 1 - Lecture 6 21