1 / 13

The Abstraction Address Spaces

The Abstraction Address Spaces. Sung Gon Kim ( skim@dcslab.snu.ac.kr ) Yeong Ouk Kim ( kim331@snu.ac.kr ) Hwa Jung Kim ( hkim@dcslab.snu.ac.kr ) School of Computer Science and Engineering Seoul National University. Table of Contents. Motivation Early System and Multiprogramming

nromeo
Download Presentation

The Abstraction Address Spaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The AbstractionAddress Spaces Sung Gon Kim (skim@dcslab.snu.ac.kr) Yeong Ouk Kim (kim331@snu.ac.kr) Hwa Jung Kim (hkim@dcslab.snu.ac.kr) School of Computer Science and Engineering Seoul National University

  2. Table of Contents • Motivation • Early System and Multiprogramming • Time Sharing • Address Spaces • Causation • Definition • Virtual Memory • Goal • Summary

  3. Motivation • Early System • No abstraction • One process occupies entire memory at a time Expensive machines, BUT low utilization 0 KB Operating System - code, data, etc. - 64 KB Current Program - code, data, etc. - max Physical Memory

  4. Motivation Long program-debug cycles 0 KB Operating System - code, data, etc. - 64 KB Process A Process B I/O Operation! Process A Process B max Disk Physical Memory • Multiprogramming • Switching multi processes between I/O operations • Improve utilization of the CPU  Efficient!

  5. Motivation Saving state is Too Slow 0 KB Operating System - code, data, etc. - 64 KB Process A Process B Time’s UP! Process A Process B max Disk Physical Memory • Time Sharing Approach #1 • Granting time-slice for each process

  6. Motivation Protection between multiple states 0 KB Operating System - code, data, etc. - 64 KB free 128 KB Process C - code, data, etc. - 192 KB Process B - code, data, etc. - 256 KB free 320 KB Process B - code, data, etc. - 384 KB free 448 KB free 512 KB Physical Memory • Time Sharing Approach #2 • Granting time-slice for each process • Leaving state of multiple processes in physical memory

  7. Address Spaces 0 KB Program Code 1 KB Heap 2 KB free 63 KB Stack 64 KB Address Space • Protection from read and write from other processes • Address Space: Abstraction of physical memory provided by OS • Address Space of a process • Code: Code of the program • Stack: Track function call, parameters, return values • Heap: Dynamically-allocated, user-managed memory • But… • In reality, a process does NOT occupy entire memory • Hence the abstraction is required for OS to virtualize memory

  8. Address Spaces in C #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { printf("location of code: %p\n", (void *)main); printf("location of head: %p\n", (void *)malloc(1)); int x = 3; printf("location of stack: %p\n", (void *)&x); return x; } 0x40057d Program Code 0x1548010 Heap location of code: 0x40057d location of code: 0x1548010 location of code: 0x7ffdc614670c free Stack 0x7ffdc614670c Address Space 64-bit Linux Machine

  9. Virtual Memory Operating System …… …… Process A’s Address Space Physical Memory Process B’s Address Space Disk • Hide all physical aspects of memory from users • Memory is logically unbounded • Only portions of virtual address space are in physical memory at any one time

  10. Goal • Transparency • The program is NOT aware that the memory is virtualized • Efficiency • Time: Does not affect the performance negatively • Space: Occupy minimal space for virtualization • For such efficiency, OS need hardware support • E.g., TLB for time efficiency • Protection • Protect a process from another process or even from the OS • Resulting in isolation among processes

  11. Summary • Motivation • From early system to time sharing • Address Spaces • An abstraction of physical memory from the OS • To provide protection • Memory Virtualization • With the abstraction, OS can virtualize the memory • Goal • Transparency: Virtualization itself is invisible • Efficiency: Time and Space • Protection: From other processes and OS

  12. Looking Forward • Mechanisms needed to virtualize memory • Address Translation • Segmentation • Paging • Policies about how to manage memory space • Free Space Management

  13. Discussions in the Class • Motivation: From Multiprogramming to Time Sharing • Long program-debug cycle • Lack of Interaction • Although the book mentioned “long program-debug cycle” as the main issue, we believe that “lack of interaction” cannot be overlooked • Space efficiency issue to virtualize memory • Similar to TLB which was presented as hardware support for time efficiency, Multi-Level Page Table is one example of hardware support for space efficiency

More Related