9.4 Protection and Virtual memory Flashcards
What does memory protection refer to (what are programs and the kernal allowed to do)
- Ensuring programs do not access other parts of memory
- Kernel can access anything
Describe how memory is protected (ab as)
- Only allowed access to memory in range ab, ab + as
- ink flag for kernel
What instructions does the kernel use for managing program memory space protection
- SETAB SETAS
How does memory protection change existing data access instructions (safeguarding)
- Conditional check for ink, otherwise check if in range
Works same for branch instructions
What happens if this code executes on MacOS
- Returns valid pointer (doesn’t work on linux)
- Would cause errors down the line as computer does not have 10TB
What is virtual memory
- Abstraction such that program thinks there is more memory than available
- Managed by kernel
What is a memory page
- Similar to cache blocks, data is copied from disk to main memory (and vice versa) in pages (set of memory)
- Doesn’t make sense to just copy accross single word, when often sequential access is needed.
How do virtual addresses work
- Page table stores actual address (maps virtual to actual incl memory type and address etc.)
What are some properties of the page table (use, no entries, entry size etc.)
What is a page fault
When memory is on disk not main memory and needs to be copied (ie cache miss)
What is page replacement (eviction)
Page is evicted from main memory back to disk
What is the point of a Translation Lookaside Buffer (TLB)
Caches addreses of data (LRU), so no need to consult page table
How does protection apply to virtual memory
Read, write, execute permission bits