Docsity

Virtual Memory - Lecture Slides | CS 351, Study notes of Computer Science

Partial preview of the text

Download Virtual Memory - Lecture Slides | CS 351 and more Study notes Computer Science in PDF only on Docsity!

CS 351 : Saelee

Virtual Memory

vs. physical memory

1. consistency

Kernel virtual memory

(code, data, heap, stack)

Memory mapped region for

shared libraries

Run-time heap

(created by malloc)

User stack

(created at runtime)

Unused 0

%esp (stack pointer)

Memory

invisible to

user code

brk

0xc 0000000

0x0 8048000

0x4 0000000

Read/write segment

(.data, .bss)

Read-only segment

(.init, .text, .rodata)

Loaded from the

executable file

0xffffffff

user vs. user

kernel vs. user

high throughput

good utilization

main memory as a “cache”

for disk (or even the cloud)

CPU

Main Memory

Disk

memory

address

?

(per process)

virtual address

space

(global)

physical address

space

virtual address physical address

n m

2

n

2

m

Need: VA → PA mapping function

f : { VA } → { PA } ∪ ∅

(data not in-core)

division of labor between

kernel & MMU

(software & hardware)

e.g.,

  • relocation
  • direct/associative caching
  • table lookups

interrupt to kernel

when needed