Memory Multiplexing (3+4) Flashcards

1
Q

two main approaches to multiplexing in an OS

A

multiplex CPU operations - schedule to run concurrently on single processor
memory mult - use v mem to enable many processes to share phys mem

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

reason for multiplexing

A

limited hardware resources

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

Explain the concept of protection in memory MUX

A

2 or more processes cannot accidently overwrite each others data

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

Example of memory protection

A

kernel data being protected from user program data

a specific range of physical memory addresses is reserved for kernel data only and not user data

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

Explain the notion of controlled overlap

A

The overlapping of concurrently running process needs to be controlled for protection to be implemented properly - mechanisms needed

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

Explain the concept of translation in memory MUX

A

mapping from virtual addresses to physical address

RAM uses physical addresses and CPU uses virtual addresses giving it access to all programs that need to be run

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

What are the different types of memory found in the memory hierarchy?

A

CPU registers, cache, Ram, disk

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

What is cache memory in the OS context

A

computer memory with very short acces time used for storage of frequently used data or instructions

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

Issues that arise with memory translation

A

many virtual addresses, few physical addresses - OS needs to map to a valid physical address that is free

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

Issues that arise with memory assignment

A

Assigned phys mem space must be free and large enough for the chunk but not too large

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

Issues that arise with memory protection

A

Processes must not access same address at same time - must not overwrite each other - process 1 must execute before being swapped out

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

Issues that arise with memory sharing

A

n processes share same address in phys mem
Problem - n processes must be divided properly so that each process is assigned phys mem and that equal processes share phys address - must be protected from each other

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

Explain the notion that a process doesnt need occupy continuous mem spaces

A

Process in Vmem is swapped into main memory - can be in pieces.
Process referenced by virtual memory can be swapped into main mem and executed bit by bit

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

Explain the role of the CPU in generating physical addresses

A

Addresses generated by cpu point directly to bytes is phys mem - when CPU assigns an executing process to physical memory, the process is assigned a chunk of memory that comprises of data words

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

Define words in the OS context

A

fixed size data chunks

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

What does it mean for a phys memory space to be valid

A

large enough and free

17
Q

What is the MMU used for

A

address translation

18
Q

Briefly explain what happens in a VA to PA translation

A

MMU checks cache, maps VA to PA so that processes referenced by VA can be loaded into the phys mem at the PA

19
Q

Issue that arises with use of translating between VA and PA

A

physical memory access conflicts - 2 or more VA map to same PA

20
Q

First part of solution to physical memory access conflicts

A

OS needs to make sure that different VA space is used to address the memory needed to run every process that has been scheduled to run - each process has different VA?

21
Q

Pages?

A

Memory chuncks that processes are broken into

22
Q

program vs process

A

program - code, libraries, data needed to run

process - program executable running

23
Q

What is exe.

A

processes that has been scheduled to run by the OS and is currently suspended or running
Machine code instructions that incorporates everything needed to run the process

24
Q

Processes stack

A

executables scheduled to run by OS

stores in VMem and loaded into main mem bit by bit

25
Q

VAS

A

Virtual address space where process stack is stored - many pages of memory in secondary storage

26
Q

Describe the process of compiling a program into an exe

A

Build - removes comments, adds header file (if macros used, they will be replaced with code). Compiler will take the code and generate assembly code. Assembler converts assembly into object code (machine code). Linker links machine code with library function code. Merges other code into one exe file. Load exe into main mem

27
Q

Explain dynamic linking

A

Delays the resolving of some undefined symbols to runtime. Executable code will still have some undefined symbols and list of libraries that will provide definition for said symbols. Load the program will load these libraries

28
Q

Explain the use of stub code in dynamic linking

A

locates memory-resident library at run time - where the stub (executable code) replaces itself with the library address and executes the library at the address

29
Q

Explain static linking

A

Linking of libraries done at compile time

30
Q

Linker or link editor

A

programming language utility program that takes one or more object files generated by a compiler and combines them into a single executable file, library file or object file

31
Q

Paging

A

deciding which pages to swap into and out of main memory

32
Q

page table

A

holds mapping function

33
Q

page replacement algorithm

A

decides which pages to swap into and out of main memory

34
Q

What is loading into memory for execution

A

process with own kernel and process virtual memory parts. Kernel part contains: OS specific libraries and toher data that must be execited
Virtual memory parts: memory chuncks each storing a specific part of the process where chunks are stacked on top of each other

35
Q

What is uni-programming

A

No translation or protection - only one process runs a time and a process always runs at the same main mem space but can access any main mem address

36
Q

What is multi-programming

A

original concept of multiprogamming
each process allocated a specific space in main mem but no translation or protection - linker and loader dynamically adjusted program addresses when they were loaded to prevent overlap

37
Q

Issue with original concept of multiprogamming

A

no protection - bugs in one program could cause another process to crash

38
Q

What is multi-programming with protection

A

Two special CPU registers to enable process protection without translation
BaseAddr and LimitAddr prevented users from straying out of allocated memory addresses - if a user program tried to access illegal address - cause error and process would not execure