Presentation is loading. Please wait.

Presentation is loading. Please wait.

KERNEL ARCHITECTURE.

Similar presentations


Presentation on theme: "KERNEL ARCHITECTURE."— Presentation transcript:

1 KERNEL ARCHITECTURE

2 Contents What is Kernel ? Kernel Architecture Overview User Space
Kernel Space Kernel Functional Overview File System Process Management Memory Management

3 What is Kernel ? A kernel is a central component of an operating system that acts as an interface between the user applications and the hardware. The aim of the kernel is to manage the communication between the software (user level applications) and the hardware (CPU, disk memory etc).

4 What is Kernel ? The main tasks of the kernel are : Process management
Device management Memory management Interrupt handling I/O communication File system. System call control

5 Types of Kernels Monolithic kernel Micro kernel (Modular kernel)
Hybrid kernel Nano kernel Exo kernel

6 Monolithic Kernel All operating system services run along the main kernel thread in a monolithic kernel, which also resides in the same memory area, thereby providing powerful and rich hardware access.

7 Micro Kernel Define a simple abstraction over hardware that use primitives or system calls to implement minimum OS services such as multitasking, memory management and interprocess communication.

8 Hybrid Kernel Run a few services in the kernel space to reduce the performance overhead of traditional microkernels where the kernel code is still run as a server in the user space.

9 Nano Kernel Simplify the memory requirement by delegating services, including the basic ones like interrupt controllers or timers to device drivers.

10 Exo Kernel Allocate physical hardware resources such as processor time and disk block to other programs, which can link to library operating systems that use the kernel to simulate operating system abstractions

11 Kernel Architecture Overview
User Space Kernel Space

12 User Space The User Space is the space in memory where user processes run. This Space is protected. The system prevents one process from interfering with another process. Only Kernel processes can access a user process

13 Kernel Space The kernel Space is the space in memory where kernel processes run. The user has access to it only through the system call.

14 System Call User Space and Kernel Space are in different spaces.
When a System Call is executed, the arguments to the call are passed from User Space to Kernel Space. A user process becomes a kernel process when it executes a system call.

15 User Space and Kernel Space Relationship

16 Kernel Functional Overview
File System Process Management Memory Management

17 Kernel Functional Overview

18 Functional & Architectural Layer

19 File System It is responsible for storing information on disk and retrieving and updating this information. The File System is accessed through system calls such as : open, read, write, …

20 File System Structure Boot Block : information needs to boot the system Super Block : File System Specifications  Size  Max. number of files  Free blocks  Free inodes Inode List Block List : The files data

21 Inode The inode represents all the information needed by the kernel to manipulate a file Each file has an inode structure that is identified by an i-number. It doesn’t contain file name.

22 Virtual File System It manages all the different file system.
It is an abstraction layer between the application program and the file system implementations. It describes the system’s file in term of superblocks and inodes

23 Process Management The Unix OS is a time-sharing system.
Every process is scheduled to run for a period of time (time slice). Kernel creates, manages and deletes the processes

24 Process Management (Cont.)
Every process (except init) in the system is create as the result of a fork system call. The fork system call splits a process into two processes (Parent and Child). Each process has a unique identifier (Process ID).

25 Type of Processes Create(new) Terminated
When a process is first created, it occupies the "created" or "new" state. In this state, the process awaits admission to the "ready" state. Ready and Waiting A "ready" or "waiting" process has been loaded into main memory and is awaiting execution on a CPU Running A process moves into the running state when it is chosen for execution. Terminated A process may be terminated, either from the "running" state by completing its execution or by explicitly being killed.

26 Memory Management Physical memory is actually present in the machine and limited. Virtual memory is makes the system appear to have more memory than it actually has by sharing it between competing processes as they need it.

27 Virtual memory Large Address space Protection Memory mapping
Fair physical memory allocation Shared virtual memory

28 Virtual memory Large Address Spaces
The operating system makes the system appear as if it has a larger amount of memory than it actually has. The virtual memory can be many times larger than the physical memory in the system.

29 Virtual memory Protection
Each process in the system has its own virtual address space. These virtual address spaces are completely separate from each other and so a process running one application cannot affect another. Also, the hardware virtual memory mechanisms allow areas of memory to be protected against writing. This protects code and data from being overwritten by rogue applications.

30 Virtual memory Memory Mapping
Memory mapping is used to map image and data files into a processes address space. In memory mapping, the contents of a file are linked directly into the virtual address space of a process.

31 Virtual memory Fair Physical Memory Allocation
The memory management subsystem allows each running process in the system a fair share of the physical memory of the system,

32 Virtual memory Shared Virtual Memory
Although virtual memory allows processes to have separate (virtual) address spaces, there are times when you need processes to share memory. For example there could be several processes in the system running the bash command shell. Rather than have several copies of bash, one in each processes virtual address space, it is better to have only one copy in physical memory and all of the processes running bash share it. Dynamic libraries are another common example of executing code shared between several processes.

33 Physical and Virtual memory

34 Hazırlayan: Nilden ÜNVER


Download ppt "KERNEL ARCHITECTURE."

Similar presentations


Ads by Google