Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.

Slides:



Advertisements
Similar presentations
Lesson 4 0x Operating Systems.
Advertisements

Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Operating System.
Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Chap 2 System Structures.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Operating Systems. What is an Operating System? A layer of software between users/applications and the hardware. The first program loaded onto a computer.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Common System Components
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Computer for Health Sciences
Chapter 3 Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Computer Organization ANGELITO I. CUNANAN JR. 1. What is Computer?  An electronic device used for storing and processing data.  It is a machine that.
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
Tutorial 6 Memory Management
hardware and operating systems basics.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Dr Damitha Karunaratna University of Colombo school of computing
Systems Security & Audit Operating Systems security.
Operating System. Architecture of Computer System Hardware Operating System (OS) Programming Language (e.g. PASCAL) Application Programs (e.g. WORD, EXCEL)
Software GCSE COMPUTING.
RjpSystem Level Programming Operating Systems 1 Having fun withy the Unix Operating System Praxis Week 7 Rob Pooley.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Section 3.1: Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
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.
Processes Introduction to Operating Systems: Module 3.
Operating System Principles And Multitasking
Computer Systems Week 14: Memory Management Amanda Oddie.
Operating System Concepts Part II Department of Computer Science Southern Illinois University Edwardsville Spring, 2009 Dr. Hiroshi Fujinoki
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
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.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Week1: Introduction to Computer Networks. Copyright © 2012 Cengage Learning. All rights reserved.2 Objectives 2 Describe basic computer components and.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
Operating Systems: Summary INF1060: Introduction to Operating Systems and Data Communication.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
A+ Guide to Managing and Maintaining Your PC, 7e Chapter 2 Introducing Operating Systems.
Introduction to Operating Systems Concepts
Introduction to Computing Systems
Lesson 4 0x Operating Systems.
Hardware and OS Design and Layout.
CSC 482/582: Computer Security
Processes and threads.
Operating System Structure
Operating Systems Concepts
CIT 480: Securing Computer Systems
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Chapter 15, Exploring the Digital Domain
Chapter 2: System Structures
Main Memory Background Swapping Contiguous Allocation Paging
Memory Allocation CS 217.
Lecture Topics: 11/1 General Operating System Concepts Processes
Lecture 1 Runtime environments.
Software - Operating Systems
CSE 153 Design of Operating Systems Winter 2019
Computer Organization & Compilation Process
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Operating System Concepts
Operating System Concepts
Presentation transcript:

Operating Systems Concepts 1

A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory (RAM), input/output (I/O) devices, and long-term storage. 2 Disk Drive RAM CPU I/O

OS Concepts An operating system (OS) provides the interface between the users of a computer and that computer’s hardware. – An operating system manages the ways applications access the resources in a computer, including its disk drives, CPU, main memory, input devices, output devices, and network interfaces. – An operating system manages multiple users. – An operating system manages multiple programs. 3

Multitasking Give each running program a “slice” of the CPU’s time. The CPU is running so fast that to any user it appears that the computer is running all the programs simultaneously. 4 Public domain image from

The Kernel The kernel is the core component of the operating system. It handles the management of low-level hardware resources, including memory, processors, and input/output (I/O) devices, such as a keyboard, mouse, or video display. 5 User Applications Non-essential OS Applications The OS Kernel CPU, Memory, Input/Output Userland Operating System Hardware

The Kernel(2) Most operating systems define the tasks associated with the kernel in terms of a layer metaphor, with the hardware components, such as the CPU, memory, and input/output devices being on the bottom, and users and applications being on the top. 6 User Applications Non-essential OS Applications The OS Kernel CPU, Memory, Input/Output Userland Operating System Hardware

Input/Output The input/output devices of a computer include things like its – keyboard, – mouse, – video display, and – network card, as well as other more optional devices, like – a scanner, – Wi-Fi interface, – video camera, – USB ports, etc. 7

Input/Output Each such device is represented in an operating system using a device driver, which encapsulates the details of how interaction with that device should be done. – The application programmer interface (API), which the device drivers present to application programs, allows those programs to interact with those devices at a fairly high level, while the operating system does the “heavy lifting” of performing the low-level interactions that make such devices actually work. – API presents an abstract device, whereas the device driver translates to the specifics of particular hardware controllers – API may also provide even higher level abstractions (e.g., files vs. disk blocks) 8

System Calls 9 User applications don’t communicate directly with low-level hardware components, and instead delegate such tasks to the kernel via system calls. System calls are usually contained in a collection of programs, that is, a library such as the C library (libc), and they provide an interface that allows applications to use a predefined series of APIs that define the functions for communicating with the kernel. – Examples of system calls include those for performing file I/O (open, close, read, write) and running application programs (exec).

Processes A process is an instance of a program that is currently executing. The actual contents of all programs are initially stored in persistent storage, such as a hard drive. In order to be executed, a program must be loaded into random-access memory (RAM) and uniquely identified as a process. In this way, multiple copies of the same program can be run as different processes. – For example, we can have multiple copies of MS Powerpoint open at the same time. 10

Process IDs Each process running on a given computer is identified by a unique nonnegative integer, called the process ID (PID). Given the PID for a process, we can then associate its CPU time, memory usage, user ID (UID), program name, etc. 11

File Systems A filesystem is an abstraction of how the external, nonvolatile memory of the computer is organized. A file = logically named, variable length, persistent memory unit Operating systems typically organize files hierarchically into folders, also called directories. Each folder may contain files and/or subfolders. Thus, a volume, or drive, consists of a collection of nested folders that form a tree. The topmost folder is the root of this tree and is also called the root folder. 12

File System Example 13

File Permissions File permissions are checked by the operating system to determine if a file is readable, writable, or executable by a user or group of users. Logical separation (code and configuration data are used to decide whether access is allowed) Usually implement ACLs in some form – permissions are associated with the file itself May also use encryption – File level – Volume/disk level 14

File Permissions In Unix-like OS’s, a file permission matrix shows who is allowed to do what to the file. Files have – owner permissions, which show what the owner can do, and – group permissions, which show what some group id can do, and – world permissions, which give default access rights. 15

Memory Management The RAM memory of a computer is its address space. It contains both the code for the running program, its input data, and its working memory. For any running process, it is organized into different segments, which keep the different parts of the address space separate. As we will discuss, security concerns require that we never mix up these different segments. 16

Memory Organization Text. Actual (binary) machine code of the program. Data. Static program variables initialized in program code. BSS. Static variables that are uninitialized – named for an antiquated acronym for block started by symbol Heap, a.k.a. dynamic segment. stores persistent data objects generated during the execution of a process. Stack. Stack data structure that grows downwards and is used for keeping track of the call structure of subroutines (e.g., methods in Java and functions in C) and their arguments. 17

Memory Layout 18

Virtual Memory There is generally not enough computer memory for the address spaces of all running processes. Nevertheless, the OS gives each running process the illusion that it has access to its complete (contiguous) address space. 19 ATM

Virtual Memory In reality, this view is virtual, in that the OS supports this view, but it is not really how the memory is organized. Instead, memory is divided into pages, and the OS keeps track of which ones are in memory and which ones are stored out to disk. 20 ATM

Page Faults 21 Process 1. Process requests virtual address not in memory, causing a page fault. 2. Paging supervisor pages out an old block of RAM memory. 3. Paging supervisor locates requested block on the disk and brings it into RAM memory. “read ” “Page fault, let me fix that.” Blocks in RAM memory: Paging supervisor External disk old new

Virtual Machines Virtual machine: A view that an OS presents that a process is running on a specific architecture and OS, when really it is something else. E.g., a windows emulator on a Mac. Benefits: – Hardware Efficiency – Portability – Security – Management 22 Public domain image from