Sistemas Operativos, Manejo de la memoria 1 Introducción — Transcript
Full transcript
- 0:00Hello, how are you? How are you doing?
- 0:03Welcome to the Operating Systems
- 0:05Fundamentals course. We are going to
- 0:08start looking at memory management, for
- 0:10which I will base myself on Chapter 8
- 0:12of the textbook by Silberschatz and
- 0:14Galvin. We will cover this topic in the
- 0:19following sections. First, we will
- 0:21begin with an introduction to what
- 0:23memory management is. Later, we will
- 0:27see what the logical address space is
- 0:29versus the physical address space. We
- 0:34will talk about swapping, contiguous
- 0:37allocation, paging, segmentation, and
- 0:40segmentation combined with paging. We
- 0:45will start with the introduction. So
- 0:49let's begin. Here I have, for example,
- 0:53some programs on a disk. Over here, I
- 0:56have the memory. So, what happens?
- 1:00These programs will be brought into
- 1:03memory and established as processes
- 1:06that will be executed. For this, there
- 1:11will be an input queue, and this way,
- 1:14programs are brought into memory for
- 1:18execution, and these are now processes.
- 1:25Now, user programs go through several
- 1:28stages before being executed. For
- 1:33example, here I have an assembly
- 1:35program. This program, as we are seeing
- 1:41, has references to some labels, such
- 1:44as the label "data," which refers to a
- 1:47piece of data in the data segment area,
- 1:50and it has a jump to a "loop" label
- 1:53that is inside the code segment. When
- 1:58this program is brought into memory,
- 2:01these labels, for example, the label "
- 2:05data," must be translated into the
- 2:08corresponding address. That is, we will
- 2:11no longer have "sub R1 data," but
- 2:14rather "sub R1," which is the content
- 2:18of address 100. And this jump will be
- 2:22to address 200, which is where the "
- 2:25loop" label is, or the next instruction
- 2:28after the "loop" label. Now, this
- 2:34association of instructions and data to
- 2:38memory addresses can occur in the
- 2:41following three ways. One is at compile
- 2:46time. What is this? It means that the
- 2:50memory addresses where each of the
- 2:52program's instructions and data will be
- 2:54located are known a priori. This is
- 2:57also called absolute code. And if
- 3:00something changes in the program, that
- 3:03is, if an address or the starting
- 3:05address changes, the program must be
- 3:07recompiled. This is obviously very
- 3:11useful when the software is going to be
- 3:14burned into ROM, and in a way, there
- 3:16will be no further changes to where in
- 3:19memory this program will be located
- 3:21when it starts its execution. This can
- 3:26also happen at load time, meaning it is
- 3:30code that will now be relocatable. Once
- 3:35the code is loaded into memory, it can
- 3:37no longer be moved. It will stay there.
- 3:41But it can also happen at runtime. And
- 3:45when it is at runtime, the process can
- 3:48move in memory during its execution.
- 3:52And in this way, address assignment is
- 3:55done until the moment the program
- 3:57begins execution. This requires special
- 4:01hardware. For example, here I have the
- 4:07same program I showed you a moment ago,
- 4:10where I already have, for example, the
- 4:12labels translated into memory addresses
- 4:15. For example, here we are subtracting
- 4:19the data at address 100 from register
- 4:21one, that is, the data that is here.
- 4:25And here we perform a jump to address
- 4:27200. If this program leaves memory and
- 4:31returns, but returns loaded into a
- 4:34different memory address, then
- 4:36obviously these references are no
- 4:39longer valid. Agreed? Why? Well,
- 4:42because it is no longer address 100
- 4:45that we have to subtract from register
- 4:47R1, nor is it address 200 where we have
- 4:50to jump. In other words, these
- 4:53addresses must now be updated. Dynamic
- 4:59loading. What is this? It means a
- 5:01routine will not be loaded into memory
- 5:04until that routine is called. That is
- 5:10to say, a routine that is never used
- 5:12will never be loaded, and therefore
- 5:14this allows us to have better memory
- 5:16space utilization, agreed? I won't have
- 5:20routines that are not being used. This
- 5:26is useful when large amounts of code
- 5:28are needed to handle cases that don't
- 5:31occur frequently, and no special
- 5:33operating system support is required
- 5:36and it can be implemented by program
- 5:38design. A very clear example, well, I'm
- 5:44going to tell you about MS-DOS and the
- 5:48microprocessor on which MS-DOS ran,
- 5:51which was the Intel 8086/8088, although
- 5:54of course, the Intel 80386, 486, and
- 5:57Pentium were also used, but running in
- 6:01a mode where they behaved like a faster
- 6:048086/8088, that is, a very limited mode
- 6:07. Agreed? The MS-DOS operating system
- 6:12is an operating system, or was an
- 6:14operating system, that was very limited
- 6:17in terms of many functions that modern
- 6:19operating systems perform today. Here I
- 6:23have the memory and I have a space
- 6:26assigned to this program. Agreed? What
- 6:31happens? Well, the main module is
- 6:34loaded into memory, and when this main
- 6:37module needs to use routines that are
- 6:40in module one, this module one is
- 6:42brought into memory; but, once module
- 6:45one is no longer used and routines from
- 6:48another module are needed, then that
- 6:51module one is unloaded and the next
- 6:54module we need, in this case, module
- 6:57two, is brought into memory. In the
- 7:01same way, when module 2 is no longer
- 7:05required in memory, it disappears and
- 7:08module 3 is loaded into memory. This
- 7:14was used a lot in the late 80s and 90s,
- 7:17when MS-DOS was the operating system
- 7:20used on personal computers, and above
- 7:23all, the memory allocated for programs
- 7:27to execute was a very limited space. I
- 7:32can tell you that back then there were
- 7:35only 640 KB available for programs to
- 7:38run. Okay. Well, dynamic linking. What
- 7:46is this? Well, you know that when you
- 7:49normally compile a program and build
- 7:52the executable, a linking process
- 7:54occurs. What do I mean by this? That
- 7:57all the libraries are added to that
- 8:00program, sometimes leaving an
- 8:02executable program that can be quite
- 8:04large. Dynamic linking means that the
- 8:08linking is now postponed until runtime.
- 8:14In this way, the programs will have a
- 8:17stub, which is a small piece of code
- 8:20used to locate the library routine that
- 8:23will be resident in memory. That is,
- 8:28now the library routines will no longer
- 8:31be part of the executable program,
- 8:33which sometimes leaves us with a rather
- 8:36large executable, but now those
- 8:39routines will be resident in memory.
- 8:43And the programs will simply invoke
- 8:45those routines. What happens then? Well
- 8:50, that stub is replaced with the
- 8:52address of the routine, and the routine
- 8:54is executed. In this way, the operating
- 8:59system is needed to check if the
- 9:01routine is in the process's memory
- 9:03addresses. Thank you very much for your
- 9:07attention. I hope it was clear, and in
- 9:10any case, we will discuss it and answer
- 9:12any questions.
About this transcript
This page contains the full transcript of Sistemas Operativos, Manejo de la memoria 1 Introducción by Mtro. José Luis Elvira, generated from the public captions YouTube serves with the video. The transcript has 1,111 words across 167 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 choose a caption track available on the video.
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, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.