








































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!









































So far, we've covered what happens in the heap. What happens in other parts of the process? What happens to memory in the OS itself? Zooming out! Tuesday, October 26, 2010 1:35 PM Docsity.com
Very simple and straightforward semantics (subject to O(1) time and O(1) space constraints) require exceedingly complex implementations. As we look inside the operating system, Simple and complex Thursday, October 28, 2010 11:39 AM Docsity.com
Allow process pages to exist in memory or on disk. Allow processes to run before pages are all in memory. Deal with processes' needs dynamically. Very, very quickly…. Complex implementation Complex implementation Tuesday, October 25, 2011 2:20 PM Docsity.com
A common OS design strategy: Store something In order to make something else faster. trade space for time Trading space for time Trading space for time Tuesday, October 30, 2012 11:45 AM Docsity.com
Base register: physical address of logical address 0. ○ ○ Bounds register: contains size of map Basic memory mapping: base and bound registers Hardware to the rescue Thursday, October 28, 2004 6:20 AM Docsity.com
Hardware translation Hardware translation Thursday, October 28, 2004 6:20 AM Docsity.com
What frame goes with what process/page? Special handling instructions for pages: read-only, shared memory, private,copy-on-write... What the OS needs to remember: What the OS needs to remember Tuesday, October 25, 2011 2:35 PM Docsity.com
For which process? At what logical address? Read/write? Read-only? What privileges does the process have? Has anything been written to it yet? Each frame has some concept of a "descriptor" (in the OS): How do we encode this information optimally? Frame descriptors Tuesday, October 25, 2011 2:16 PM Docsity.com
A segment is a set of pages in a process (a.k.a. frames in the OS) that share the same attributes. A segment descriptor describes the attributes of a segment. Anything we can put into a segment descriptor doesn't have to go into the frame descriptor. The concept of a segment Text segment: read-only. Stack segment: read-write, builds down. Heap segment: read-write, builds up. Data segment: read-write, static size (defined globals). Etc. Some segments and their attributes: The concept of a segment Tuesday, October 25, 2011 2:29 PM Docsity.com
Frame address: where the frame starts. Byte address: which byte of the frame. Physical address of a byte (from the point of view of the OS) has (at least) two bitfields: Segment address Page address (in segment) Byte address Logical address of a byte (in a process) contains (at least) three bitfields: A memory map is a correspondence (one-one function) between physical and logical addresses. Modern memory addressing Tuesday, October 25, 2011 2:42 PM Docsity.com
When a process accesses memory that isn't currently mapped to it, this is called a page fault. The processor/MMU generates an interrupt (of the process). The OS handles the interrupt (not the process!) One of several things is done, depending upon the state of the process. How this is implemented: Handling memory "faults" Handling "faults" Tuesday, October 25, 2011 2:13 PM Docsity.com
The process runs with only part of its pages resident. block the process swap in the required page unblock the process after the page is resident (it returns to the run queue) If a page is needed and isn't resident The semantics of virtual memory The semantics of virtual memory Thursday, October 28, 2010 11:58 AM Docsity.com
read desired contents from disk map to requesting process page If there is an unused frame, pick a used frame to unmap unmap it from whatever process is using it now move the used page's contents to disk if needed read desired contents from disk. map the frame to the requesting process else Finding an available frame To find an available page Thursday, October 28, 2010 12:02 PM Docsity.com
If the memory image of a page matches the disk image, we say that the memory copy of a page is " clean ". If the memory image is different, we say the memory copy of the page is " dirty ". Dirty pages must be flushed to disk before they can be reused by other processes. Dirtiness is a page attribute. An important concept in swapping: "dirtiness" The dirty bit Tuesday, October 30, 2012 11:27 AM Docsity.com