OS1 Chapter 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

OPERATING SYSTEM APPLICATION – CHAPTER 3

OPERATING SYSTEM STRUCTURES

Kernel
• Provides the basic level of control on all the computer peripherals
• An essential component that loads first and remains within the main memory
• 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.

Interrupt
• Interrupts are essential because they give a reliable technique for the OS to
communicate & react to their surroundings.
• 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

Memory Management
• 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.
• Memory management work can be divided into three important groups:
o memory management of hardware
o OS and;
o application memory management.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 1 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
Multitasking
• It describes the working of several independent computer programs on a
similar computer system.
• allows an operator to execute one or more computer tasks at a time.
• this can be done with the help of time-sharing, where each program uses the
time of a computer to execute.

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;
• This involves computers that run on different operating systems being
included in a general network to share resources like data, computing,
scanners, and printers, which use connections 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.
• Current operating systems give an entrée to several resources, which are
obtainable to work the software on the system, and to external devices like
networks using the kernel.
• The operating system should be capable of distinguishing between demands
that have to be allowed for processes & others that don’t need to be
processed.

User Interface
• is the part of an OS that permits an operator to get the information.
• It based on text displays the text and its commands which are typed over a
command line with the help of a keyboard.
• The main function of a user interface of an application is to get the inputs from
the operator & to provide outputs to the operator.
• The UI of any application can be classified into two types:
o GUI (graphical UI)
o CLI (command line user interface).

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 2 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
COMMON OS SERVICES

Here is a list of common services offered by almost all operating systems:


1. Program Execution
o The operating system must have the capability to load a program into
memory and execute that program.
o the program must be able to end its execution, either normally or
abnormally / forcefully.

2. File System Manipulation


o File handling allows users to create and delete files by specific names
along with extensions, search for a given file, and / or list file information
o Some programs comprise of permissions management for allowing or
denying access to files or directories based on file ownership.

3. Input / Output Operations


o A program that is currently executing may require I/O, which may
involve a file or other I/O device.
o For efficiency and protection, users cannot directly govern the I/O
devices.

4. Communication
o Some process needs to exchange data with another process.
o Processes executing on the same computer system or different
computer systems can communicate using operating system support;
o Communication between two processes can be done using shared
memory or via message passing.

5. Resource Allocation
o When multiple jobs run concurrently, resources must be allocated to
each of them.
o Resources can be CPU cycles, main memory storage, file storage, and
I/O devices.

6. Error Detection
o Errors may occur within the CPU, memory hardware, I/O devices, and in
the user program.
o For each type of error, the OS takes adequate action to ensure correct
and consistent computing.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 3 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
7. Accounting
o It 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.

8. Security and protection


o 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).

SYSTEM CALLS

Types of System Calls

1. Process Control
o These system calls deal with processes such as process creation,
process termination etc.

2. File Management
o These system calls are responsible for file manipulation such as
creating a file, reading a file, writing into a file etc.

3. Device Management
o These system calls are responsible for device manipulation such as
reading from device buffers, writing into device buffers etc.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 4 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
4. Information Maintenance
o These system calls handle information and its transfer between the
operating system and the user program.

5. Communication
o These system calls are useful for interprocess communication. They
also deal with creating and deleting a communication connection.

read()
• The read() system call is used to access data from a file that is stored in the
file system.
• In general, the read() system call takes three arguments i.e. the file descriptor,
the buffer that stores read data, and a 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.
• In general, the write system call takes three arguments i.e. file descriptor, a
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.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 5 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
SYSTEM PROGRAMS

System Programming
• can be defined as building Systems Software using System Programming
Languages.
• According to Computer Hierarchy, one that comes last is Hardware then the
Operating System, the System Programs, and finally, the Application Programs.
• Some of the System Programs are simply user interfaces, others are complex.
It traditionally lies between the user interface and system calls.

Categories of System Programs

File Management
• A file is a collection of specific information stored in the memory of a
computer system.
• defined as the process of manipulating files in the computer system, its
management includes the process of creating, modifying, and deleting files.

Status Information
• Information like date, time amount of available memory, or disk space is
asked by some of the users.
• Others provide detailed performance log and debugging information.

SYSTEM STRUCTURE
• The design of an operating system architecture traditionally follows the
separation of concerns principle

Separation Of Concerns Principle


• design principle that manages complexity by partitioning the software system
so that each partition is responsible for a separate concern, minimizing the
overlap of concerns as much as possible.
Besides managing complexity, the structure of the operating system can influence
key features such as robustness or efficiency:
• The operating system possesses various privileges that allow it to access
otherwise protected resources such as physical devices or application
memory

Breaking the operating system into parts can have an 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.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 6 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
APPROACHES TO STRUCTURING THE OPERATING SYSTEM

A. Monolithic Systems
o a very basic operating system in which file management, memory
management, device management, and process management are
directly controlled within the kernel
o each component of the operating system is contained within the kernel
and the kernel can access all the resources present in the system;
o Operating systems that use monolithic architecture were first time used
in the 1970s.
o also known as the monolithic kernel.
o used to perform small tasks like batch processing and time-sharing
tasks in banks.
o acts as a virtual machine that controls all hardware parts.

B. Layered Systems
o Breaks up the operating system into different layers and retains much
more control of the system
o The bottom layer (layer 0) is the hardware, and the topmost layer (layer
N) is the user interface;
o It simplifies the debugging process as if lower-level layers are
debugged, and an error occurs during debugging

C. Microkernel Systems
o a type of kernel that allows customization of the operating system;
o It runs on privileged mode and provides low-level address space
management and Inter-Process Communication (IPC);
o OS services such as file system, virtual memory manager, and CPU
scheduler are on top of the microkernel;
o Each service and applications have its own address space to make it
secure

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 7 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
Kernel
• The central component of an OS that handles system resources
• It acts as a bridge between the computer's application and hardware
• It is one of the initial programs that is loaded when the computer boots up
• the first component that loads into memory and rests there until the OS is shut
down
• in charge of various activities, including task management, disk management,
and memory management

Microkernel
• is one of the kernel's classifications
• it handles all system resources
• the user and kernel services in a microkernel are implemented in distinct
address spaces
• User services are kept in user address space, while kernel services are kept in
kernel address space
• It aids in reducing the kernel and OS's size.

D. Virtualized Systems
o Attempts to simplify maintenance and improve utilization of operating
systems that host multiple independent applications have led to the
idea of running multiple operating systems on the same computer
o virtualized systems introduce a hypervisor that provides an isolated
environment to each hosted operating system
o an operating system (OS) or application environment that is installed
on software, which imitates dedicated hardware
o do not require specialized, hypervisor-specific hardware
o VMs can easily move, be copied and reassigned between host servers
to optimize hardware resource utilization.

Virtual Machine 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
• 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.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 8 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
Uses of Virtual Machines
• they are deployed when the need for different operating systems and
processing power is needed for different applications running simultaneously
• For example, if an enterprise wants to test multiple web servers and small
databases at the same time

Virtual Machine V.S Dual Boot


• Before the arrival of virtualization, 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.
• if the operator is working within one operating system for long periods, the
power available during a dual boot can be preferable.
• when the operator needs to switch between applications on different
operating systems often, VM is far more practical.

Virtual Machine V.S Emulators

Virtual Machines
• primarily used for creating isolated environments on a single physical
machine, allowing the simultaneous operation of multiple operating systems
on the same hardware for improved resource utilization.
• They operate at a higher level of abstraction, providing better performance by
leveraging the host hardware directly.

Emulators
• mimic the functionality of one system on another, often for running software
designed for a different architecture
• operate at a lower level, translating instructions and simulating hardware
components, which can result in slower performance compared to virtual
machines.

While VMs find common usage in server environments and development, emulators
are versatile and employed for purposes like running software on different platforms
or preserving obsolete hardware functionality.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 9 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
Virtual Machines V.S Containers
• Containers 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
• used to create cloud-native, 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

Virtual Machine Vendors

VMware
• acquired by EMC in 2004, which was acquired by Dell in 2015), Oracle and
Microsoft
• 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 (GPU) capabilities for
compute and graphics-intensive workloads, such as high-end remote
visualization, deep learning and predictive analytics.

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 a
batch system, time-shared system, single-user system, multi user system,
distributed system, etc.

There are two types of goals while designing an operating system. These are:
1. User Goals
o 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.
2. System Goals
o The operating system should be easy to design, implement, and
maintain. These are specifications required by those who create,

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 10 | 11


OPERATING SYSTEM APPLICATION – CHAPTER 3
maintain, and operate the operating system. However, there is no
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 apply to all
operating systems.

Difference between mechanism and policy:


• mechanism shows how to do something
• policy shows what to do.
• Policies may change over time and this would lead to changes in mechanism.
• 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


• written more fast
• it is compact
• easier to debug and understand
• the operating system can be easily moved from one hardware to another

Disadvantages of Higher-Level Language


• lead to a loss in speed
• increase in storage requirements.

K. HIQUIANA – DO NOT DISTRIBUTE P a g e 11 | 11

You might also like