



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!




Recall the problems with base&bound relocation:
Fragmentation of Memory: variable size holes
-^ Only one segment. How can two processes share code while keepingprivate data areas (e.g. shared editor)?
Paging:
Divide physical and virtual memory into fixed size chunks (pages). Keep a table mapping virtual page (numbered consecutively from0) to a physical page (arbitrary, not necessarily sequential).
-^ Segmentation:
Processes split up into several logical areas of memory,
e.g., code, data, stack. Some segments can be made read-only.
segments.
Use a separate base and bound for each segment, and also add two protection bits(read and write).
Segment
Base
Bounds
Each memory reference indicates a segment and offset:
Top bits of address select segment, low bits the offset.segment #
offset
Segment table holds the bases and bounds for all the segments of a process. Whathappens on a context switch?Memory mapping procedure consists of a table lookup + add + compare. (Draw apicture)
Do segments have to start on even 000 physical addresses?
-^ What if hardware provides eight segments but your operating system (e.g.UNIX) only uses two or three?
o^ Segments can be shared, swapped, and assigned to storage independently.Show an example where code is shared between two processes safely.
(This problem also applies to base and bound schemes)
Paging The goal of paging is to make allocation and swapping easier, and to reducememory fragmentation.Make all chunks of memory the same size, call them
pages.
Typical sizes range
from 512 to 8k bytes.For each process, a page table defines the base address of each of that process'pages along with read-only and valid bits.Translation process: page number always comes directly from the virtual address.Since page size is a power of two, no comparison or addition is necessary. Just doa table lookup and bit substitution. (Show a picture)Pros:
Easy to allocate: keep a free list of available pages and grab the first one.Easy to swap since everything is the same size, which is usually the samesize as disk blocks to and from which pages are swapped. Cons:
Efficiency of access: even small page tables are generally too large toload into fast memory in the relocation box. Instead, page tables are keptin main memory and the relocation box only has the page table's baseaddress. It thus takes one overhead reference for every real memoryreference.Solution from EECS 370 to get access time back to close to one realmemory reference?