Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Where are being used the OS? Windows Mac OS Linux • Widespread • Invisible OS Routers, switches, … OS Basic OS Android OS OS OS OS Internet of Things Raspbian OS OS Operating Systems Introduction This course structure OS Introduction Processes, Threads, Scheduling, Synchronization Memory management I/O systems Interrupts File Systems Operating Systems Protection and Security Distributed Processing Networks Different OS comparison Sources: • Yale university • UC Berkeley • JHU • My experience Assignments, Project Exercises, Assignments, Project (C, C++) WinAPI Windows OS Real Workstation Linux API Linux OS Virtual Machine Student’s should complete programming assignments on “Unix and Windows Processes &Threads programming on C, C++” Required Textbook: • Abraham Silberschatz, Galvin, Gagne “Operating System Concepts”, 9th edition. 2012 • Kay A. Robbins, Steven Robbins, Unix Systems Programming, 2003 Recommended Reference Books: • Herbert Schildt. Windows 95 Programming in C and C++. 1995 • Herbert Schildt. Windows 2000 Programming from the Ground Up. 2000. Handout Content: 1.1. What is an Operating System 1.2. Computer system types and description o 1.2.1. Mainframe Computer Systems 1.2.1.1. Batch Systems 1.2.1.2. Multiprogrammed Systems 1.2.1.3. Time Sharing Systems o 1.2.2. Desktop Systems o 1.2.3. Multiprocessor Systems Tandem, Symmetric, Asymmetric multiprocessor systems o 1.2.4. Distributed Systems 1.2.4.1. Client Server Systems 1.2.4.2. Peer-to-Peer Systems o 1.2.5. Clustered Systems o 1.2.6. Real Time Systems o 1.2.7. Handheld Systems Textbook - Silberschatz, Chapter 1 Operating System Purpose Run user(s’) program(s) 3 main responsibilities To provide an environment for a computer user to execute programs on computer hardware in a convenient and efficient manner (Shells, Windows, Terminals, Executable files concept). To allocate separate resources (memory, processor, disk space, I/O device usage) of the computer as needed to solve the problem given. The allocation process should be as fair and efficient as possible. Control the running programs: supervision of the execution of user programs to prevent errors and improper use of the computer protection of OS and programs from user programs management of the operation and control of I/O devices device drivers, file systems What is an Operating System ? • a program that manages the computer hardware • acts as an intermediary between the user applications and the computer hardware. • provides certain services to programs and to the users of those programs in order to make their tasks possible and easier. User 1 Compiler User 2 Assembler User 3 User n Text editor Database System System and application programs Operating System Computer Hardware Abstract view of the components of a computer system. What is an Operating System ? User Application Programs Trying to use Computing Resources Using ready solutions is possible (is effective) API to OS for User Applications Operating System Device drivers Direct usage is possible (but is not effective) Control API to Hardware Computing Resources are provided by Computer Hardware (CPU, Memory, I/O devices) An application programming interface (API) is a set of functions, procedures, methods or classes that an operating system, library or service provides to support requests made by computer programs. Operating-Systems are improved. The principles remain IoT - The same evolution? • The newest computers repeat the history of old computers starting from the very simple software and growing to full multiprocessor OS. • All OS solutions invented tens of years ago are applicable for newest computers. Early Computer System and OS types. The trends. Mainframe Computer Systems Desktop Computer Systems Operating Systems Batch Systems Multiprogrammed Systems Time Sharing Systems OS improves • •• • • •• Tasks are collected in queues. CPU and runsin the parts of tasks from queue giving equal or Taskstakes are collected queues (pools) similar tasks’ batches appropriate time to each of task in order to serve all tasks from If CPUtask is idle it takes (next previous unfinished) task’s Next from batchanother runs when theorprevious one is finished fully the queue. to be busy all the time some CPU ispart dedicated for one task and is often idle CPU tasks afterwhen equalitorispredefined CPU switches switches between between queue tasks (programs) idle and intervals time usually is of busy alland the usually time. is never idle. • User interaction with the programs is possible Mainframe Computer Systems Batch Systems Batch of Tasks (Jobs) CPU Input Task #1 Input Calculation Output Save Result Task #2 Input Calculation Output Save Result Task #3 Read Calculation Output Save Result Output Read Save Disksidle. Why ? … Disadvantage: In this execution environment, the CPU is often Tapes Because the speeds of the mechanical I/O devices are intrinsically slower than are those of electronic devices. System Evaluation Criteria CPU utilization (maximize – keep the CPU as busy as possible) – the time the CPU is busy during some time period Throughput (maximize) - # of processes that complete their execution per time unit Turnaround time (minimize)– amount of time to execute a particular process Batch System Evaluation Task 1 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. 1 2 2 Task 2 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. I/O time. Print on Printer. 2 1 1 2 Task 3 Sec CPU time. Calculations. I/O time. Output to HDD. CPU time. Calculations. 1 2 1 Overall time for all 3 tasks to finish Through put Task1 Turnaround time Task2 Turnaround time Taks3 Turnaround time Average Turnaround time for all tasks CPU utilization 15 3/15 5 11 15 (15+11+5)/3 =10.3 8/15 ~53% Computer System types and description Mainframe Computer Systems were very huge and expensive. The expensive system requires the most effective usage of expensive resources - especially the processor. That was why the main purpose of the MainFrame OS was to utilize the processor by all means. Thus appear the Multiprogrammed OS. Computer System types and description Mainframe Computer Systems Multiprogrammed Systems Advantage: Multiprogramming increases CPU utilization by organizing jobs so that the CPU CPU always has one to execute. How ? … CPU Scheduling Input Task #1 Read Calculation Output Output Read Task #2 Save Input Jobs in Disadvantage: Multiprogrammed, batched systems provided an environment where the W Calculation memory various system devices) were utilized Disks Outputresources (for example, CPU, memory, peripheral effectively, but it did not provide for user interaction with the Tapes computer system. Task #3 Job Scheduling Job pool Read Wait ontasks Disk resources Problems:Calculation Job and CPU scheduling, Memory management , different W protectionOutput issues should be taken in account to keep the system effective. Memory management Time Resource Protection MultiProgrammed System Evaluation Task 1 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. 1 2 2 Resource Usage Table Multiprogrammed System The resource is dedicated if it’s free Average CPU utilization and ifTurnaround there is a request Overall time for Through all 3 tasks to put Task 2 finish Task1 Task2 Taks3 Turnaround Turnaround Turnaround time for all tasks Sec time Seconds time time CPU HDD Printer 15 5 3/15 CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. I/O time. Print on Printer. 2 1 1 2 Task 3 Sec CPU time. Calculations. I/O time. Output to HDD. CPU time. Calculations. 11 15 (15+11+5)/3 =10.3 1 2 3 4 5 6 7 8 9 10 1 2 1 T1 T2 T2 T3 T1 T1 T2 T3 T1 T1 T2 T3 T3 CPU 8/15 ~53% queue T2,T3 T3 T3 T1 T2 T2 T3 T2 T2 Overall time for all 3 tasks to finish Throug hput Task1 Turnaround time Task2 Turnaround time Task3 Turnaround time Average Turnaround time for all tasks CPU utilization 9 3/9 6 9 8 (6+9+8)/3=7.67 8/9~89% Multitasking (time sharing) Systems The CPU executes multiple jobs by switching among them, but the switches occur Advantage: Users can interact with each program while it is running. How ? … so frequently that the users can interact with each program while it is running. Time Processes in Physical Memory CPU Process #1 Input Calculation Input Output Calculation Output Save Result CPU time sharing Process concurrent execution Input Process #2 Input Calculation Output Save Result Output Process #3 Read Calculation Output Physical Save Result Memory Read Save Disadvantage: Time-sharing operating systems are even more complex Disks systems. (difficult, expensive) than multiprogrammed operating Users Security File system Virtual Problems: Job and CPU scheduling, Memory management, User and Paging Security management, Protection issues should be Memory taken in account to Memory management and protection keep the system effective. Time Sharing System Evaluation Task 1 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. 1 2 2 Task 2 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. I/O time. Print on Printer. 2 1 1 2 Task 3 Sec CPU time. Calculations. I/O time. Output to HDD. CPU time. Calculations. • For external devices if the task takes the resource it keeps the resource until completing the operation with it. Resource Usage Table Seconds CPU 1 2 3 4 5 6 7 8 9 10 1 2 1 T1 T2 T3 T2 T1 T3 T1 T2 HDD Printer CPU queue HDD queue T2,T3 T3 T2 T1 T1 T1 T3 T3 T2 T2 T1 T2 T2 T2 Overall time for all 3 tasks to finish Throug Task1 hput Turnaround time Task2 Turnaround time Task3 Turnaround time Average Turnaround time for all tasks 10 3/10 10 6 (7+10+6)/3 =7.67 8/10 ~80% 7 CPU utilization Evaluation of the systems by Criteria Seconds Task 1 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. 1 2 2 Task 2 Sec CPU time. Calculations. I/O time. Input from the HDD CPU time. Calculations. I/O time. Print on Printer. 2 1 1 2 Task 3 Sec CPU time. Calculations. I/O time. Output to HDD. CPU time. Calculations. Batch Multiprog rammed Time Sharing Seco nds 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 CP U T1 HD D 1 2 3 4 5 6 7 8 9 Print er T1 T1 T1 T1 T2 T2 Seconds T2 1 2 3 4 5 6 7 8 9 10 T2 T2 T2 T3 T3 T3 T3 1 2 1 CPU T1 T2 T2 T3 T1 T1 T2 T3 CPU T1 T2 T3 T2 T1 T3 T1 T2 HDD Printer CPU queue T2,T3 T3 T3 T1 T2 T2 T3 T1 T1 T2 T3 T3 T2 T2 HDD Printer T1 T1 T3 T3 T2 CPU queue T2,T3 T3 T2 T1 HDD queue T2 T1 T2 T2 T2 Overall time for all 3 tasks to finish 15 Throu ghput Task1 Turnaroun d time Task2 Turnaroun d time Task3 Turnaroun d time Average Turnaround time for all tasks CPU utilization 3/15 5 11 15 (15+11+5)/3=10.3 8/15 ~53% 9 3/9 6 9 8 (6+9+8)/3=7.67 8/9~89% 10 3/10 7 10 6 (7+10+6)/3=7.67 8/10~80%