Week 5 and 6 Flashcards

1
Q

What are the three different stages of Binding Instructions and Data

A
  1. Compile (and linkage) time
  2. Load Time - When loader loads program into memory, addresses are resolved
  3. Execution Time - programs move in memory - hardware support required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Def: Execution time

A

Similar to Compile Time, but hardware looks after translation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Def: Logical Address

A

Address generated by CPU, also known as virtual address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Def: Physical Address

A

location in physical memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the similarities and differences of Logical and Physical addresses ?

A
  • are the same in compile and load time address binding
  • differ in execution time binding

user program only deals with logical addresses (never sees physical)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Def: MMU

A

Hardware that maps virtual to physical address

- one simple approach is to have a single register that is added to every virtual address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is contiguous allocation?

A

Main memory is divided into two parts:

  1. Operating system
  2. user memory (everything else)

with this approach each process is contained in a single contiguous section of memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three general storage allocation approaches?

A
  1. First Fit (use the first hold on the free list that is big enough, search from previous location/ only part of list)
  2. Best fit (smallest block that is large enough, search entire list)
  3. Worst Fit (largest block, worst algorithm)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Def: Internal fragmentation

A

if allocate memory in units larger than single byte, last block only partially used (some memory no used because more allocated to process then needed)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Def: external fragmentation

A

lots of small holes spread throughout memory, none big enough to satisfy a request (worst fit tries to reduce this, compaction - move blocks requires execution-time binding)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the 50 percent rule? (to do with Fragmentation Trade off)

A

N allocated blocks, 0.5 N lost to fragmentation (1/3 of memory unusable) `

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the two Fragmentation Trade offs?

A

Allocate in smaller unit - less internal fragmentation, overhead in managing)
Allocate in larger units - easier to manage, more internal fragmentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Def: Dynamic Loading

A

routines are loaded with needed (not necessarily when program loaded)
Does not require any special support from operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Def: Static linking

A

when all of the modules including system libraries are linked together at compile time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Def: Dynamic linking

A

uses indirect call through table
- table initially points at stubs
- when the routine is called the first time, the routing is leaded
(primarily used for common libraries)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Def: Overlays

A

program is broken into multiple parts - one common part of program always in memory - other parts of program are replaced as needed

17
Q

Def: Swapping

A

Processes can be temporarily stored (swapped) from memory to a backing store
- make room for higher priority processes

18
Q

Describe paging.

A
  • Phys. mem. divided into frames (512 bytes to 8K sizes typically)
  • Logical memory is divided into pages (same size as frames)
  • if process needs n pages, find n free frames in memory
  • table translates from each page to the appropriate frame
  • no external fragmentation (still internal)
19
Q

What is a page tables ?

A

A page table is the data structure used by virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses
- each process has its own

20
Q

What is a frame table?

A

Keeps track of allocated and free frames

21
Q

Def: TLB

A

Translation look-aside buffer

- a memory cache that is used to reduce the time taken to access a user memory location (part of the the MMU)

22
Q

What are the three ways to reduce the memory requirements of the page tables?

A
  1. Hierarchical Tables (multiple tables -> forward-mapped page table, page number is split into one or more sections)
  2. Hashed Page Tables (store page entries in a hash table, hashed by page number)
  3. Inverted pages (one entry for each frame - unlike other two which have separate tables per process)
23
Q

What is virtual memory?

A

Separation of Logical address from Physical Address

Virtual memory is a memory management capability that uses hardware and software to allow a computer to compensate for physical memory shortages by temporarily transferring data from random access memory (RAM) to storage

24
Q

What is Demand Paging?

A
  • All pages of the process are swapped out

- swap each page in as it is needed

25
Q

Locality of reference

A

same values , or related storage locations, are frequently accessed depending on the memory access pattern

26
Q

Def: memory resident

A

Pages that are in memory

27
Q

What is the Traditional I/O for memory mapped files?

A

Library accumulates until a buffer is filled and then calls O/S to write the buffer to the fule

28
Q

What is over allocation?

A

running more processes than memory

29
Q

What is the dirty bit?

A

Indicates that the page has been changed (dirty)