






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







































00 01 10
CPU
40K MAXsys 40K 512 R/X
Segment table generalizes Base & Bound Segment Table Base Register 37
Base Bound Access
Revisiting fork() pid = fork(); if (pid==0) exec(B); else wait(&status); Process 13 Program A pid ? pid = fork(); if (pid==0) exec(B); else wait(&status); Process 13 Program A pid PC 14 pid = fork(); if (pid==0) exec(B); else wait(&status); Process 14 Program A pid PC 0 main() { … exit(3); } PC pid 0 Process 14 Program B PC
main() { … exit(3); } PC Process 14 Program B Revisiting fork() pid = fork(); if (pid==0) exec(B); else wait(&status); Process 13 Program A pid ? pid = fork(); if (pid==0) exec(B); else wait(&status); Process 13 Program A pid PC 14 Status 3 PC
Instead of copying entire address space, copy just segment table (the VA->PA mapping) Base Bound Access 32K 2K RX 34K 3K RW 28K 3K RW Code Heap Stack
Base Bound Access 32K 2K RX 34K 3K RW 28K 3K RW Code Heap Stack
but change all writeable segments to Read only
Instead of copying entire address space, copy just segment table (the VA->PA mapping) Base Bound Access 32K 2K RX 34K 3K R 28K 3K R Code Heap Stack
Base Bound Access 32K 2K RX 34K 3K R 28K 3K R Code Heap Stack
Segments in VA spaces of parent and child point to same locations in physical memory but change all writeable segments to Read only
Initially, one big hole
First Fit: first big-enough hole Next Fit: Like First Fit, but starting from where you left off Best Fit: smallest big-enough hole Worst Fit: largest big-enough hole OS
OS
OS
Preempt processes and reclaim their memory Move images of suspended processes to backing store Ready Running Waiting Suspended Semaphores/condition queues Ready queue Suspended queue
swap out swap in
32 bits
} o (12 bits) } p (20 bits)
} }
8 4 0 6 1 2
0 1 2 3 4 220 -
........... p (20 bits) o (12 bits)
CPU
f
Physical Memory