Computer System Structures

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Figure 1.1 Interaction between applications and the operating system.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Operating system Structure and Operation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
2: Computer-System Structures
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Processes Introduction to Operating Systems: Module 3.
Operating Systems Structure what is the organizational principle?
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
1.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 2: OS Structures (Chapter 2.7)
Examples of Operating Systems.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CENG334 Introduction to Operating Systems 1 Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Introduction to Operating Systems Concepts
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Chapter 2: Operating-System Structures
Operating System Structures
Kernel Design & Implementation
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Operating System Structure
Introduction to Operating System (OS)
KERNEL ARCHITECTURE.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: Operating-System Structures
Threads, SMP, and Microkernels
Introduction To OS (OS Structure, Modes and Services)
Chapter 2: System Structures
Operating Systems Lecture 4.
Chapter 3: Operating-System Structures
Computer-System Architecture
Module 2: Computer-System Structures
Basic Concepts Protection: Security:
Lecture 4- Threads, SMP, and Microkernels
B.Ramamurthy Chapter 2 : Appendix
Operating Systems Lecture 3.
Outline Chapter 2 (cont) OS Design OS structure
Module 2: Computer-System Structures
Operating Systems: A Modern Perspective, Chapter 3
Outline Operating System Organization Operating System Examples
System calls….. C-program->POSIX call
Operating Systems Structure
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Operating Systems Structure
Presentation transcript:

Computer System Structures System Operation Operating system structure. Kernel, Dual Mode Privileged Instructions, Timer Monolithic Kernel Layered OS Micro Kernel Kernel loadable modules Textbook Silberschatz, Chapter 2

Dual Mode Operations we need to make sure that an error in a user program could cause problems only for the one program running. if a process gets stuck in an infinite loop, this loop could prevent the correct operation of many other processes. in a multiprogramming system, one erroneous program might modify another program, the data of another program, or even the operating system itself. we must be able to distinguish between the execution of operating-system code and user defined code. The approach taken by most computer systems is to provide hardware support that allows us to differentiate among various modes of execution.

User, Kernel modes At the very least, we need two separate modes of operation: user mode and kernel mode (supervisor mode, protected mode, privileged mode) Kernel mode – privileged instructions At system boot time, the hardware starts in kernel mode. The operating system is then loaded and starts user applications in user mode. user application requests a service from the operating system (via a system call), the system must perform transition from user to kernel mode to fulfill the request.

Privileged instructions The hardware allows privileged instructions to be executed only in kernel mode. If an attempt is made to execute a privileged instruction in user mode, the hardware does not execute the instruction but rather treats it as illegal and traps it to the operating system. I/O control Interrupt management Set value of timer. Clear memory. Turn off interrupts. Access I/O device. Direct Instructions to switch to kernel mode ? Issue a system call instruction. Switch to kernel mode ? Read the clock. ? Privileged Non Privileged Non Privileged

Timer We must ensure that the operating system maintains control over the CPU. We cannot allow a user program to get stuck in an infinite loop or to fail to call system services and never return control to the operating system. To accomplish this goal, we can use a timer. A timer can be set to interrupt the computer after a specified period. The period may be fixed (for example, 1/60 second) or variable (for example, from 1 millisecond to 1 second). The operating system sets the counter. Every time the clock ticks, the counter is decremented. When the counter reaches 0, an interrupt occurs.

Operating System Structure MSDOS Modular or Monolithic MS-DOS could be considered as monolithic ? Only drivers could be added to the system OS itself was one big static program (never changes) No protection mode In software In hardware also (at that time) COMMAND.COM - shell MSDOS.SYS - kernel IO.SYS - drivers

The kernel provides the file system CPU scheduling memory management and other operating-system functions through system calls.

Monolithic kernel Benefits: Fast All modules are in the same address space. All calls are in the same address space. That is fast. Disadvantages: Large code – with the time it becomes larger and larger Error prone (not reliable) Difficult to manage Difficult to update, not flexible Each change needs the program (kernel) to rebuild. Difficult to develop Solution Make OS modular Layering the OS Microkernel Loadable Kernel modules

A layered operating system Modular or Monolithic A system can be made modular in many ways. One method is the layered approach the operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware the highest (layer N) is the user interface. Each layer knows only its neighbors advantage - simplicity of construction and debugging major difficulty - appropriately define the various layers Disadvantage - Each layer adds overhead to the system call Examples Hardware abstraction layer (HAL) – Windows Open system interconnection (OSI) networking model

First Microkernel UNIX expanded, the kernel became large and difficult to manage. In the mid-1980s, researchers at Carnegie Mellon University developed an operating system called Mach that modularized the kernel using the microkernel approach.

Microkernel structure remove all nonessential components from the kernel and implement them as system and user-level programs. The result is a smaller kernel. Typically microkernels provide minimal process and memory management, in addition to a communication facility.

Microkernel tradeoff Advantages Extending the operating system easier All new services are added to user space and consequently do not require modification of the kernel Less error prone code, more reliable kernel, fault isolation Small code less errors. Module error does not affect the other parts of OS Secure kernel Less code in kernel space, less security breaches. Easier to port to different hardware platforms. Less depends on hardware Small size Mac OS X kernel (also known as Darwin) QNX, a real-time operating system for embedded systems Performance ???

Microkernel Performance the performance of microkernels can suffer due to increased system-function overhead The main function of the microkernel is to provide communication between the client program and the various services that are also running in user space. Communication is provided through message passing, For example, if the client program wishes to access a file it must interact with the file server. The client program and service never interact directly. Rather, they communicate indirectly by exchanging messages with the microkernel.

Monolithic vs. Microkernel Moves as much from the kernel into “user” space Small core OS running at kernel level OS Services built from many independent user-level processes Communication between modules with message passing Benefits: Easier to extend OS Easier to port OS to new architectures More reliable (less code is running in kernel mode) Fault Isolation (kernel and other OS parts are protected from other parts) More secure Detriments: Performance overhead severe for naive implementation Benefits: Fast All modules are in the same address space Detriments: Large code Error prone (not reliable) Difficult to manage Difficult to update Difficult to develop

Kernel Modules dynamically linked libraries Perhaps the best current methodology for operating-system design involves using loadable kernel modules. The idea of the design is for the kernel to provide core services while other services are implemented dynamically, as the kernel is running. This type of design is common in modern implementations of UNIX, such as Solaris, Linux, FreeBSD and Mac OS X, as well as Windows. Disadvantages: Run Time linking takes “Run Time” *.dll instead of *.lib in windows *.so instead of *.a in Unix type systems. Advantages: No kernel rebuilding for updates Much easier to create new modules rather than new layers