ECSE427-MainMemory - ECSE427:MainMemory JoudChataoui ,...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECSE 427: Main Memory Joud Chataoui All modern computers support multitasking, the fact that many processes appear to run at the same time by alternately running on CPU. For a process to run, it first needs to be in memory. Consequently, any system that supports multitasking needs to support memory sharing as well. This design has many implications like memory protection and support for relocation. I. Basic memory requirements: There are basic memory requirements that need to be satisfied in a computer system. First of all, regardless of whether the system supports multitasking, the OS should provide a way of translating addresses generated by the CPU (logical addresses) into physical addresses. This is important for many reasons: It gives the programmer a simpler programming environment It makes the program portable It allows for multitasking, the program may be relocated in memory Another important requirement is memory protection, if many processes are to reside in memories, the OS should make sure that no process accesses illegal memory. More importantly, the OS should also make sure that no kernel code is modified by user processes. In this section, we will discuss those basic issues 1. Memory protection: When several processes reside in memory, we need to make sure none of them accesses another’s memory space. Implementing this with the OS would be too costly as the OS would need to check every memory reference to see whether it is legal or not. Consequently, we should implement memory protection using hardware by preventing a process from accessing addresses that are not within its range. This can be easily done using two registers for each process. The first register, called the base register, stores the base address: The smallest address that the process can access. The second register, called the limit register stores the range which is the largest offset (starting from base register) that the process can reach. Every time the CPU generates an address, the hardware checks whether this address is larger than the address held by the base register and smaller than base + offset (sum of base register and limit register). If the address is in this range, then it is legal and memory access is granted. 2. Address binding: As previously mentioned, the programmer doesn’t need to worry about physical addresses. In the source code, addresses are symbolic (represented by variable names for example). When a code is compiled then executed, these
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
symbolic addresses need to be mapped to physical addresses. In this section, we discuss address binding which is the process of mapping virtual addresses to logical addresses. Typically, the compiler would translate source code’s symbolic addresses into relocatable addresses: Addresses given in terms of offset from a base address (that hasn’t been specified yet). After that, the loader (aka linkage editor) translates those relocatable addresses into physical addresses.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern