Operating System Structures

Summary

This document is a study guide for a course on operating systems, focusing on the structures and components of operating systems. It covers topics such as kernel, process execution, interrupts, memory management, multitasking, networking, and security. It provides practical context and explanations for learning.

Full Transcript

**Unit 2 -- Operating System Structures** Operating system can be implemented with the help of various structures. The structure of the OS depends mainly on how the various common components of the operating system are interconnected and melded into the kernel. In addition, OS is a construct that a...

**Unit 2 -- Operating System Structures** Operating system can be implemented with the help of various structures. The structure of the OS depends mainly on how the various common components of the operating system are interconnected and melded into the kernel. In addition, OS is a construct that allows the user application programs to interact with the system hardware. Since the operating system is such a complex structure, it should be created with utmost care so it can be used and modified easily. An easy way to do this is to create the operating system in parts. Each of these parts should be well defined with clear inputs, outputs and functions. At the end of this, students are expected to: 1. Define the concepts of Operating System 2. Describe the Components of Computer System 3. Discuss the importance of the evolution of Operating System and Computer Environments **LEARNING CONTENTS (Operating System Components)** The components of an operating system play a key role to make a variety of computer system parts work together. Figure 2. Operating System Components ***Kernel*** The kernel in the OS provides the basic level of control on all the computer peripherals. In the operating system, the kernel is an essential component that loads firstly and remains within the main memory. So that memory accessibility can be managed for the programs within the RAM, it creates the programs to get access from the hardware resources. It resets the operating states of the CPU for the best operation at all times. #### **Process Execution** The OS gives an interface between the hardware as well as an application program so that the program can connect through the hardware device by simply following procedures & principles configured into the OS. The program execution mainly includes a process created through an OS kernel that uses memory space as well as different types of other resources. #### **Interrupt** In the operating system, interrupts are essential because they give a reliable technique for the OS to communicate & react to their surroundings. An interrupt is nothing but one kind of signal between a device as well as a computer system otherwise from a program in the computer that requires the OS to leave and decide accurately what to do subsequently. Whenever an interrupt signal is received, then the hardware of the computer puts on hold automatically whatever computer program is running presently, keeps its status & runs a computer program which is connected previously with the interrupt. #### **Memory Management** The functionality of an OS is nothing but memory management which manages main memory & moves processes backward and forward between disk & main memory during implementation. This tracks each & every memory position; until it is assigned to some process otherwise it is open. It verifies how much memory can be allocated to processes and also makes a decision to know which process will obtain memory at what time. Whenever memory is unallocated, then it tracks correspondingly to update the status. Memory management work can be divided into three important groups like memory management of hardware, OS and application memory management. #### **Multitasking** It describes the working of several independent computer programs on a similar computer system. Multitasking in an OS allows an operator to execute one or more computer tasks at a time. Since many computers can perform one or two tasks at a time, usually this can be done with the help of time-sharing, where each program uses the time of a computer to execute. ***Networking*** Networking can be defined as when the processor interacts with each other through communication lines. The design of communication-network must consider routing, connection methods, safety, the problems of opinion & security. Presently most of the operating systems maintain different networking techniques, hardware, & applications. This involves that computers that run on different operating systems could be included in a general network to share resources like data, computing, scanners, printers, which uses the connections of either wired otherwise wireless. #### **Security** If a computer has numerous individuals to allow the immediate process of various processes, then the many processes have to be protected from other activities. This system security mainly depends upon a variety of technologies that work effectively. Current operating systems give an entrée to a number of resources, which are obtainable to work the software on the system, and to external devices like networks by means of the kernel. The operating system should be capable of distinguishing between demands which have to be allowed for progressing & others that don't need to be processed. Additionally, to permit or prohibit a security version, a computer system with a high level of protection also provides auditing options. So this will allow monitoring the requests from accessibility to resources #### **User Interface** A GUI or user interface (UI) is the part of an OS that permits an operator to get the information. A user interface based on text displays the text as well as its commands which are typed over a command line with the help of a keyboard. The OS-based applications mainly provide a specific user interface for efficient communication. The main function of a user interface of an application is to get the inputs from the operator & to provide o/ps to the operator. But, the sorts of inputs received from the user interface as well as the o/p types offered by the user interface may change from application to application. The UI of any application can be classified into two types namely GUI (graphical UI) & CLI (command line user interface). An Operating System supplies different kinds of services to both the users and to the programs as well. It also provides application programs (that run within an Operating system) an environment to execute it freely. It provides users the services run various programs in a convenient manner. Here is a list of common services offered by an almost all operating systems: 1. 2. 3. 4. 5. 6. 7. 8. #### **Program Execution** The operating system must have the capability to load a program into memory and execute that program. Furthermore, the program must be able to end its execution, either normally or abnormally / forcefully. #### **File system manipulation** Programs need has to be read and then write them as files and directories. File handling portion of operating system also allows users to create and delete files by specific name along with extension, search for a given file and / or list file information. Some programs comprise of permissions management for allowing or denying access to files or directories based on file ownership. #### **Input / Output Operations** A program which is currently executing may require I/O, which may involve file or other I/O device. For efficiency and protection, users cannot directly govern the I/O devices. So, the OS provide a means to do I/O Input / Output operation which means read or write operation with any file. #### **Communication** Process needs to swap over information with other process. Processes executing on same computer system or on different computer systems can communicate using operating system support. Communication between two processes can be done using shared memory or via message passing. #### **Resource Allocation** When multiple jobs running concurrently,  resources must need to be allocated to each of them. Resources can be CPU cycles, main memory storage, file storage and I/O devices. CPU scheduling routines are used here to establish how best the CPU can be used. #### **Error Detection** Errors may occur within CPU, memory hardware, I/O devices and in the user program. For each type of error, the OS takes adequate action for ensuring correct and consistent computing. #### **Accounting** This service of the operating system keeps track of which users are using how much and what kinds of computer resources have been used for accounting or simply to accumulate usage statistics. #### **Security and protection** Protection includes in ensuring all access to system resources in a controlled manner. For making a system secure, the user needs to authenticate him or her to the system before using (usually via login ID and password). An Operating System supplies different kinds of services to both the users and to the programs as well. It also provides application programs (that run within an Operating system) an environment to execute it freely. It provides users the services run various programs in a convenient manner. Here is a list of common services offered by an almost all operating systems: 1. 2. 3. 4. 5. 6. 7. 8. #### **Program Execution** The operating system must have the capability to load a program into memory and execute that program. Furthermore, the program must be able to end its execution, either normally or abnormally / forcefully. #### **File system manipulation** Programs need has to be read and then write them as files and directories. File handling portion of operating system also allows users to create and delete files by specific name along with extension, search for a given file and / or list file information. Some programs comprise of permissions management for allowing or denying access to files or directories based on file ownership. #### **Input / Output Operations** A program which is currently executing may require I/O, which may involve file or other I/O device. For efficiency and protection, users cannot directly govern the I/O devices. So, the OS provide a means to do I/O Input / Output operation which means read or write operation with any file. #### **Communication** Process needs to swap over information with other process. Processes executing on same computer system or on different computer systems can communicate using operating system support. Communication between two processes can be done using shared memory or via message passing. #### **Resource Allocation** When multiple jobs running concurrently,  resources must need to be allocated to each of them. Resources can be CPU cycles, main memory storage, file storage and I/O devices. CPU scheduling routines are used here to establish how best the CPU can be used. #### **Error Detection** Errors may occur within CPU, memory hardware, I/O devices and in the user program. For each type of error, the OS takes adequate action for ensuring correct and consistent computing. #### **Accounting** This service of the operating system keeps track of which users are using how much and what kinds of computer resources have been used for accounting or simply to accumulate usage statistics. #### **Security and protection** Protection includes in ensuring all access to system resources in a controlled manner. For making a system secure, the user needs to authenticate him or her to the system before using (usually via login ID and password). ![](media/image2.tiff) **Types of System Calls** There are mainly five types of system calls. These are explained in detail as follows − **Process Control** These system calls deal with processes such as process creation, process termination etc. **File Management** These system calls are responsible for file manipulation such as creating a file, reading a file, writing into a file etc. **Device Management** These system calls are responsible for device manipulation such as reading from device buffers, writing into device buffers etc. **Information Maintenance** These system calls handle information and its transfer between the operating system and the user program. **Communication** These system calls are useful for interprocess communication. They also deal with creating and deleting a communication connection. *Table 1: Types of System Calls* **open()** The open() system call is used to provide access to a file in a file system. This system call allocates resources to the file and provides a handle that the process uses to refer to the file. A file can be opened by multiple processes at the same time or be restricted to one process. It all depends on the file organization and file system. **read()** The read() system call is used to access data from a file that is stored in the file system. The file to read can be identified by its file descriptor and it should be opened using open() before it can be read. In general, the read() system calls takes three arguments i.e. the file descriptor, buffer which stores read data and number of bytes to be read from the file. **write()** The write() system calls writes the data from a user buffer into a device such as a file. This system call is one of the ways to output data from a program. In general, the write system calls takes three arguments i.e. file descriptor, pointer to the buffer where data is stored and number of bytes to write from the buffer. **close()** The close() system call is used to terminate access to a file system. Using this system call means that the file is no longer required by the program and so the buffers are flushed, the file metadata is updated and the file resources are de-allocated. **LEARNING CONTENTS (System Programs)** System Programming can be defined as act of building Systems Software using System Programming Languages. According to Computer Hierarchy, one which comes at last is Hardware. Then it is Operating System, System Programs, and finally Application Programs. Program Development and Execution can be done conveniently in System Programs. Some of System Programs are simply user interfaces, others are complex. It traditionally lies between user interface and system calls. **Categories of System Programs** **1. File Management** A file is a collection of specific information stored in memory of computer system. File management is defined as process of manipulating files in computer system, it management includes process of creating, modifying and deleting files. - It helps to create new files in computer system and placing them at specific locations. - It helps in easily and quickly locating these files in computer system. - It makes process of sharing of files among different users very easy and user friendly. - It helps to stores files in separate folders known as directories. - These directories help users to search file quickly or to manage files according to their types or uses. - It helps user to modify data of files or to modify he name of file in directories. **Status Information** Information like date, time amount of available memory, or disk space is asked by some of users. Others providing detailed performance, logging and debugging information which is more ![](media/image4.tiff) The design of an operating system architecture traditionally follows the separation of concerns principle. This principle suggests structuring the operating system into relatively independent parts that provide simple individual features, thus keeping the complexity of the design manageable. Besides managing complexity, the structure of the operating system can influence key features such as robustness or efficiency: - The operating system posesses various privileges that allow it to access otherwise protected resources such as physical devices or application memory. When these privileges are granted to the individual parts of the operating system that require them, rather than to the operating system as a whole, the potential for both accidental and malicious privileges misuse is reduced. Breaking the operating system into parts can have adverse effect on efficiency because of the overhead associated with communication between the individual parts. This overhead can be exacerbated when coupled with hardware mechanisms used to grant privileges. The following sections outline typical approaches to structuring the operating system. **1. Monolithic Systems** A monolithic design of the operating system architecture makes no special accommodation for the special nature of the operating system. Although the design follows the separation of concerns, no attempt is made to restrict the privileges granted to the individual parts of the operating system. The entire operating system executes with maximum privileges. The communication overhead inside the monolithic operating system is the same as the communication overhead inside any other software, considered relatively low. #### **2. Layered Systems** A layered design of the operating system architecture attempts to achieve robustness by structuring the architecture into layers with different privileges. The most privileged layer would contain code dealing with interrupt handling and context switching, the layers above that would follow with device drivers, memory management, file systems, user interface, and finally the least privileged layer would contain the applications. #### **3. Microkernel Systems** A microkernel design of the operating system architecture targets robustness. The privileges granted to the individual parts of the operating system are restricted as much as possible and the communication between the parts relies on a specialized communication mechanisms that enforce the privileges as necessary. The communication overhead inside the microkernel operating system can be higher than the communication overhead inside other software, however, research has shown this overhead to be manageable. #### **4. Virtualized Systems** Attempts to simplify maintenance and improve utilization of operating systems that host multiple independent applications have lead to the idea of running multiple operating systems on the same computer. Similar to the manner in which the operating system kernel provides an isolated environment to each hosted application, virtualized systems introduce a *hypervisor* that provides an isolated environment to each hosted operating system. ![](media/image6.jpeg)A virtual machine (VM) is an operating system ([OS](https://whatis.techtarget.com/definition/operating-system-OS)) or application environment that is installed on software, which imitates dedicated hardware. The end user has the same experience on a virtual machine as they would have on dedicated hardware. Figure 6 Multiple OSes share hardware components Virtual machines do not require specialized, hypervisor-specific [hardware](https://searchnetworking.techtarget.com/definition/hardware). Virtualization does, however, require more bandwidth, storage and processing capacity than a traditional server or desktop if the physical hardware is going to host multiple running virtual machines. VMs can easily move, be copied and reassigned between host servers to optimize hardware resource utilization. Because VMs on a physical host can consume unequal resource quantities \-- one may hog the available physical storage, while another stores little \-- IT professionals must balance VMs with available resources. **VM Management** The use of virtual machines also comes with several important management considerations, many of which can be addressed through general systems administration best practices and tools that are designed to manage VMs. There are some risks to consolidation, including overtaxing resources or potentially experiencing outages on multiple VMs due to one physical hardware [outage](https://whatis.techtarget.com/definition/uptime-and-downtime). While these cost savings increase as more virtual machines share the same hardware platform, it does add risk. It is possible to place hundreds of virtual machines on the same hardware, but if the hardware platform fails, it could take out dozens or hundreds of virtual machines. **VM Uses** VMs have multiple uses, but in general they are deployed when the need for different operating systems and processing power are needed for different applications running simultaneously. For example, if an enterprise wants to test multiple web servers and small databases at the same time. Similarly, if an enterprise wants to use the same server to run graphics-intensive gaming software and customer service database. **VM vs. Dual Boot** Before [the arrival of virtualization](https://searchservervirtualization.techtarget.com/feature/The-history-of-virtualization-and-its-mark-on-data-center-management), an operator wanting to run two operating systems, say, Windows and Linux, had to run two full operating systems and toggle between them. While only one could be used at a time, it used the full power of the hardware. In some instances, particularly when the computer is not that powerful and the tasks are very demanding, some operators still prefer to use dual boot. Similarly, if the operator is working within one operating system for long periods of time, the power available during a dual boot can be preferable. However, when the operator needs to switch between applications on different operating systems often, VM is far more practical. **VM vs. emulators** An emulator is software that allows one application to take on the characteristics of another. For example, emulation software can be used to make a PC operate as a game console. **VM vs. containers** [Containers ](https://searchitoperations.techtarget.com/definition/container-management-software)are similar to VMs, except that they only virtualize the operating system, rather than the rest of the underlying hardware. Containers contain the code, system tools, runtime, system libraries and settings needed for multiple applications. That\'s why containers are often used when multiple applications using the same operating system are needed. Containers are used to create [cloud-native](https://searchitoperations.techtarget.com/definition/native-cloud-application-NCA), distributed applications, and to package legacy applications for increased portability and deployment simplicity. One of the leading container developers as of mid-2019 was Docker, which first arrived in the market in 2013 as a Linux-based container platform. **VM Vendors** Several vendors offer virtual machine software, but two main vendors dominate in the marketplace: [VMware](https://searchvmware.techtarget.com/definition/VMware) (acquired by EMC in 2004, which was acquired by Dell in 2015), Oracle and [Microsoft](https://searchwindowsserver.techtarget.com/definition/Microsoft). Numerous open-source VM vendors have also staked their claims, such as ProxMox. VMware has a mature product portfolio, with many years of use in the IT industry. Microsoft has come on very strong in recent years, introducing its Azure line of VM solutions. They include 11 different series that range from its A Series \-- designed for development and test servers, low traffic web servers, small to medium databases, servers for proof-of-concepts, and code repositories \-- to its N Series \-- designed with [graphics processing unit ](https://searchvirtualdesktop.techtarget.com/definition/GPU-graphics-processing-unit)(GPU) capabilities for compute and graphics-intensive workloads, such as high-end remote visualization, deep learning and predictive analytics. An operating system is a construct that allows the user application programs to interact with the system hardware. Operating system by itself does not provide any function but it provides an atmosphere in which different applications and programs can do useful work. There are many problems that can occur while designing and implementing an operating system. These are covered in operating system design and implementation. ### **Operating System Design Goals** It is quite complicated to define all the goals and specifications of the operating system while designing it. The design changes depending on the type of the operating system i.e if it is batch system, time shared system, single user system, multi user system, distributed system etc. There are basically two types of goals while designing an operating system. These are − ### **User Goals** The operating system should be convenient, easy to use, reliable, safe and fast according to the users. However, these specifications are not very useful as there is no set method to achieve these goals. ### **System Goals** The operating system should be easy to design, implement and maintain. These are specifications required by those who create, maintain and operate the operating system. But there is not specific method to achieve these goals as well. **Operating System Mechanisms and Policies** -------------------------------------------- There is no specific way to design an operating system as it is a highly creative task. However, there are general software principles that are applicable to all operating systems. A subtle difference between mechanism and policy is that mechanism shows how to do something and policy shows what to do. Policies may change over time and this would lead to changes in mechanism. So, it is better to have a general mechanism that would require few changes even when a policy change occurs. ### **Operating System Implementation** The operating system needs to be implemented after it is designed. Earlier they were written in assembly language but now higher level languages are used. The first system not written in assembly language was the Master Control Program (MCP) for Burroughs Computers. ### **Advantages of Higher Level Language** There are multiple advantages to implementing an operating system using a higher level language such as: the code is written more fast, it is compact and also easier to debug and understand. Also, the operating system can be easily moved from one hardware to another if it is written in a high level language. ### **Disadvantages of Higher Level Language** Using high level language for implementing an operating system leads to a loss in speed and increase in storage requirements. However in modern systems only a small amount of code is needed for high performance, such as the CPU scheduler and memory manager. Also, the bottleneck routines in the system can be replaced by assembly language equivalents if required. In [computing](https://en.wikipedia.org/wiki/Computing) System generation or sysgen is the process of creating a particular unique instance of an [operating system](https://en.wikipedia.org/wiki/Operating_system) by combining user-specified options and parameters with manufacturer-supplied general-purpose program code to produce an operating system tailored for a particular hardware and software environment.[\[1\]](https://en.wikipedia.org/wiki/System_generation#cite_note-1) Some other programs have similar processes, although not usually called \"sysgen.\" For example, [IBM](https://en.wikipedia.org/wiki/IBM)\'s [Customer Information Control System](https://en.wikipedia.org/wiki/Customer_Information_Control_System) (CICS) was installed through a process called CICSGEN. - What CPU is to be used? What options (extended instruction sets, floating-point arithmetic, and so on) are installed? For multiple CPU systems, each CPU must be described. - How much memory is available? Some systems will determine this value themselves by referencing memory location after memory location until an \"illegal address\" fault is generated. This procedure defines the final legal address and hence the amount of available memory. - What devices are available? The system will need to know how to address each device (the device number), the device interrupt number, the device\'s type and model, and any special device characteristics. - What operating-system options are desired, or what parameter values are to be used? These options or values might include how many buffers of which sizes should be used, what type of CPU-scheduling algorithm is desired, what the maximum number of processes to be supported is, and so on. Once this information is determined, it can be used in several ways. 1. What are the advantage and disadvantages of implementing virtual machines? 2. What is Kenel in Operating System. - ***The Primary components of Operating System are:*** - ***Kernel which*** provides the basic level of control on all the computer peripherals, - ***Process execution which serves as the*** interface between the hardware as well as an application program - #### **Interrupt** which are very essential in giving a reliable technique for the OS to communicate & react to their surroundings. - #### **Memory Management** which manages main memory & moves processes backward and forward between disk & main memory during implementation. - #### **Multitasking** allows an OS operator to execute one or more computer tasks at a time. - #### **Networking** which can be defined as when the processor interacts with each other through communication lines. - #### **Security** which mainly depends upon a variety of technologies that work effectively. - #### **User Interface** of OS permits an operator to get the information. ![](media/image9.png) **REFERENCES** **­Books/E-Books:** Tanenbaum, A. S., Bos, H. Modern Operating Systems. 4th Edition. Pearson Education, Inc. 2015 Silberschatz, Abraham., Galvin., Gagne Greg., Operating System Concepts. 10th Edition. John Wiley and Sons, Inc., 2018 **E-Sources:**

Use Quizgecko on...
Browser
Browser