OS Components and Structure

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

OS Components and Structure
Operating System Structures
1 CSE451 Introduction to Operating Systems Spring 2007 Module 3 Components and Structure Gary Kimura & Mark Zbikowski March 30, 2007.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
1 Gary Kimura Lecture #3 October 4, 2002 CSE451 Operating Systems Components and Basic Organization Autumn 2002.
Os31 Chapter 3 Operating-System Structures. os32 Outlines System Components Operating System Services System Calls System Programs System Structure Virtual.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
CSE 451: Operating Systems Spring 2012 Module 3 Operating System Components and Structure Ed Lazowska Allen Center 570 © 2012.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: Operating-System Structures.
1 Lecture 3: OS Functions and Design Approaches  OS duties process management memory management disk/file management protection & security  interaction.
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 OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
IT 344: Operating Systems Winter 2010 Module 3 Operating System Components and Structure Chia-Chi Teng 265G CTB 1.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Processes Introduction to Operating Systems: Module 3.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
Types of OS and OS Components
Copyright © Curt Hill Operating Systems An Introductory Overview.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
System Components Operating System Services System Calls.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Overview of today’s lecture Major components of an operating system Structure and internal architecture of an operating system Monolithic Vs Micro-kernels.
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Module 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Chapter 3: Operating-System Structures
Introduction to Operating Systems Concepts
Module 3: Operating-System Structures
Lecture Topics: 11/1 Processes Process Management
Operating System Structure
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Chapter 1 Introduction to Operating System Part 5
CSE 451: Operating Systems Autumn 2004 Module 3 Operating System Components and Structure Hank Levy 1.
CSE451 Operating Systems Winter 2010
Basic Concepts Protection: Security:
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Winter 2007 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
Hank Levy (for Hank Levy :)
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Introduction to Operating Systems
Outline Chapter 2 (cont) OS Design OS structure
CSE 451: Operating Systems Autumn 2009 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2005 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2004 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
OPERATING SYSTEMS STRUCTURES
© 2007 Gribble, Lazowska, Levy, Zahorjan
CSE 451: Operating Systems Winter 2003 Lecture 3 Operating System Structure: Components and Interfaces Hank Levy 412 Sieg Hall.
System calls….. C-program->POSIX call
CSE 451: Operating Systems Autumn 2010 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
Chapter 2 Operating System Overview
CSE 451: Operating Systems Autumn 2003 Lecture 3 Operating System Structure: Components and Interfaces Hank Levy Allen Center 596.
Chapter 2: Operating-System Structures
CSE 451: Operating Systems Winter 2006 Module 3 Operating System Components and Structure Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2006 Module 3 Operating System Components and Structure John Zahorjan Allen Center 534.
III. Operating System Structures
Presentation transcript:

OS Components and Structure Hank Levy

OS Structure To understand an OS, let’s first look at its components and then how they’re composed or organized. We’ll come back and look at each of these in detail as the course progresses. Realize that it’s never as simple as it looks. These basic concepts exist in some form in all systems, however each system implements them in a slightly different way. Also, the divisions between components may not be as clean in the real world as in the model

Process Management An operating system executes many kinds of activities: user programs batch jobs or command scripts system programs: print spoolers, name servers, file servers, network listeners, etc... Each of these “execution entities” is encapsulated in a process. The process includes the execution context (pc, registers, vm, resources, etc) and all info the activity (program) needs to run. The OS schedules processes to run.

Processes A program is a passive thing -- just a file on the disk with code that is potentially runnable. A process is one instance of a program in execution; at any instance, there may be many processes running copies of a single program (e.g., an editor): each is a separate, independent process. Process A Process B Code Stack PC Registers Code Stack PC Registers page tables resource counts page tables resource counts .... .... 4

Process Operations Processes are fundamental OS-provided objects. The OS supports operations on processes, e.g.: create a process delete a process suspend a process resume a process inter-process communication inter-process synchronization create/delete a subprocess

Memory Management Primary memory is the direct access storage for CPU. Programs must be stored in memory to execute. OS must: allocate memory space for programs (both explicitly and implicitly) deallocate memory space when needed maintain the mappings from virtual to physical memory (page tables) decide how much memory to allocate to each process, and when a process should be removed from memory (policies)

I/O Management Much of the OS kernel is concerned with I/O. The OS provides a standard interface between programs (user or sytem) and devices. Device drivers are the processes responsible for each device type. A driver encapsulates device-specific knowledge, e.g., for device initiation and control, interrupt handling, and errors. There may be a process for each device, or even for each I/O request, depending on the particular OS.

Secondary Storage Management Secondary storage (disk) is the persistent memory, i.e., it endures system failures (we hope). Low-level OS routines are typically responsible for low-level disk function, such as scheduling of disk operations, head movement, error handling, etc. These routines may also be responsible for managing space on the disk.... BUT, the line between this and the file system is very fuzzy...space management functions may belong in the file system.

File Management Secondary storage devices are too crude to use directly for long-term storage. The file system provides logical objects and logical operations on those objects. A file is the basic long-term storage entity: a file is a named collection of persistent information that can be read or written. The file system supports directories -- special files that contain names of other files and associated file information.

File Management File system provides standard file operations, e.g.: file creation and deletion directory creation and deletion manipulation of files and directories: read, write, extend, rename, protect.... file copy The file system also provides general services, e.g.: backup maintaining mapping information accounting and quotas

Protection System protection is a general mechanism throughout the OS all resources objects need protection memory processes files devices protection mechanisms help to detect errors as well as to prevent malicious destruction

Command Interpreter process that handles interpretation of user input commands from keyboard (or script files) on some systems, command interpreter is a standard part of the OS on others, it’s simply a non-privileged process that interfaces to the user, permitting replacement of interpreter with others on others, there’s not really a command language (e.g., the MacIntosh has no commands in the conventional sense)

Accounting System General facility for keeping track of resource usage for all system objects May be used to enforce quotas, or to produce bill$.

The OS (a simplified view) Secondary Storage Management OS Structure The OS (a simplified view) Command Interpreter Information Services Error Handling Accounting System File System Protection System Memory Management Secondary Storage Management Process Management I/O System Hardware 14

OS Structure An OS consists of all of these components, plus lots of others, plus system service routines, plus system programs (privileged and non-privileged), plus .... The big issue: how do we organize all of this? what are the entities and where do they exist? how does these entities cooperate? Basically, how do we build a complex system that’s: performant reliable extensible

Structure Traditionally, systems such as Unix were built as a monolithic kernel: user programs file system, virtual memory, I/O drivers, process control, system services, swapping, networks, protection, interrupt handling, windows, accounting, ... OS kernel everything hardware 16

Structure Problems with monolithic kernels: hard to understand hard to modify unreliable: a bug anywhere causes a system crash hard to maintain Since the beginnings of OS design, people have sought ways to organize the OS to simplify its design and construction.

Structuring Traditional approach is layering: implement system as a set of layers, where each layer is a virtual machine to the layer above. That is, each layer provides a “machine” that has higher level features. layer 3 layer 2 layer 1 interface layer 1 layer 0 “virtual machine”interface layer 0 hardware arch. interface hardware 18

console device (commands) CPU scheduling (processes) Layering in THE The first description of this approach was Dijkstra’s THE system. user programs I/O device buffering console device (commands) memory management CPU scheduling (processes) hardware 19

THE System System was composed as a set of sequential processes. Each peforms a sequential computation. Processes communicate through explicit synchronization statements. Each process could be tested and verified independently. Each level sees a logical machine provided by lower levels. level 2 sees virtual processors level 3 sees VM (really segments) level 4 sees a “virtual console” level 5 sees “virtual” I/O drivers

Problems with Layering Systems must be hierarchical, but real systems are more complex than that, e.g., file system would like to be a process layered on VM VM would like to use files for its backing store I/O Approach is not flexible. Often has poor performance due to layer crossings. Systems are often modelled as layered structures but not built that way (for better or worse).

Microkernel Approach The organizing structure currently in vogue is the microkernel OS. Goal is minimize what goes in the kernel, and implement much of the OS as user-level processes. This results in: better reliability ease of extension and customization mediocre performance (unfortunately) First microkernel system was Hydra (CMU, 1970) Examples of microkernel systems are the CMU Mach system, Chorus (French Unix-like system), and in some ways Microsoft NT/Windows.

Microkernel System Structure user processes user mode high-level scheduling file system system processes thread system external paging network support communication kernel mode microkernel low-level VM processor control protection hardware 23