memory protection Flashcards

1
Q

how does base and limit work

A

each process has a base and limit for the memory addresses its allowed to access
whenever we want to go to memory to access something we check that the address is between the base and limit

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

what is a benefit of base and limit

A

easy to handle as we just need two registers one for the base and one for the limit

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

logical address

A

the address that the program is written to/ the process sees

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

physical address

A

where the process is actually stored

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

in base and limit how do we calculate the physical address

A

base + logical address

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

what is a negative of base and limit

A

we assume that programs start at 0 in memory so depending on when the process is loaded youll get a different set of memory addresses for it and wont know what the values will be

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

relative addressing

A

writing programs so memory access is relative to the memory address

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

what is a negative of relative addressing

A

awkward and messy

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

in which two ways can we solve the problem of base and limit making programs start at an arbitrary value

A

relative addressing
dynamically remapping addressing from logical to physical

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

what does the memory management unit do

A

contains the mappings
contains the logic for checking if an address is valid

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

how does the mmu get the correct address and what does it do if the address is incorrect

A

we check if the logical address is less that the limit
if so we add the base value and that gives us an address within the process
if its > or == the limit then we get an address error

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

how does segmentation work

A

logical addresses are stored as the segment number and the offset
the segment number is the index of the segment descriptor table which gives us the base address and the limit
we check if the offset is < the limit
if yes then we add the offset to the base to give us the physical address

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

what is a positive of segmentation

A

provides protection to processes and the segments allowing us to have different permissions per segment

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

segment

A

the logical elements that a process can be broken into which can have different permissions

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

segment descriptor table

A

stores the base and limit of each segment

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

segment number

A

index for the segment descriptor table

17
Q

what does paging do to memory

A

divides it into blocks

18
Q

what are two benefits of paging

A

memory is now in blocks making it easier to manage
makes memory management more flexible and efficient

19
Q

page

A

logical block

20
Q

frame

A

physical block

21
Q

page number

A

index for page table

22
Q

page table

A

maps a logical page to a physical frame

23
Q

what does the logical address for paging contain

A

the page number and the offset

24
Q

how does paging work

A

the logical address points to the page in the page table which maps to the frame in memory
the offset is used to find the specific byte needed in that page

25
Q

how does shared memory work with paging

A

different virtual addresses can have the same frame therefore both processes are communicating with the same block

26
Q

what is a benefit of shared memory and paging

A

can access the same block allowing things like shared libraries

27
Q

how does paging make memory management more efficient and flexible

A

translation allows two processes to have the same logical address but map to different physical addresses therefore it looks like we have more space available as we can swap pages between the disk and memory