Principles Of Operating Systems Lecture Notes PDF
Document Details
Uploaded by Deleted User
National University - Manila
Tags
Related
Summary
These lecture notes cover the fundamental concepts of operating systems, including their objectives, functions, and various components and elements, particularly hardware and software in computer systems. The outline includes detailed topics on process management, memory management, and I/O management.
Full Transcript
**Course Title: PRINCIPLES OF OPERATING SYSTEMS** **Course Description:** The course examines process synchronization; input/output, buffering, file systems; processor and memory management; virtual memory; job scheduling; resource allocation; systems modeling; performance measurement and evaluati...
**Course Title: PRINCIPLES OF OPERATING SYSTEMS** **Course Description:** The course examines process synchronization; input/output, buffering, file systems; processor and memory management; virtual memory; job scheduling; resource allocation; systems modeling; performance measurement and evaluation. **Course Objectives:** At the end of the term, the students should be able to: 1. Define an operating system and describe its general functions; 2. Determine the types of operating systems; 3. Understand the different types of memory partitioning techniques; 4. Describe the functions and the types of processor scheduling; 5. Discuss the functions of device and information management. **Course Outline** 1\. Basic Operating System 1.1 Definition of an OS 1.1.1 Function of an OS 1.1.2 Measure of Effectiveness 1.1.3 Types of OS 1.1.3.1 Size of the Underlying Hardware 1.1.3.2 Configuration 1.1.3.3 Level of Resource Sharing 1.1.3.4 Type of Interaction Permitted 1.2 Historical Perspective 1.2.1 Evolution of OS 1.2.1.1 Single Job Stream 1.2.1.2 Multiprogramming 1.2.1.3Time Sharing 1.2.1.4 Virtual Memory 1.2.1.5 Personal Computer OS 1.2.1.6 Networks 1.2.1.7 Client Server 1.2.2 Early System 1.2.3 Set Up Time / Automatic JS 1.2.4 Performance of CPU Utilization QUIZ NO. 1 1.3 Structure of OS 1.3.1 Monolithic Structure 1.3.2 The Kernel Approach 1.3.3 Object-Oriented Structure 1.3.4 Client Server Model 1.4 Hardware Types 1.4.1 Limitation of HW Resources 1.4.2 The Front End: Input / Output 1.4.3 Interfaces, Control Units and Channels QUIZ NO. 2 MIDTERM EXAMINATION 2\. Software 2.1 Software Types 2.1.1 SW and Data: Logical vs. Physical 2.1.2 The Source Data 2.1.3 Data Management 2.1.4 File Organization 2.1.4.1 Sequential File 2.1.4.2 Direct Access File 2.1.3.4 Indexed-Sequential File 2.1.5 Categories of SW 2.1.5.1 Application SW Package 2.1.5.2 4th GL\'s 2.1.5.3 Query Language 2.1.5.4 Report Generation 2.1.5.5 Application Generation 2.1.5.6 Decision Support System QUIZ NO. 3 3\. Storage Management 3.1 Storage Hierarchy 3.2 Storage Management Strategies 3.3 Simple Memory Management 3.4 Strategies 3.4 Virtual Memory 3.4.1 Paging 3.4.2 Segmentation 3.4.3 Page Replacement 3.4.3.1 FIFO Replacement 3.4.3.2 LRU Page Replacement QUIZ NO. 4 4\. Processor Management 4.1 Process State and State Transition 4.2 The OS Kernel 4.3 Basic Operation on Process and Resources 4.3.1 Process Control 4.3.2 Resource Primitive 4.4 Interprocess Communication 4.4.1 Mutual Exclusion w/ Busy Waiting 4.4.2 Sleep and Wake-up 4.4.3 Remaphores 4.4.4 Event Counter 4.4.5 Message Passing 4.5 Scheduling Methods 4.5.1 Time Based Scheduling Algorithm 4.5.1.1 FIFO Scheduling 4.5.1.2 Last In / Last Out 4.5.1.3 Shortest Job Next 4.5.1.4 SRTF Scheduling 4.5.1.5 Multi-Level Feedback 5\. Device Management 5.1 Device Characteristic, Hardware Consideration 5.2 Principles of I/O Software 5.2.1 Goals w/ the I/O SW 5.2.2 Interrupt Handlers 5.2.3 Device Handlers 5.2.4 Device Independent I/O SW 5.2.5 User Space I/O SW 5.3 I/O Traffic Controller, I/O Schedules, I/O Handlers 5.4 Deadlocks 5.4.1 Resources 5.4.2 Deadlock Modeling 5.4.3 The Ostrich Algorithm 5.4.4 Detection of Recovery 5.4.5 Deadlock Prevention 5.4.6 Deadlock Avoidance QUIZ NO. 5 6\. The File System and its Function 6.1 A Hierarchical Model of the File 6.2 and I/O System 6.3 File System Design 6.3.1 Disk Space Management 6.3.2 File Storage 6.3.3 Directory Structure 6.3.4 Shared Files 6.3.5 File Systems Reliability 6.4 Physical Organization Methods 6.4.1 Logical File Organization 6.4.2 Physical File Organization 6.4.3 Management of Auxiliary Storage Space 6.5 File Servers 7\. OS Facilities 7.1 Processor 7.2 Memory Management 7.3 File Systems 7.4 Input / Output 7.5 Other Facilities 7.5.1 User Activity 7.5.2 Logging 7.6 User Interface 7.7 Utility SW QUIZ NO. 6 FINAL EXAMINATION **What is Operating System?** ***Operating System*** it is a program that acts as an intermediary between the user of computer and the computer hardware. ***Operating System*** is a set of software routines that sits between the application program and hardware. \**[routines]*: perform key support functions such as 1. communicating with peripheral devices 2. accepting and carrying out user commands a. load a program b. copy a file c. create a directory ***Operating System*** acts like an interface between the user and computer hardware. FOUR COMPONENTS OF COMPUTER SYSTEM ================================== 1. *Hardware* -- provides the basic computing resources (Processor, Memory, I/O Devices) 2. *Software -- set of instructions used to operate computers and perform specific tasks.\ Application Program* -- define the ways in which these resources are used to solve the computing problems of the users. (compilers, database system, games & business prog.) Various application programs for various users. 3. *Peopleware (User)* -- the one who solve problems in many different application programs. (people and machines) 4\. Dataware -- it governs the actual and proper usage of components of computer system (ex. Terms and Conditions and EULA) PURPOSE OF OPERATING SYSTEM =========================== To provide environment in which a user can execute program. GOAL OF OPERATING SYSTEM ======================== 1. To make computer system convenient to use 2. To use the computer hardware efficient to use. FUNCTIONS OF OPERATING SYSTEM ============================= 1. As a Service Provider 2. As a Resource Manager **O.S,as a Service Provider** ----------------------------- - the creation and deletion of both user and system processes - the suspension and resumption of processes - The provision of mechanisms for processes synchronization - The provision of mechanisms for process communication - The provision of mechanisms for deadlock handling a. Manipulation of Data b. Execution of Data c. Recovery & Archiving \*operating system needs constantly be aware of possible errors. *[O.S. as a Resource Manager]* 1\. Keeps track the status of its resources 2\. Enforce a schedule among programs requesting resources 3\. Allocate & De-allocate resources HISTORY OF OPERATING SYSTEM =========================== **0^th^ Generation** -- No O.S at all, machines is controlled hard-wired (Punch-card). - No existence of O.S only encoding \***Encoding** -- programming techniques that binary bit is presented through voltages. **1^st^ Generation** -- During 1950's, simple operating system were developed that allowed programs to be submitted in sequence and stored. \- *Batch Processing / Batch Oriented Processing.* **2^nd^ Generation** -- During 1960's Multi-using was developed \***Multi-using:** 1. To store several programs in memory simultaneously 2. Share computer resources **3^rd^ Generation** -- Mid 1960, *Multiprocessing, Multiprogramming, Time-Sharing,* *Real-time processing & Virtual memory* were introduced. \***Virtual Memory** -- the ability of OS to expand the memory of computer sys. **4^th^ Generation** -- the period of *Networking System & Distributed O.S* that provide networking & communication function. **5^th^ Generation** -- *Multimode system* (1980's) - Provide higher resolution - Speech synthesizers & Recognition - Computer Vision - Allow intelligent machines & Open System \***Multimode System** -- connotes multi-processing & multiprogramming \***Open System** 1. Portability -- a system that can be applied in any kind of 2. Availability -- source-code licenses in short notice 3. Scalability -- the code can be transferable and resizable 4. Interoperability -- a system that allow sharing of files and **TYPES OF OPERATING SYSTEMS** 1. Single Programmed OS / Single Job Stream - allows execution of program one at a time. - One program active 2. Batched OS - allowed automatic job sequencing by a resident operating - the common input devices were card readers & tape drivers. - The common output devices were line printers & card punches. - Console: a terminal that consists of switches 3. Multi-programmed OS - jobs are kept in memory at one time - having several programs running concurrently in the computer. 4. Time-sharing/Multi-tasking/Multi-using - logical extension of multi-programming. - Time shared OS: allows many users to share the computer simultaneously. Uses CPU scheduling. - Having several users running in the computer system. 5. Real-time OS - Type of OS that is designed for a particular task through the use of sensors. - Sensors brings data to the computer. - Real system is defined, fixed and time constraint. 1. Hard real-time system -- guarantees that critical task is completed on 2. Soft real-time system -- a critical real-time task gets priority over other ### APPLICATION OF REAL-TIME SYSTEM 1. 2. 3. 4. 5. 6. 7. 8. 6. Distributed OS / Network OS - Network Operating System is an OS that provide features such as file sharing (WIN NT) across the network, that includes a communication scheme that allows different processes on different computers to exchange messages. - Distributed OS is a less autonomous environment. CRITERIA TO MEASURE THE EFFECTIVENESS OF THE COMP.SYS ===================================================== 1\. Throughput - the amount of work going on a computer system completed per unit time. 2\. Turnaround Time -- is the sum of the periods spent waiting to get into memory waiting in the ready queue, executing on the CPU,and doing I/O. 3\. Waiting Time - is the sum of the periods spent waiting in the ready queue. 4\. Response Time - the amount of time it takes to start responding, but not the the time that it takes to output that response. 5\. Availability - the measures of system accessibility 6\. Cost 7. Ease of Use 8. Reliability 9. Security **CPU UTILIZATION** It determines how **efficient** and **reliable** a computer system. To determine the efficiency of the [CPU], it must be equal to [50%], the [card reader] must be equal to [25%] and [line printer] must be equal to [25%]. If the result of the computation will not meet the required percentage then, it is less efficient and reliable. ***FORMULAS:*** **CR Time** = [1 card] where: CR speed CR Speed = [\# of cards] Time **LP Time** = [1 line] LP Speed = [\# of lines] LP speed Time **CPU Time** = number of instruction / CPU speed **TOTAL Time** = CPU Time + CR Time + LP Time *To get the efficiency used the following formula*: **% Efficiency of Card Reader** = (CR Time / Total Time) \* 100 **% Efficiency of Line Printer** = (LP Time / Total Time) \* 100 **% Efficiency of CPU** = (CPU Time / Total Time) \* 100 **100 %** Example: Given the following characteristics: 1\. % Eff. Of CR = 48.78% TT = 0.41 sec CPU Time = 10 ms No. of instructions = 10,000 **Required:** a\. CPU speed in µs c. %Eff.of LP e. %Eff. Of CR b\. CR Time d. % Eff. Of CPU 2\. % Eff. Of CPU = 19.85% TT =.001525 hr LP Speed = 30 lines / min **Required:** a. LP Time d. %Eff. Of LP b. CPU Time e. %Eff.of CR c. CR Time **SOLUTIONS TO PROBLEM GIVEN ABOVE:** 1\. A. CPU speed = [no. of instruction] CPU Time CPU speed = [10,000 instruction] 10 ms = [10,000 instruction] 10ms \* [1 x 10^-3^] 1 ms = [10,000 instruction] 10,000 seconds = 1 instruction/sec (convert in µs) = 1 µs B. CR Time = [Total Time \* %Eff.of CR] 100 = [.41 \* 48.78] 100 CR Time =.199 sec or.2sec C. %Eff. Of LP =.2sec /.41sec \* 100 D. %Eff. Of CPU = 100% - 48.78% + 48.78% = 100% - 97.56% = 2.54% E. %Eff. Of TT = 100% 2. A. LP speed = 30 [lines] \* [1 min] Min 60 sec = 1 /.5 = 2 sec LP Time = 2 seconds B. CPU Time = ([19.85 \* 5.48]) 100 = 1.09 sec \%Eff. Of CPU =(1.09 sec / 5.48 sec) \* 100 = 19.85% C. CR Time = ([5.48 \* 43.62]) 100 = 2.39 sec = 2.4 sec D. %Eff.of LP = (2 sec / [ ] 5.48) \* 100 = 36.49% E. %Eff. Of CPU = (1.09 sec / 5.48 ) 8 100 = 19.89% \%Eff. Of TT = 19.89% + 36.49% + %CRT \%Eff. Of CR = 100 -- 19.89 -- 36.39 = 43.62% **Exercise:** **Assuming that the computer system has the following characteristics:** **TT = 4 sec** **CR speed = 100 c/ min** **If CPU takes 1200ms to assemble 1500 instructions, determine the following.** a. **% Efficiency of CPU** b. **% Efficiency of CR** #### **HARDWARE-** any physical device that are used to build/run a computer for you to able to solve a computing problems. TYPES OF HARDWARE 1. Input 2. Output ##### SOFTWARE - is a general form for the various kinds of programs used to operate computers and related devices. #### **TYPES OF SOFTWARE** **Applications software-** performs all the specialized tasks that computers are used for: payroll, video editing, gif animator, computer aided design, airline reservations, email, chat. **General-purpose packages** are the most commonly used software packages. These include word processing, spreadsheet, desk-top-publishing, database and graphics. They are called general purpose because they can be customized in a variety of ways to perform extremely specialized tasks. A database can be used to create an application like a personnel or stock control system. **Systems software** controls the operations of a computer and the other types of software that it runs. Examples of systems software include the operating system, device drivers, programming languages, compilers, assemblers and translators. **Utility software** carries out all the day-to-day tasks in maintaining a computer system and its data files. Some common utilities are screensaver, virus checker, and system tools like disk defragmenter. Certain utility programs are usually bundled along with the operating system and are thought of as a type of systems software. Windows comes with a variety of screen savers, and various utilities including DriveSpace that displays the percentage of drive space used and unused. **File -- a uniform logical of data/information which are mapped by a file system in your storage devices.** **File System -- is one of the most visible service and feature of operating system.** **File Organization Techniques** ================================ 1. Sequential = records in this kind of technique may only be retrieved sequentially. 2. Direct/Relative = random access of record/file by means of key field 3. 4. Transaction Text