CSE 451: Operating Systems Winter 2004 Module 10.5 Segmentation

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Paging Hardware With TLB
4/14/2017 Discussed Earlier segmentation - the process address space is divided into logical pieces called segments. The following are the example of types.
Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich.
CS 153 Design of Operating Systems Spring 2015
CS 153 Design of Operating Systems Spring 2015
Memory Management 2010.
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.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
Memory Management CSCI 444/544 Operating Systems Fall 2008.
Segmentation CS 537 – Introduction to Operating Systems.
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.
CSE451 Operating Systems Winter 2012 Memory Management Mark Zbikowski Gary Kimura.
Operating Systems ECE344 Ding Yuan Memory Management Lecture 7: Memory Management.
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.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
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.
1 Address Translation Memory Allocation –Linked lists –Bit maps Options for managing memory –Base and Bound –Segmentation –Paging Paged page tables Inverted.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
CSE 451: Operating Systems Fall 2010 Module 10 Memory Management Adapted from slides by Chia-Chi Teng.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
CSE 451: Operating Systems Winter 2015 Module 11 Memory Management Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska, Levy,
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
2010INT Operating Systems, School of Information Technology, Griffith University – Gold Coast Copyright © William Stallings /2 Memory Management.
MEMORY MANAGEMENT. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Memory Management.
CSE 120 Principles of Operating
CSE 451: Operating Systems Winter 2007 Module 10 Memory Management
COMBINED PAGING AND SEGMENTATION
CSE451 Operating Systems Winter 2011
Simple/Basic Segmentation
CSE 451: Operating Systems Winter 2010 Module 10 Memory Management
CSE 451: Operating Systems Winter 2014 Module 11 Memory Management
Chapter 8: Main Memory.
Virtual Memory Partially Adapted from:
Operating System Main Memory
Main Memory Background Swapping Contiguous Allocation Paging
CS399 New Beginnings Jonathan Walpole.
Lecture 3: Main Memory.
CSE 451: Operating Systems Autumn 2005 Memory Management
Operating System Chapter 7. Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2004 Memory Management
CSE 451: Operating Systems Winter 2007 Module 10 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2009 Module 10 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Lecture 7: Flexible Address Translation
Memory Management CSE451 Andrew Whitaker.
CSE 451: Operating Systems Winter 2004 Module 10 Memory Management
Evolution in memory management techniques
CSE 451: Operating Systems Lecture 10 Paging & TLBs
Segmentation Observation: Programmers don’t think in pages!
CS703 - Advanced Operating Systems
CSE451 Operating Systems Winter 2009
COMP755 Advanced Operating Systems
Chapter 8: Main Memory CSS503 Systems Programming
CSE 451: Operating Systems Autumn 2010 Module 10 Memory Management
Virtual Memory and Paging
Chapter 7 Memory Management
Page Main Memory.
Presentation transcript:

CSE 451: Operating Systems Winter 2004 Module 10.5 Segmentation Ed Lazowska lazowska@cs.washington.edu Allen Center 570 1

© 2004 Ed Lazowska & Hank Levy Segmentation Paging mitigates various memory allocation complexities (e.g., fragmentation) view an address space as a linear array of bytes divide it into pages of equal size (e.g., 4KB) use a page table to map virtual pages to physical page frames page (logical) => page frame (physical) Segmentation partition an address space into logical units stack, code, heap, subroutines, … a virtual address is <segment #, offset> 2/23/2019 © 2004 Ed Lazowska & Hank Levy

© 2004 Ed Lazowska & Hank Levy What’s the point? More “logical” a linker takes a bunch of independent modules that call each other and linearizes them they are independent; treat them as such Facilitates sharing and reuse a segment is a natural unit of sharing – a subroutine or function A natural extension of variable-sized partitions variable-sized partition = 1 segment/process segmentation = many segments/process 2/23/2019 © 2004 Ed Lazowska & Hank Levy

© 2004 Ed Lazowska & Hank Levy Hardware support Segment table multiple base/limit pairs, one per segment segments named by segment #, used as index into table a virtual address is <segment #, offset> offset of virtual address added to base address of segment to yield physical address 2/23/2019 © 2004 Ed Lazowska & Hank Levy

© 2004 Ed Lazowska & Hank Levy Segment lookups segment table base limit physical memory segment 0 segment # offset segment 1 virtual address segment 2 yes <? + segment 3 no segment 4 raise protection fault 2/23/2019 © 2004 Ed Lazowska & Hank Levy

© 2004 Ed Lazowska & Hank Levy Pros and cons Yes, it’s “logical” and it facilitates sharing and reuse But it has all the horror of a variable partition system except that linking is simpler, and the “chunks” that must be allocated are smaller than a “typical” linear address space What to do? 2/23/2019 © 2004 Ed Lazowska & Hank Levy

Combining segmentation and paging Can combine these techniques x86 architecture supports both segments and paging Use segments to manage logical units segments vary in size, but are typically large (multiple pages) Use pages to partition segments into fixed-size chunks each segment has its own page table there is a page table per segment, rather than per user address space memory allocation becomes easy once again no contiguous allocation, no external fragmentation Segment # Page # Offset within page Offset within segment 2/23/2019 © 2004 Ed Lazowska & Hank Levy

© 2004 Ed Lazowska & Hank Levy Linux: 1 kernel code segment, 1 kernel data segment 1 user code segment, 1 user data segment N task state segments (stores registers on context switch) 1 “local descriptor table” segment (not really used) all of these segments are paged Note: this is a very limited/boring use of segments! 2/23/2019 © 2004 Ed Lazowska & Hank Levy