Segmentation CS 537 – Introduction to Operating Systems.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Memory Management Paging &Segmentation CS311, CS350 & CS550.
Paging Hardware With TLB
16.317: Microprocessor System Design I
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
CS 153 Design of Operating Systems Spring 2015
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Chapter 8.3: Memory Management
Memory Management (II)
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Memory Management.
Chapter 3.2 : Virtual Memory
Memory Management (continued) CS-3013 C-term Memory Management CS-3013 Operating Systems C-term 2008 (Slides include materials from Operating System.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Virtual Memory  Early computers had a small and fixed amount to memory. All programs had to be able to fit in this memory. Overlays were used when the.
Operating System Machine Level  An operating system is a program that, from the programmer’s point of view, adds a variety of new instructions and features,
Memory Management CSE451 Andrew Whitaker. Big Picture Up till now, we’ve focused on how multiple programs share the CPU Now: how do multiple programs.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
Virtual Memory CS Introduction to Operating Systems.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Chapter 10 Memory Management Part_1. 2 Overview Basic Concepts The major tasks of the memory manger are the allocation and deallocation of main memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
8.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Implementation of Page Table Page table is kept in main memory Page-table base.
CE Operating Systems Lecture 14 Memory management.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Operating Systems Lecture 9 Introduction to Paging Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
CS 140 Lecture Notes: Virtual Memory
Memory Management.
Memory Management Paging (continued) Segmentation
CSE 120 Principles of Operating
Paging COMP 755.
COMBINED PAGING AND SEGMENTATION
CS 140 Lecture Notes: Virtual Memory
Segmentation Lecture November 2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Memory Management Paging (continued) Segmentation
Module IV Memory Organization.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
CS 140 Lecture Notes: Virtual Memory
Lecture 3: Main Memory.
CSE451 Memory Management Introduction Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Winter 2004 Module 10.5 Segmentation
CSE451 Virtual Memory Paging Autumn 2002
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Management From the memory view, we can list four important tasks that the OS is responsible for ; To know the used and unused memory partitions To allocate.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Memory Management CSE451 Andrew Whitaker.
Paging and Segmentation
CS703 - Advanced Operating Systems
CS 140 Lecture Notes: Virtual Memory
Memory Management Paging (continued) Segmentation
Chapter 8: Main Memory CSS503 Systems Programming
CSE 542: Operating Systems
Presentation transcript:

Segmentation CS 537 – Introduction to Operating Systems

Segmentation Segmentation is a technique for breaking memory up into logical pieces Each “piece” is a grouping of related information –data segments for each process –code segments for each process –data segments for the OS –etc. Like paging, use virtual addresses and use disk to make memory look bigger than it really is Segmentation can be implemented with or without paging

Segmentation logical address space OS CodeOS dataOS stack P 1 data P 1 code print function P 2 code P 2 data

Addressing Segments Let’s first assume no paging in the system User generates logical addresses These addresses consist of a segment number and an offset into the segment Use segment number to index into a table Table contains the physical address of the start of the segment –often called the base address Add the offset to the base and generate the physical address –before doing this, check the offset against a limit –the limit is the size of the segment

Addressing Segments So o < limit limitbase + Physical Address error yes no segment table logical address

Segmentation Hardware Sounds very similar to paging Big difference – segments can be variable in size As with paging, to be effective hardware must be used to translate logical address Most systems provide segment registers If a reference isn’t found in one of the segment registers –trap to operating system –OS does lookup in segment table and loads new segment descriptor into the register –return control to the user and resume Again, similar to paging

Protection and Sharing Like page tables, each process usually gets its own segment table Unlike page tables, there usually exists a global segment table for everyone –this, however, is usually used by OS Access rights for segment are usually included in table entry Multiple processes can share a segment

Protection and Sharing LDT baselimit LDT baselimit GDT baselimit

Segmentation Issues Entire segment is either in memory or on disk Variable sized segments leads to external fragmentation in memory Must find a space big enough to place segment into May need to swap out some segments to bring a new segment in

Segmentation with Paging Most architectures support segmentation and paging Basic idea, –segments exist in virtual address space –base address in segment descriptor table is a virtual address –use paging mechanism to translate this virtual address into a physical address Now an entire segment does not have to be in memory at one time –only the part of the segment that we need will be in memory

Linear Address The base address gotten from the segment descriptor table is concatenated with the offset This new address is often referred to as a linear address This is the address that is translated by the paging hardware

offsetdescriptor limitbase segment table + virtual address from user linear address PT directorypage table page frame directorypageoffset directory base