Commit 911e80d
Changed files (1)
doc
doc/assignment3.md
@@ -44,6 +44,38 @@ Your answer for each question should be about 150 words. (100 marks total)
> the physical address is sent to the memory unit.
1. Briefly describe the segmentation memory management scheme. How does it differ from the paging memory management scheme in terms of the user’s view of memory? (8 marks)
+
+> An important aspect of memory management that became unavoidable with paging
+> is the separation of the user's view of memory from the actual physical
+> memory. As we have already seen, the user's view of memory is not the same as
+> the actual physical memory. The user's view is mapped onto physical memory.
+> This mapping allows differentiation between logical memory and physical
+> memory.
+
+> Segmentation is a memory-management scheme that supports this user view of
+> memory. A logical address space is a collection of segments. Each segment
+> has a name and a length. The addresses specify both the segment name and
+> the offset within the segment. The user therefore specifies each
+> address by two quantities: a segment name and an offset. (Contrast this
+> scheme with the paging scheme, in which the user specifies only a single
+> address, which is partitioned by the hardware into a page number and an
+> offset, all invisible to the programmer.)
+
+> For simplicity of implementation, segments are numbered and are referred
+> to by a segment number, rather than by a segment name. Thus, a logical
+> address consists of a two tuple:
+> <segment-number,offset>.
+
+> A C compiler might create separate segments for the following:
+> 1. The code
+> 2. Global variables
+> 3. The heap, from which memory is allocated
+> 4. The stacks used by each thread
+> 5. The standard C library
+> Libraries that are linked during compile time might be assigned separate
+> segments. The loader would take all these segments and assign them segment
+> numbers.
+
1. Explain the distinction between a demand-paging system and a paging system with swapping. (8 marks)
1. How does the second-chance algorithm for page replacement differ from the FIFO page replacement algorithm? (8 marks)
1. Explain how copy-on-write operates. (8 marks)