KEMBAR78
Week 3 - Lecture Three | PDF | Kernel (Operating System) | Operating System
0% found this document useful (0 votes)
13 views49 pages

Week 3 - Lecture Three

This document discusses the architecture of operating systems, detailing various designs such as simple, layered, and microkernel architectures. It explains the functions of the kernel, including memory management and process scheduling, and outlines the components and services provided by operating systems. Additionally, it covers system calls and their types, emphasizing their role in facilitating communication between user programs and the operating system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views49 pages

Week 3 - Lecture Three

This document discusses the architecture of operating systems, detailing various designs such as simple, layered, and microkernel architectures. It explains the functions of the kernel, including memory management and process scheduling, and outlines the components and services provided by operating systems. Additionally, it covers system calls and their types, emphasizing their role in facilitating communication between user programs and the operating system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

FACULTY OF COMPUTING & INFO SYSTEMS

WEEK THREE

TOPIC :
OPERATING SYSTEM ARCHITECTURE
AIM
❖The aim of this chapter is to explain the architecture of the operating
system.

❖Various ways in which an operating system can be designed are


explained here.

❖Further it reviews the concept of operating system functions, which are


provided by various system calls.

❖This chapter also focuses on various components of the operating


system and its structure
OBJECTIVES OF THE STUDY
❖ Explain the architecture of the operating system

❖ Various ways in which an operating system can

be designed.

❖ Concept of operating system functions, which are

provided by various system calls.

❖ Components of the operating system and its structure.


WHAT IS ARCHITECTURE OPERATING SYSTEM

❖Architecture defines the fundamental structure of an operating


system.

❖It defines the interconnection between the various system


components

❖Operating system architectures:

1. Organize operating system components

2. Specify privilege with which each component executes


DIFFERENT ARCHITECTURES OF AN
OPERATING SYSTEM

1. Simple or monolithic architecture

2. Layered architecture

3. Microkernel architecture
SIMPLE ARCHITECTURE

❖It has a small, simple structure, and hence is also called


simple architecture.

❖It only consists of a single layer, responsible for all the


functions of the operating system.

❖Examples of a Simple architecture system are the


Microsoft Disk Operating System (MS-DOS) and UNIX.
Microsoft Disk Operating System
◦ MS-DOS (Microsoft Disk Operating System) was the Microsoft-marketed
version of the first widely-installed Operating system in
personal computers.

◦ It was essentially the same operating system that Bill Gates's young
company developed for IBM as Personal Computer - Disk Operating
System(PC-DOS).

◦ MS-DOS is a non-graphical command line operating system


derived from 86-DOS that was created for IBM compatible computers.
Microsoft Disk Operating System
◦ Today, MS-DOS is no longer used; however, the command shell, more
commonly known as the Windows command line is still used by many
users.

◦ BASIC DOS COMMANDS


◦ COPY : Copies one or more files from source disk/drive to the specified disk/drive.
◦ XCOPY : Copies files and directories, including lower-level directories if they exists.
◦ DEL : Removes specified files from specified disk/drive.
◦ DIR : To list all or specific files of any directory on a specified disk.
◦ MD : To make directory or subdirectory on a specified disk/drive.
SIMPLE ARCHITECTURE
SIMPLE STRUCTURE

Chapter 1 11
KERNEL
❖ The control module of the OS is the kernel.
❖ It is loaded initially at the time of the system boot and remains there
until the system is switched off.
❖ The kernel directly interacts with the hardware and schedules the
execution of various tasks.
❖ For example, in multiple processor operating systems, the kernel
chooses the processor and the program to be chosen for execution.
❖ The kernel is also called the real time executive.
Chapter 1 12
Summary on Kernel
❖ The kernel is the central component of a computer operating systems.
❖ The only job performed by the kernel is to the manage the
communication between the software and the hardware.
❖ A Kernel is at the nucleus of a computer. It makes the
communication between the hardware and software possible.
❖ While the Kernel is the innermost part of an operating system, a shell
is the outermost one.
Chapter 1 13
FUNCTIONS OF THE KERNEL

1. Memory management

2. Process and task management

3. Disk management

4. CPU scheduling

Chapter 1 14
SIMPLE ARCHITECTURE

◦ Prominent in the early days

◦ The structure consists of no-structure

◦ The system is a collection of procedures

◦ Each procedure can call any other procedure

◦ No information hiding (as opposed to modules,


packages, classes)
Chapter 3 15
Layered Architecture
❖Layered architecture was designed to reduce the limitation of a
simple architecture.

❖It categorizes the operating system in different layers, which


communicates using standard function call.

❖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.
Layered Architecture
◦ Layered approach to operating systems
◦ Tries to improve on monolithic kernel designs
◦ Groups components that perform similar functions into
layers
◦ Each layer communicates only with layers immediately above
and below it.
◦ Processes’ requests might pass through many layers before
completion
Layered Architecture
FEATURES OF THE LAYERED ARCHITECTURE:

◦ Layered architecture implements the concept of information hiding by


providing the encapsulation of data in one layer and providing the
functionalities and services only to the upper layer.
◦ By decomposing into several layers, each higher-level layer uses the
functions (operation) and services of its lower layers and thus
maintains the modularity method.
◦ Easier to modify the layers.
◦ If an error appears in a particular layer, then only that layer is
modified.

Chapter 2 20
A LAYERED STRUCTURE
◦ Advantages:
◦ Simplicity of construction
◦ Ease of debugging
◦ Extensible

◦ Disadvantages:
◦ Defining the layers
◦ Each layer adds overhead

Chapter 2 21
MICRO-KERNEL ARCHITECTURE

❖Micro-kernel architecture is formed by


removing all non-essential components
from the kernel.

❖Implementing separate levels for system and


user level programs results in a small kernel
called a micro-kernel.
Microkernel Architecture
◦ Microkernel operating system architecture

◦ Provides only small number of services

◦ Attempt to keep kernel small and scalable

◦ High degree of modularity

◦ Extensible, portable and scalable

◦ Increased level of inter-module communication

◦ Can degrade system performance


Microkernel Architecture

Figure 1.5 Microkernel operating system architecture.


Microkernels
(from Tanenbaum, Modern Operating Systems)

...
User User file memory process User
pager space
process process server server server

microkernel Kernel
space
Approach

◦ The microkernel layer provides a set of minimal core services


and is the interface to the hardware layer

◦ Other services (drivers, memory managers, etc.) are


implemented as separate modules with clearly defined
interfaces.
TYPES OF KERNEL
◦ 1. Monolithic Kernels

Monolithic Kernels are those Kernels where the user

services and the kernel services are implemented in

the same memory space i.e. different memory for user

services and kernel services are not used in this case.

Chapter 1 27
Monolithic Kernels

Chapter 1 28
Monolithic Kernels
◦ Advantages:

◦ It provides CPU scheduling, memory scheduling, file management


through System calls only.

◦ Execution of the process is fast because there is no separate memory


space for user and kernel.

◦ Disadvantages:

◦ If any service fails, then it leads to system failure.

◦ If new services are to be added then the entire Operating System needs
Chapter 1
to be modified. 29
2. Microkernel

◦ A Microkernel is different from Monolithic kernel

because in a Microkernel, the user services and kernel

services are implemented into different spaces i.e. we

use User Space and Kernel Space in case of

Microkernels.

Chapter 1 30
Chapter 1 31
◦ Advantages

◦ If new services are to be added then it can be easily


added.

◦ Disadvantages:

◦ Since we are using User Space and Kernel Space


separately, so the communication between these can
reduce the overall execution time.
Chapter 1 32
Hybrid Kernel

◦ A Hybrid Kernel is a combination of both Monolithic Kernel and


Microkernel. It makes the use of the speed of Monolithic Kernel and the
modularity of Microkernel.

◦ Hybrid kernels are micro kernels that have some "non-essential" code
in kernel-space in order for the code to run more quickly than it would
be in user-space.

Chapter 1 33
OPERATING SYSTEM COMPONENTS

1. Process Management: To execute a whole program, instead of


loading the whole program in the main memory, the CPU fetches and
executes one instruction of a process after another.

Chapter 1 34
OPERATING SYSTEM COMPONENTS

◦ 2. Main Memory Management: To execute a process, it must be


loaded into main memory. By increasing the “Hit Ratio,” this
component increases system performance. Thus, the memory
utilization is maximized.

◦ 3. File and Storage Management: Most of the data is stored in


the secondary memory. Therefore access of secondary storage must
be efficient by performance level and convenient to program
input/output functions at the application level.

Chapter 1 35
OPERATING SYSTEM COMPONENTS

◦ 4. Input / Output Management: It keeps the details


away from applications to ensure proper utilization of
the devices, avoid errors, and offers end users an
efficient and convenient programming environment.

◦ 5. Networking: In a distributed system, each processor


has its own local memory and clock.

Chapter 1 36
OPERATING SYSTEM COMPONENTS

◦ 6. Protection: This component provides protection from


erroneous programs and malicious programs to hardware
resources, kernel code, processes, files, and data.

◦ 7. Command Interpreter: This component permits the


end user to interact with the operating system and
offer the user a compatible environment for
programming.

Chapter 1 37
Operating System Services
◦ 1. User Interface: Users can issue commands to the system by means of user

interfaces.

◦ 2. Input / Output Operation: Transferring of data to and from input/output devices

like keyboard, monitor, and storage devices are the prime functions of the operating

system.

◦ 3. Program execution: The operating system must be capable of loading programs

into the Random Access Memory (RAM), running and termination (normally or abruptly).

Chapter 1 38
Operating System Services
◦ Error Detection: Both software and hardware errors must be properly detected and
handled with minimum harmful impact.

◦ Resource Allocation: When multiple processes are running at the same moment,
resources must be allocated to each. Different resources like the main memory, CPU cycles,
and file storage are managed by the operating system.

◦ Accounting: Keep track of system activity to optimize future performance.

◦ Protection and Security: Preventing harm to the resources and to the system as a whole,
either by internal processes or malicious outsiders. By authentication, ownership and
restricted access OS provides protection and security to the system.
Chapter 1 39
FUNCTION CALL
#include <stdio.h>
void add(int a, int b) {
printf("sum: %d/n", a+b);
}
int main{}{
add(10, 5);// normal Function call
return 0;
}
A normal function call is an instruction that transfers control to a function in the
same user space( within the same program)
Function call : the action of executing a defined function within a program
SYSTEM CALL
❖On modern operating systems, processes do not talk to hardware directly, but must

go through OS

❖System Call: request from a process for OS to do some kind of work on its behalf

❖The system call provides an interface between the operating system and its

processes.

❖By making a system call, the user program communicates with the OS and requests

services from it.


SYSTEM CALL
SYSTEM CALL
Types of System Calls

◦Process control
◦File Management
◦Device Management
◦Information Maintenance
◦Interprocessus Communication
Types of System Calls

◦File manipulation:
CreateFile()
ReadFile()
WriteFile()
Types of System Calls

◦File manipulation:
CreateFile()
ReadFile()
WriteFile()
Types of System Calls

Protection

SetFileSecurity()

InitializeSecurityDescriptor()

◦SetSecurityDescriptorgroup()
Features of System Calls
◦ Interface: System calls provide a well-defined interface
between user programs and the operating system.

◦ Protection: System calls are used to access privileged


operations that are not available to normal user programs.

◦Context Switching: A system call requires a context switch,


which involves saving the state of the current process and
switching to the kernel mode to execute the requested service.
Features of System Calls
◦Error Handling: System calls can return error codes to
indicate problems with the requested service. Programs
must check for these errors and handle them appropriately.

◦Synchronization: System calls can be used to synchronize


access to shared resources, such as files or network
connections.

You might also like