address spaces (week 2) Flashcards

1
Q

multiprogramming

A

OS would switch between processes when one decided to do an I/O

this increased CPU utilization and was more efficient

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

time sharing

A

leave processes in memory while switching between them, allowing the OS to implement time sharing efficiently

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

what is a key problem that arises with time sharing?

A

protection: allowing multiple programs to reside concurrently in memory makes protection an important issue (came about because of time sharing); you don’t want a process to be able to read, or worse, write some other process’s memory

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

address space of a process

A

contains all of the memory state of the running program: the code (instructions) has to live in memory somewhere, and thus they are in the address space / also the stack and heap

CODE - STACK - HEAP

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

Describe this abstraction of address space

A
  1. program code: where instructions live; easy to allocate since it is static and we know it won’t grow
  2. heap: contains the dynamically allocated data structures, grows positively (addresses get larger)
  3. stack is at the bottom: grows negative (addresses get smaller), contains local variables, arguments to routines, return values, etc.

heap and stack grow towards each other

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

what do we mean when we say that the OS is virtualizing memory?
(how can the OS build this abstraction of a private, potentially large address space for multiple running processes (all sharing memory) on top of a single, physical memory?

A

the running program thinks it is loaded into memory at a particular address (say 0) and has a potentially large address space (say 32-bits or 64 bits); the reality is quite different

when a process tries to perform a load at address 0 (which we will call a virtual address) somehow the OS, in tandem with some hardware support, will have to make sure the load doesn’t actually go to physical address 0 but rather to physical address 320 KB (where A is loaded into memory).

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

What are the goals of virtual memory?

A
  1. transparency: the OS should implement virtual memory in a way that is invisible to the running program; the program shouldn’t be aware of the fact that memory is virtualized; the program behaves as if it has its own private physical memory; it is the OS (and hardware) that does all the work to multiplex memory among many different jobs, and hence implements the illusion
  2. efficiency: time and space, for this, the OS has to rely on hardware support, including hardware features such as TLBs (595!)
  3. protection: the OS should protect processes from one another as well as the OS itself from processes; for e.g., when one process performs a load, a store, or an instruction fetch, it should not be able to access or affect in any way the memory contents of any other process or the OS itself (that is, anything OUTSIDE of the address space)
    - -> protections enables us to deliver the property of isolation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

summary of virtual memory (a major OS subsystem)

A

The VM system is responsible for providing the illusion of a large, sparse, private address space to programs, which hold all of their instructions and data therein. The OS, with some serious hardware help, will take each of these virtual memory references, and turn them into physical addresses, which can be presented to the physical memory in order to fetch the desired information. The OS will do this for many processes at once, making sure to protect programs from one another, as well as protect the OS. The entire approach requires a great deal of mechanism (lots of low-level machinery) as well as some critical policies to work;

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