Datorarkitektur och operativsystem. Lecture 6

Pages 49
Views 10

Please download to get full document.

View again

of 49
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Datorarkitektur och operativsystem Lecture 6 1 Pipeline Summary Pipelining i improves performance by increasing i instruction throughput Executes multiple instructions in parallel Each instruction has
Datorarkitektur och operativsystem Lecture 6 1 Pipeline Summary Pipelining i improves performance by increasing i instruction throughput Executes multiple instructions in parallel Each instruction has the same latency Subject to hazards Structure, data, control Instruction set design affects complexity of pipeline implementation (p.335) Chapter 4 The Processor 2 Recap: Hazards Situations that prevent starting the next instruction in the next cycle Structure hazards A required resource is busy Data hazard Need to wait for previous instruction to complete its data read/write Control hazard Deciding on control action depends on previous instruction ti Chapter 4 The Processor 3 Components of a Computer Operating Systems Before proceeding to learn about memory and I/O (Input/Output), let us get introduced to Operating System. Why? Topics to be covered What is an operating system? Peek at the history of operating system Learn the fundamental operating system concepts 6 Operating System (OS) What are the features provided by an OS? 7 Operating System versus Applications Both are programs, so what is the difference? 8 Operating System versus Applications Both are programs, so what is the difference? We need to understand the difference between an end-user and a programmer 9 Operating System vs Applications ISA: Processor: A computer system consists of hardware system programs application programs 10 Operating System (OS) vs System Programs Compilers, editors are not part of the OS even if they are bundled together OS is only that part of the software that runs in kernel/supervisor mode, like the clock interrupt handlers Note: lines may be blurred E.g., in embedded systems. Old embedded systems had no OS. No precise definition for OS it is rather a collection of concepts 11 What is an Operating System? Extended machine: It is an extended machine Hides the messy details which must be performed Presents user with a virtual machine, easier to use 12 What is an Operating System? Resource Manager: It is a resource manager Each program gets time with the resource Each program gets space on the resource 13 Resources: Resource management Processor time, Printer, Memory, Hard Disk Time sharing If one program runs on a processor long enough, schedule another one Printer : schedule them one by one and not one within each other Space sharing Main memory is divided id d among several programs Disks 14 History of Operating Systems We will look only at some major points in history, mostly with a focus on the underlying principles i 15 Batch Processing Early batch system bring cards to IBM1401 IBM1401 reads cards onto tape Put tape on IBM 7094 which does computing put tape on IBM 1401 which h prints output t 16 History of Operating Systems Structure of a typical Fotran Monitor System job (a program or a set of programs) 17 Drawback of Batch Processing CPU bound versus I/O bound CPU-bound scientific calculation programs are OK But I/O wait time can be over 80% in commercial computations meaning time between submitting a job and getting a result can be several hours If a single comma makes a compilation to fail, programmer loses half a day! 18 Timesharing (Multiprogramming) Timesharing - switch CPU among jobs for predefined time interval The CPU can provide interactive service to several users and also work on big batch jobs when it is otherwise idle Most O.S. issues arise from trying to support multiprogramming CPU scheduling, deadlock, protection, memory management, virtual memory CTSS (Compatible Time Sharing System) from MIT 19 UNIX An elegant timesharing system to follow CTTS Became popular in academic world, government agencies and some companies 20 UNIX Ken Thompson and Dennis M. Ritchie Turing award ( Nobel prize for computer science ) ), 1983 For their development of generic operating systems theory and specifically for the implementation of the UNIX operating system Also Ken Thompson developed C at Bell Labs and Go at Google Inc. Dennis M. Ritchie developed C at Bell Labs 21 UNIX Source code was widely available, Various organizations developed their own versions This led to chaos! 22 23 Berkeley Software Distribution From At&T Apple 24 Linux Linus Benedict Torvalds, born 1969, Finland The popularity of the PC led to a desire for a UNIX that ran on it. Many tried, but the most successful was written from scratch in 1991 by Linus Torvalds. In addition to making the source code available, like BSD, he allowed everyone to make changes and submit them for inclusion in his next release. Linux popularized open source development as we know it today, with such software getting hundreds of volunteers to test releases and add new features. 25 DOS IBM, in 1980s, inspired by Apple II, made their own PC They wanted software to run on it and asked Bill Gates small company for recommendations on OS He didn t have one but bought Quick and Dirty Operating System from another small Seattle based company, re-tooled it, and sold MS-DOS (Microsoft Disk Operating System) 26 DOS No protection, no processes, and no virtual memory Targeted for single user 27 GUI From Stanford Research Institute to Xerox Palo Alto Research Lab to Apple Macintosh to Windows Windows from 85 to 95, was GUI on top of DOS 28 Windows 29 Others Apple: ios (Unix based, derived from OS X) Google: Android (Linux based) 30 The Operating System Zoo The 3 classes of computers? from lecture 1 31 The Operating System Zoo Desktop computers OS X, Windows 7, Ubuntu (Linux based) Server computers Unix, Windows Server 2012, Mac OS X Server Embedded computers Android, ios Real-time operating systems like QNX, VxWorks What about Chrome OS? 32 Compared to Desktop OS, server OS must provide Tight system security with advanced memory protection Manage network resources 33 Embedded system OS must Run on restricted resources such as power, energy, memory, Might have real-time deadlines But sometimes lines are blurred between the server, desktop and embedded 34 What does the OS do? / Operating System Concepts Process management File system Security (Process/Memory protection) Memory management Chapter 5 of textbook Input /Output Chapter 6 of textbook 35 Process Management A process is a program in execution In a timesharing or multi-tasking operating systems, several processes are interleaved an illusion of parallelism A scheduler makes the decision which process must be assigned to the processor and which process must be waiting 36 Execution States of a Process In a multi-tasking scenario, a process is sometimes running g( (because another process is running), but is ready to run is interrupted by the Operating System scheduler while it is running Thus, each process has a state, ie i.e., information that tells us the status of the process 37 The 5 State Process Model New Terminated admit create switch: schedule new job exit Ready Running switch: preempt Blocked 38 Process States New: new process created, may still be under initialization, not yet ready Ready: process is waiting to run Running: process being executed on CPU (makes progress on its timeline) Blocked: process waiting (sleeping) for event cannot execute until event is available Terminated: process is finished, may require OS cleanup 39 A data structure called Process Control Block contains the information related to state and other necessary data for execution There are several scheduling policies and they influence the performance 40 File system management How keep track on all bits? Typically, you cannot address an individual bit (overhead becomes too large). Hence, data is organized into files and directories by the operating system Examples: File Allocation Table (FAT), New Technology File System (NTFS) Operating system provides the services to open files, close files, and other operations making life easier for the programmers 41 Security management OS is responsible for managing system security UNIX provides protection codes (9 bits) for each file The administrator can specify permissions for owner, the owner s group, and everyone else The permission can be related to read, write or execute 42 System Call System calls provide the interface between the OS and the user programs A processor can execute a single instruction at a time 43 Steps in Making a System Call If an instruction, in a program, makes a system call like read/write to files or create a new process, control is transferred to the OS OS executes the system call based on the parameters received from the user program and returns control to instruction following the system call 44 Some System Calls For Process Management 45 Some System Calls For File Management 46 Some System Calls For Directory Management 47 Some System Calls For Miscellaneous Tasks 48 References for Operating Systems Parts of today s lecture taken from Chapter 1 of Modern Operating Systems by Andrew S. Tanenbaum This book is not included in compulsory reading for the exam Slides from this lecture are sufficient i for exam 49 49
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!