1 / 21

UNIT -II

UNIT -II. Introduction to the Kernel. Shell. Kernel. Hardware; CPU, I/O, Memory and Storage Devices. Kernel: kernel is the central component of operating system. It acts as an interface between the user applications and the hardware .

hutchinss
Download Presentation

UNIT -II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UNIT -II Introduction to the Kernel

  2. Shell Kernel Hardware; CPU, I/O, Memory and Storage Devices • Kernel: • kernel is the central component of operating system. • It acts as an interface between the user applications and the hardware. • kernel is a computer program that manages input/output requests from software and translates them into data processing instructions for the CPU and other electronic components of a computer. • kernel can provide the lowest-level abstraction layer for the resources. • Applications and processes use these resources through • IPC mechanisms and System calls. • The main tasks of the kernel are : • Process management • Device management • Memory management • Interrupt handling • I/O communication

  3. Types Of Kernels Monolithic Kernel Microkernel Exokernel Hybrid Kernel Fig. Monolithic Kernel

  4. Exokernel is an operating system kernel developed by the MIT Parallel and Distributed Operating Systems group, and also a class of similar operating systems. • The idea behind exokernels is to force as few abstractions as possible on developers, enabling them to make as many decisions as possible about hardware abstractions. Fig. Exokernel

  5. - A hybrid kernel is a kernel architecture based on combining aspects of microkernel and monolithic kernel architectures used in computer operating Systems- The idea behind this category is to have a kernel structure similar to a microkernel, but implemented in terms of a monolithic kernel- No performance overhead for message passing and context switching between kernel and user mode, as in monolithic kernels, there are no reliability benefits of having services in user space, as in microkernel. Fig. Hybrid kernel

  6. Types Of kernels

  7. 2. Unix Kernel • The Unix Kernel is monolithic in design. • The Kernel can be split into two sections :- • machine dependent • and machine independent

  8. User Program Libraries trap User level trap Kernel level System call Interface Process Control subsystem File Subsystem IPC Scheduler Memory Management Buffer cache Character/block device drivers Hardware control Kernel level Hardware level Hardware Fig. Block diagram of the system kernel

  9. Modern Unix Kernel

  10. Examples of modern Unix Systems • System V Release 4[SVR4] • Solaris 9 • BSD[Berkeley Software Distribution]

  11. User and Kernel Stack

  12. Process Table entry Fields • PID - unique process identifiers • PPID –PID of parent • User ID • state -running, sleeping,.. • event descriptor - address of event to wakeup a sleeping process • Pointers to page tables • size and location of u area & pregion entry - for swapping & switching • scheduling parameters determine access to CPU - system priority : user priority • array of signals pending • execution and kernel utilisation times

  13. u area (user area) fields: • pointer to process table entry of the currently executing process • UIDs to permit access rights • time spent executing in user and kernel modes • an array containing signal handlers • login terminal associated with the process • error from a system call • return value from a system call • I/O parameters: amount of data to transfer, the address of the source (or target) data array in user space, file offsets for I/O, etc. • current and root directory • user file descriptor table records the files the process has open • size limits of a process and of a file it can write • permission of files the process creates

  14. Data Structure for Process per process region table Kernel region table u area main memory Kernel process table

  15. Context of a process • System-level Context • Process table entry • U area • Per process region table • Kernel stack User-level Context - Process text - Process Data - User stack - Shared memory Register Context - Program counter - Processor status register - Stack pointer - Shared memory

  16. Process States 8 7 1 3 2 5 6 9 4

  17. 6. Sleep And Wakeup • When process is executing in the kernel it may need to wait for some event. • To do this it executes the sleep routine. • Process state changed to blocked and scheduler selects other process. • When the event occurs the interrupt routine executes the wakeup routine. • I.e. process state changed from blocked to runnable. • Several processes may be waiting for the same event - all are made runnable. • Interrupts are disabled while sleep and wakeup are executing. • Kernel sets the priority of the sleeping process according to the reason • for sleeping.

  18. process A process B process C | : : v : : Buffer locked | : sleeps | : v : Buffer locked | sleeps | v Buffer locked sleeps Ready to run Ready to run ready to run : Runs buffer : : unlocked : : Lock buffer : : : : : sleeps for : : some reason : Runs : Runs buffer locked :Buffer locked – sleeps sleeps Wakes up buffer : : Unlocks Buffer : : Wakeup all : Ready to run sleeping proc. Ready to run Buffer unlocked. wakeup all sleeping processes A,B,C

More Related