Chapter 2 - Part2 Operating-System Services PDF

Summary

This document is lecture notes from a course on Operating System Concepts. It covers information on Operating-System Services. The document includes topics such as Course Plan, Outlines, Why Applications are Operating System Specific, Design and Implementation, and Building and Booting an Operating System.

Full Transcript

Chapter 2 - Part2 Operating-System Services Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018 1.Arrive on time, every time (Max delay is 15 minutes then the door...

Chapter 2 - Part2 Operating-System Services Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018 1.Arrive on time, every time (Max delay is 15 minutes then the door will be closed) 2.Mobile Phones should be silent 3.Speak up, contribute, learn 4.Preparation: “Come ready, be proactive” 5.Deadlines: “Timely submissions, NO exceptions“ 6.Attendance will be recorded Operating System Concepts – 10th Edition 2.2 Silberschatz, Galvin and Gagne ©2018 Course Plan Lecture # Content Orientation Lecture 1 Chapter 1: Introduction Lecture 2 Chapter 2: Operating- Lecture 3 System Services Lecture 4 Chapter 3: Processes Chapter 4: Threads & Lecture 5 Concurrency Lecture 6 Lecture 7 Chapter 5: CPU Scheduling Chapter 9: Memory Lecture 8 Management Lecture 9 Chapter 11: Mass-Storage Lecture 10 Systems Operating System Concepts – 10th Edition 2.3 Silberschatz, Galvin and Gagne ©2018 Outlines ▪ Operating System Services ▪ User and Operating System-Interface ▪ System Calls ▪ System Services ▪ Linkers and Loaders ▪ Why Applications are Operating System Specific ▪ Design and Implementation ▪ Operating System Structure ▪ Building and Booting an Operating System Operating System Concepts – 10th Edition 2.4 Silberschatz, Galvin and Gagne ©2018 Why Applications are Operating System Specific ▪ Apps compiled on one system usually not executable on other operating systems ▪ Each operating system provides its own unique system calls Own file formats, etc. ▪ Apps can be multi-operating system Written in interpreted language like Python, Ruby, and interpreter available on multiple operating systems App written in language that includes a VM containing the running app (like Java) Use standard language (like C), compile separately on each operating system to run on each Operating System Concepts – 10th Edition 2.5 Silberschatz, Galvin and Gagne ©2018 Design and Implementation ▪ Design and Implementation of OS is not “solvable”, but some approaches have proven successful ▪ Internal structure of different Operating Systems can vary widely ▪ Start the design by defining goals and specifications ▪ Affected by choice of hardware, type of system ▪ User goals and System goals User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient ▪ Specifying and designing an OS is highly creative task of software engineering Operating System Concepts – 10th Edition 2.6 Silberschatz, Galvin and Gagne ©2018 Policy and Mechanism ▪ Policy: What needs to be done? Example: Interrupt after every 100 seconds ▪ Mechanism: How to do something? Example: timer ▪ Important principle: separate policy from mechanism ▪ The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later. Example: change 100 to 200 Operating System Concepts – 10th Edition 2.7 Silberschatz, Galvin and Gagne ©2018 Implementation ▪ Much variation Early OSes in assembly language Then system programming languages like Algol, PL/1 Now C, C++ ▪ Actually usually a mix of languages Lowest levels in assembly Main body in C Systems programs in C, C++, scripting languages like PERL, Python, shell scripts ▪ More high-level language easier to port to other hardware But slower ▪ Emulation can allow an OS to run on non-native hardware Operating System Concepts – 10th Edition 2.8 Silberschatz, Galvin and Gagne ©2018 Attendance https://forms.office.com/r/5vAT1nvysR Operating System Concepts – 10th Edition 2.9 Silberschatz, Galvin and Gagne ©2018 https://forms.office.com/r/KEnm2SQQGC Operating System Concepts – 10th Edition 2.10 Silberschatz, Galvin and Gagne ©2018 Operating System Structure ▪ Operating System Structure Types Simple Structure Monolithic Structure Layered Approach Structure Micro-Kernel Structure Modular Structure Operating System Concepts – 10th Edition 2.11 Silberschatz, Galvin and Gagne ©2018 Simple Structure – MS-DOS Operating System Concepts – 10th Edition 2.12 Silberschatz, Galvin and Gagne ©2018 Simple Structure ▪ Advantages of Simple Structure: Because there are only few interfaces and levels, it is simple to develop. Because there are fewer layers between the hardware and the applications, it offers superior performance (Using Procedure Call) ▪ Disadvantages of Simple Structure: The entire operating system breaks if just one user program malfunctions. Since the layers are interconnected, and in communication with one another, there is no abstraction or data hiding. Operating System Concepts – 10th Edition 2.13 Silberschatz, Galvin and Gagne ©2018 Monolithic Structure – Original UNIX ▪ UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. ▪ The UNIX OS consists of two separable parts Systems programs The kernel  Consists of everything below the system-call interface and above the physical hardware  Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level Operating System Concepts – 10th Edition 2.14 Silberschatz, Galvin and Gagne ©2018 Traditional UNIX System Structure Beyond simple but not fully layered Operating System Concepts – 10th Edition 2.15 Silberschatz, Galvin and Gagne ©2018 Monolithic Structure ▪ Advantages of Monolithic Structure: Because layering is unnecessary and the kernel alone is responsible for managing all operations, it is easy to design and execute. Due to the fact that functions like memory management, file management, process scheduling, etc., are implemented in the same address area, the monolithic kernel runs rather quickly when compared to other systems. Utilizing the same address speeds up and reduces the time required for address allocation for new processes. ▪ Disadvantages of Monolithic Structure: The monolithic kernel's services are interconnected in address space and have an impact on one another, so if any of them malfunctions, the entire system does as well. It is not adaptable. Therefore, launching a new service is difficult. Operating System Concepts – 10th Edition 2.16 Silberschatz, Galvin and Gagne ©2018 Layered Approach ▪ The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. ▪ With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers Operating System Concepts – 10th Edition 2.17 Silberschatz, Galvin and Gagne ©2018 Layered Approach ▪ Advantages of Layered Structure: Work duties are separated since each layer has its own functionality, and there is some amount of abstraction. Debugging is simpler because the lower layers are examined first, followed by the top layers. ▪ Disadvantages of Layered Structure: Performance is compromised in layered structures due to layering. Construction of the layers requires careful design because upper layers only make use of lower layers' capabilities. Operating System Concepts – 10th Edition 2.18 Silberschatz, Galvin and Gagne ©2018 Microkernel System Structure Operating System Concepts – 10th Edition 2.19 Silberschatz, Galvin and Gagne ©2018 Microkernels ▪ Moves as much from the kernel into user space ▪ Mach is an example of microkernel Mac OS X kernel (Darwin) partly based on Mach ▪ Communication takes place between user modules using message passing ▪ Microkernel example is QNX, a real-time OS for embedded systems Operating System Concepts – 10th Edition 2.20 Silberschatz, Galvin and Gagne ©2018 Microkernel System Structure ▪ Advantages of Micro-Kernel Structure: It enables portability of the operating system across platforms. Due to the isolation of each Micro-Kernel, it is reliable and secure. The reduced size of Micro-Kernels allows for successful testing. The remaining operating system remains unaffected and keeps running properly even if a component or Micro-Kernel fails. ▪ Disadvantages of Micro-Kernel Structure: The performance of the system is decreased by increased inter- module communication. The construction of a system is complicated. Operating System Concepts – 10th Edition 2.21 Silberschatz, Galvin and Gagne ©2018 Modular Structure Solaris loadable modules Operating System Concepts – 10th Edition 2.22 Silberschatz, Galvin and Gagne ©2018 Modular Structure ▪ Many modern operating systems implement Loadable Kernel Modules (LKMs) Uses object-oriented approach Each core component is separate Each talks to the others over known interfaces Each is loadable as needed within the kernel ▪ Overall, similar to layers but with more flexible Linux, Solaris, etc. Operating System Concepts – 10th Edition 2.23 Silberschatz, Galvin and Gagne ©2018 Hybrid Systems ▪ Most modern operating systems are not one pure model Hybrid combines multiple approaches to address performance, security, usability needs Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality Windows mostly monolithic, plus microkernel for different subsystem personalities Operating System Concepts – 10th Edition 2.24 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts – 10th Edition 2.25 Silberschatz, Galvin and Gagne ©2018 Building and Booting an Operating System ▪ Operating systems generally designed to run on a class of systems with variety of peripherals ▪ Commonly, operating system already installed on purchased computer But can build and install some other operating systems If generating an operating system from scratch  Write the operating system source code  Configure the operating system for the system on which it will run  Compile the operating system  Install the operating system  Boot the computer and its new operating system Operating System Concepts – 10th Edition 2.26 Silberschatz, Galvin and Gagne ©2018 Building and Booting Linux ▪ Download Linux source code (http://www.kernel.org) ▪ Configure kernel via “make menuconfig” ▪ Compile the kernel using “make” Produces vmlinuz, the kernel image Compile kernel modules via “make modules” Install kernel modules into vmlinuz via “make modules_install” Install new kernel on the system via “make install” Operating System Concepts – 10th Edition 2.27 Silberschatz, Galvin and Gagne ©2018 End of Chapter 2 Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018

Use Quizgecko on...
Browser
Browser