Operating System Organization

Slides:



Advertisements
Similar presentations
FatMax Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 LicenseCreative Commons Attribution-NonCommercial-ShareAlike 2.5.
Advertisements

Operating Systems Manage system resources –CPU scheduling –Process management –Memory management –Input/Output device management –Storage device management.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 3 Process Description and Control
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6 Implementing Processes, Threads, and Resources.
Process Description and Control
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
© 2004, D. J. Foreman 1 O/S Organization. © 2004, D. J. Foreman 2 Topics  Basic functions of an OS ■ Dev mgmt ■ Process & resource mgmt ■ Memory mgmt.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
OS Spring’03 Introduction Operating Systems Spring 2003.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Chapter 6 Implementing Processes, Threads, and Resources.
CS4315A. Berrached:CMS:UHD1 Operating System Structures Chapter 3.
OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it.
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Operating Systems.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Protection and the Kernel: Mode, Space, and Context.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
 Create an abstract machine environment  A nicer environment than bare hardware  Consists of multiple, autonomous abstract components  Components.
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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Processes Introduction to Operating Systems: Module 3.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Operating System Organization Chapter 3 Michelle Grieco.
Chapter 3 Operating System Organization
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.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Operating Systems •The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that.
Operating Systems: A Modern Perspective, Chapter 6
KERNEL ARCHITECTURE.
O.S Lecture 13 Virtual Memory.
OS Organization.
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Chapter 2: System Structures
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Threads Chapter 4.
Process Description and Control
Operating Systems: A Modern Perspective, Chapter 3
OS Organization.
Implementing Processes, Threads, and Resources
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Outline Operating System Organization Operating System Examples
O/S Organization © 2004, D. J. Foreman.
O/S Organization © 2004, D. J. Foreman.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Operating System Organization

Create the Abstractions Purpose of an OS Coordinate Use of the Abstractions Processes The Abstractions Create the Abstractions

Process –What are involved ? All of the information needed to keep track of a process when switching is kept in a data package called a process control block.

The process control block typically contains: An ID number that identifies the process Pointers to the locations in the program and its data where processing last occurred Register contents States of various flags and switches

More … Pointers to the upper and lower bounds of the memory required for the process A list of files opened by the process The priority of the process The status of all I/O devices needed by the process

Thrashing This process swapping happens without direct user interference, and each process gets enough CPU cycles to accomplish its task in a reasonable amount of time. Trouble can come, though, if the user tries to have too many processes functioning at the same time. The operating system itself requires some CPU cycles to perform the saving and swapping of all the registers, queues and stacks of the application processes.

Thrashing If enough processes are started, and if the operating system hasn't been carefully designed, the system can begin to use the vast majority of its available CPU cycles to swap between processes rather than run processes. When this happens, it's called thrashing, and it usually requires some sort of direct user intervention to stop processes and bring order back to the system.

Thrashing When referring to a computer, "thrashing" or "disk thrashing" is a term used to describe when the hard disk drive is being overworked by moving information between the system memory and virtual memory excessively. Thrashing is often caused when the system does not have enough memory, the system swap file is not properly configured, and/or to much is running on the computer and it has low system resources.

Thrashing When thrashing occurs a user will notice the computer hard disk drive always working - a decrease in system performance. Thrashing is bad on a hard disk drive because of the amount of work the hard disk drive has to do and if is left unfixed will likely cause an early failure of the hard disk drive.

Resolve hard disk drive thrashing Increase the amount of RAM in the computer. Decrease the amount of programs being ran on the computer. Adjust the size of the swap file.

Swap Files A file stored on the computer hard disk drive that is used as a temporary location to store information that is not currently being used by the computer RAM. By using a swap file a computer has the ability to use more memory then what is physically installed in the computer. However, users who are low on hard disk space may notice that the computer runs slower because of the inability of the swap file to grow in size. 

Swap Files OS Swap File Name Windows 95 / 98 / ME WIN386.SWP Windows NT / 2000 / XP PAGEFILE.SYS

OS Requirements Provide resource abstractions Process abstraction of CPU/memory use Address space Thread abstraction of CPU within address space Resource abstraction “Anything a process can request that can block the process if it is unavailable” NT uses “object abstraction” to reference resources File abstraction of secondary storage use

DOS -- Resource Abstraction Only Program Program Libraries Program OS Services ROM Routines Processor(s) Main Memory Devices

OS Requirements (cont) Provide resource abstractions Manage resource sharing Time/space-multiplexing Exclusive use of a resource Isolation Managed sharing

Abstraction & Sharing Libraries OS Services Abstraction Manage sharing Program State Process Program State Process Libraries Program State Process OS Services Abstraction Manage sharing ROM Routines Processor(s) Main Memory Devices

OS Design Constraints Performance Protection and security Correctness Maintainability Commercial factors Standards and open systems

Performance The OS is an overhead function  should not use too much of machine’s resources Minimum functionality is to implement abstractions Additional function must be traded off against performance DOS: one process UNIX: low level file system

Protection & Security Multiprogramming  resource sharing Therefore, need software-controlled resource isolation Security policy: Sharing strategy chosen by computer’s owner Protection mechanism: Tool to implement a family of security policies

Correctness & Maintainability Security depends on correct operation of software  trusted vs untrusted software Maintainability relates to ability of software to be changed If either is sufficiently important, can limit the function of the OS Guiding a manned spaceship Managing a nuclear reactor

Device Management … Device-Independent Part Device-Dependent Part

Process, Thread, and Resource Management Abstraction Process Abstraction Generic Resource Manager Multiprogramming Other … Primary Memory Abstract Resources Processor

Memory Management Process Manager Isolation & Sharing Virtual Memory Block Allocation Process Manager Primary Memory Storage Devices

Exclusive Access to a Resource Processor Process A Process B A’s Protected Object Supervisor Program

Processor Modes Mode bit: Supervisor or User mode Supervisor mode Can execute all machine instructions Can reference all memory locations User mode Can only execute a subset of instructions Can only reference a subset of memory locations

Kernels The part of the OS critical to correct operation (trusted software) Executes in supervisor mode The trap instruction is used to switch from user to supervisor mode, entering the OS

Supervisor and User Memory Space User Process Supervisor Process Supervisor Space

Procedure Call and Message Passing Operating Systems send(…, A, …); receive(…, B, …); receive(…A, …); … send(…, B, …); send/receive call(…); trap return;

System Call Using the trap Instruction … fork(); Trap Table Kernel fork() { … trap N_SYS_FORK() } sys_fork() sys_fork() { /* system function */ … return; }

A Thread Performing a System Call User Space Kernel Space Thread fork(); sys_fork() { }

Basic Operating System Organization File Manager Process, Thread & Resource Manager Memory Manager Device Manager Processor(s) Main Memory Devices

OS System Call Interface The UNIX Architecture Interactive User Libraries Commands Application Programs … OS System Call Interface Trap Table Device Driver Monolithic Kernel Module Process Management Memory Management File Management Device Mgmt Infrastructure Device Driver … Driver Interface Device Driver

Microkernel Organization Process Process Libraries Process User Supervisor Server Server Server Device Drivers Microkernel Processor(s) Main Memory Devices

Windows NT Organization Process Process T T Process T T T T Libraries T T T Process Management Memory Management File Management Device Mgmt Infrastructure Subsystem Subsystem Subsystem User Supervisor I/O Subsystem NT Executive NT Kernel Hardware Abstraction Layer Processor(s) Main Memory Devices

Hardware Abstraction Layer Monitoring the Kernel Process Process T Task Manager T Process T T T T Libraries T T T pview pstat Subsystem Subsystem Subsystem User Supervisor I/O Subsystem NT Executive NT Kernel Hardware Abstraction Layer Processor(s) Main Memory Devices