YouTube2Text

[CS61C FA20] Lecture 29.3 - Virtual Memory I: Memory Manager — Transcript

by CS 61C Departmental · 924 words · 175 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:08hello
  3. 0:09welcome back to our discussion on
  4. 0:11operating system support in which
  5. 0:12virtual memory
  6. 0:14so we have seen how does the
  7. 0:17real physical memory work and one thing
  8. 0:19that you would like to take away from
  9. 0:20there is that
  10. 0:22that every uh location in that memory
  11. 0:25every word or a block
  12. 0:27has its own physical address that is the
  13. 0:30address that corresponds to the library
  14. 0:31or congress call
  15. 0:32for the books or a street address
  16. 0:36that the postal service uses to deliver
  17. 0:38mail
  18. 0:40let's see how does this memory and
  19. 0:43addressing of the memory
  20. 0:44work when there are multiple processes
  21. 0:47that are trying to use it so
  22. 0:51in the simplest case when we are running
  23. 0:54so-called a bare metal system
  24. 0:56where there is no other support
  25. 0:59addresses
  26. 1:00issued by loads and stores that
  27. 1:03the program has on real physical
  28. 1:05addresses
  29. 1:06so you know this process that is running
  30. 1:08on on a
  31. 1:09processor is going to be addressing
  32. 1:13real physical locations in the memory
  33. 1:18now if we have multiple processes
  34. 1:23then each of these processes can issue
  35. 1:25any address
  36. 1:26and can therefore address any part of
  37. 1:29the memory
  38. 1:30uh even those parts that it
  39. 1:33does not necessarily own that you know
  40. 1:35where another process believes
  41. 1:38um that that where another process
  42. 1:40believes that it has ownership up
  43. 1:43so that's kind of a problem because
  44. 1:44multiple processes can
  45. 1:46run over each other in the memory
  46. 1:50um even more dangerously um
  47. 1:53some processes when there is an
  48. 1:54operating system in this model
  49. 1:57would be able to run over the operating
  50. 1:59systems data structures
  51. 2:02in order to avoid that we need to have a
  52. 2:05translation mechanism
  53. 2:07where there would be
  54. 2:10each process would be
  55. 2:13using a virtual outer space and then
  56. 2:18those addresses would be somehow
  57. 2:20decoupled in the physical
  58. 2:22address space so before accessing a
  59. 2:25particular physical
  60. 2:26location in memory we would check if a
  61. 2:29particular process
  62. 2:30has access rights to that particular
  63. 2:34spot
  64. 2:35so when we look how things look with the
  65. 2:38virtual memory
  66. 2:40we are going to have hundreds of
  67. 2:41processes that are managed by the
  68. 2:43operating system
  69. 2:45each line here corresponds to a
  70. 2:48different process and each process lives
  71. 2:51under this illusion that it
  72. 2:52got at the time according to itself
  73. 2:56and the entire memory to itself
  74. 2:59and the next line here is another
  75. 3:01process that also
  76. 3:02lives under the illusion that it got the
  77. 3:04process to itself
  78. 3:06and all of the memory and the next one
  79. 3:08and the next one
  80. 3:10hundreds of processes can be there
  81. 3:14and they're all multiplexed onto the
  82. 3:16core
  83. 3:17by the operating system um each one of
  84. 3:20them runs for
  85. 3:21some time on the core and then
  86. 3:25through the mechanism of a contact
  87. 3:26switch another process
  88. 3:28takes ownership of the core but what are
  89. 3:31we going to do with the memory there is
  90. 3:33only one memory
  91. 3:34and we cannot just save its contents
  92. 3:37it's only because we have all of the
  93. 3:39memory
  94. 3:40and you know in the content switch run
  95. 3:43you know put the data from another
  96. 3:45process on it
  97. 3:48so what we do we run
  98. 3:51we we have to run this translation
  99. 3:55process we have seen
  100. 3:57a conceptual picture of that we are
  101. 3:58going to get into a more
  102. 4:00more details of its operation now so
  103. 4:03each process
  104. 4:07runs in its own world um it sees
  105. 4:11this memory here the entire memory from
  106. 4:13zero zero zero
  107. 4:14zero zero to at the fff
  108. 4:18where it can store the code the static
  109. 4:20data the heap
  110. 4:21and the stack
  111. 4:25but then then
  112. 4:28in some way those virtual addresses
  113. 4:31get translated to physical addresses in
  114. 4:33a different way for every single process
  115. 4:37that concept that the translation is
  116. 4:40owned by
  117. 4:41something it is called the memory
  118. 4:42manager
  119. 4:44memory manager is the thing that maps
  120. 4:47virtual addresses
  121. 4:48to physical addresses
  122. 4:51conceptually what it does it essentially
  123. 4:55maps
  124. 4:57each of these processes to a part of a
  125. 5:00memory
  126. 5:00so each of the processes um
  127. 5:04although it thinks it is running from
  128. 5:05the zero address to the
  129. 5:07top of the address actually gets to use
  130. 5:10only a part of the memory
  131. 5:13these parts of the memory are not
  132. 5:15necessarily contiguous
  133. 5:17as drawn here in practice they're all
  134. 5:21going to be more like interleaved
  135. 5:22they're going to be all over the place
  136. 5:25and
  137. 5:25mixed with each other
  138. 5:29furthermore conceptually what does the
  139. 5:31memory manager need to do first it needs
  140. 5:33to provide the translation
  141. 5:34of virtual to physical address
  142. 5:37spaces and then very importantly needs
  143. 5:41to provide the protection
  144. 5:42so the memory needs to be isolated
  145. 5:44between the processes
  146. 5:45such that each of these processes gets
  147. 5:48its own
  148. 5:49private memory consequence of that is
  149. 5:52that errors in one program
  150. 5:54you know coding errors that can happen
  151. 5:57accidentally in one
  152. 5:58program do not corrupt the memory of
  153. 6:00another program
  154. 6:01and very importantly prevents a user
  155. 6:04program
  156. 6:05from messing up with os's memory and
  157. 6:09crashing the system
  158. 6:12also since we have so many processes we
  159. 6:15may run out of dram
  160. 6:19but the memory manager is actually going
  161. 6:22to prevent that
  162. 6:22by expanding the memory system onto the
  163. 6:25disk
  164. 6:26so it will provide the solution that our
  165. 6:29dram is much bigger
  166. 6:32by swapping parts of the memory
  167. 6:35of dram contents onto the disk now disk
  168. 6:38is a lot
  169. 6:39slower than our dram
  170. 6:42so this should happen infrequently and
  171. 6:44what we are going to see here
  172. 6:45our dram is essentially going to be used
  173. 6:48as a cache some sort of a cache for the
  174. 6:52slower disk how does that all happen
  175. 6:55you're going to see after a quick break

About this transcript

This page contains the full transcript of [CS61C FA20] Lecture 29.3 - Virtual Memory I: Memory Manager by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 924 words across 175 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.