OS Processes and Memory Review

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 25

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

26 Terms

1

context switching; savings, loading, updating data

What does an OS do when it switches processes?

New cards
2

Running

Ready Blocked

What are the states and state transitions for a process, and can you draw a diagram depicting them?

New cards
3

kernel mode - privledged

user mode - unprivledged

What are the two processor modes of an OS that we discussed?

New cards
4

Switching from Kernel to User, vice verse:

A trap instruction is executed that jumps to the kernel and raises the processor mode.
A return-from-trap instruction lowers the processor mode and jumps back to the calling code in the application.

How does an OS switch between processor modes?

New cards
5

fork(): Creates a new child process as an exact copy of the parent.

exec(): Replaces the current process image with a new program.

What is fork()? What is exec()? What’s the difference?

New cards
6

Interrupt timer - interrupt the processor, forcing it to give
control back to the OS

Interrupt handler - executed when interrupt is triggered, yielding control back to OS

How does the OS switch processes?

New cards
7

Turnaround Time = Completion Time − Arrival Time

What is turnaround time?

New cards
8

Ensures no process is starved, getting a fair share of CPU time

What is fairness?

New cards
9

FIFO - If a long job arrives first, all shorter jobs must wait

SJF - A long job may never execute if short jobs keep arriving

Can you give examples that make FIFO and SJF unideal?

New cards
10
<p><span><strong>overlapping I/O and CPU execution</strong></span></p><p></p>

overlapping I/O and CPU execution

What is overlap in terms of job scheduling?

New cards
11

Lottery scheduling assigns random tickets to processes, and a ticket is drawn randomly to decide execution.

Issue: It lacks deterministic guarantees; a process might get unlucky and starve.

Can you describe a lottery scheduler, and can you identify where it might falter?

New cards
12

Isolation (processes don’t interfere)

Security (no direct memory access)

Efficient memory management

Why do we virtualize memory?

New cards
13

ease of use

isolation

protection

What are the goals of memory virtualization, and why are they important?

New cards
14

The range of memory addresses a process can use.

What is an address space?

New cards
15

Code: Program instructions 00

Stack: Function calls and local variables 11

Heap: Dynamically allocated memory 01

What are the three main memory components of a running process?

New cards
16
  1. We want to implement virtualizing memory in a transparent way.
    • Invisible to running programs.

  2. We want the system to be as efficient as possible.
    • Don’t slow the programs down.
    • Don’t use up more memory than necessary (data structures).

  3. We want to protect processes from one another.
    • Also want to protect the OS

What are the goals of memory abstraction, and why are they important?

New cards
17

Stack: Managed automatically, grows downward, used for function calls and local variables.

Heap: Dynamically allocated memory, grows upward, managed manually.

What is different (functionally) between a stack and a heap?

New cards
18

conversion of virtual into physical addresses

What is address translation?

New cards
19

Utilization of a base and bounds system.


In this system, there are two hardware registers, one called the base register and another called the bounds register. Every program is written and compiled as if to be loaded at address 0x0. The OS sets the base register to where it wants the process to be in
physical memory. The processor then translates:


physical = virtual + base

How does the early incarnation of dynamic relocation for address translation work?

New cards
20

Uses interrupts and system calls to transition from user mode to kernel mode.

How does an OS switch between processor modes?

New cards
21

A register that stores the upper memory limit for a process to prevent it from accessing out-of-bounds memory.

What is the bounds register?

New cards
22

Unused memory inside an allocated block due to fixed-size allocation

What is internal fragmentation?

New cards
23

Divides memory into logical segments, using a base bounds register of address space (code, stack, heap)

What is segmentation, and why did we implement it?

New cards
24

Explicit - which system an address refers too - top two bits refer to the segment, the rest offset. 00 code, 01 heap, stack 11.

Implicit - how the address was formed - instruction ptr → code, stack ptr → stack, any other is heap

What are the two approaches to address translation for segmentation?

New cards
25

Shared page mappings

What do we need to share certain memory segments between address spaces?

New cards
26

Wasted memory between allocated blocks due to variable-sized allocation.

What is external fragmentation?

New cards
robot