Is the MMU (Memory Management Unit) chip necessary for a processor to have virtual memory support?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
13
down vote

favorite
2












Is the MMU (Memory Management Unit) chip necessary for a processor to have virtual memory support?



Is it possible to emulate MMU functionality in software? (I am aware that it will probably have a big impact on performance).










share|improve this question





















  • Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
    – Vality
    Oct 2 '17 at 23:35














up vote
13
down vote

favorite
2












Is the MMU (Memory Management Unit) chip necessary for a processor to have virtual memory support?



Is it possible to emulate MMU functionality in software? (I am aware that it will probably have a big impact on performance).










share|improve this question





















  • Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
    – Vality
    Oct 2 '17 at 23:35












up vote
13
down vote

favorite
2









up vote
13
down vote

favorite
2






2





Is the MMU (Memory Management Unit) chip necessary for a processor to have virtual memory support?



Is it possible to emulate MMU functionality in software? (I am aware that it will probably have a big impact on performance).










share|improve this question













Is the MMU (Memory Management Unit) chip necessary for a processor to have virtual memory support?



Is it possible to emulate MMU functionality in software? (I am aware that it will probably have a big impact on performance).







memory hardware virtual-memory hardware-compatibility emulation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 2 '17 at 9:07









yoyo_fun

322412




322412











  • Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
    – Vality
    Oct 2 '17 at 23:35
















  • Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
    – Vality
    Oct 2 '17 at 23:35















Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
– Vality
Oct 2 '17 at 23:35




Any fully capable computer can emulate any other computer with enough of a performance hit. Or emulate any hardware. The only question is the magnitude of performance hit.
– Vality
Oct 2 '17 at 23:35










3 Answers
3






active

oldest

votes

















up vote
19
down vote













Any system emulator which emulates a system containing a MMU effectively emulates a MMU in software, so the answer to your question as stated is “yes”. However, virtual memory requires some way of enforcing memory access control, or at least address translation, so it needs either full software emulation of the CPU running the software being controlled, or it needs hardware assistance.



So you could conceivably build a system with no MMU, port QEMU to it, add the missing pieces to make virtual memory actually useful (e.g., add support for swap on the host system), and run a MMU-requiring operating system in QEMU, with all the protection you’d expect in the guest operating system (barring QEMU bugs).



One real, and old, example of an MMU-less “emulation” used to provide virtual memory is the Z-machine, which was capable of paging and swapping its code and data, on 8-bit systems in the late seventies and early eighties. This worked by emulating a virtual processor on the underlying real processor; that way, the interpreter keeps full control over the memory layout which the running program “sees”.



In practice, it’s generally considered that a MMU is required for virtual memory support, at least at the operating system level. As indicated MMU-less kernel?, it is possible to build the Linux kernel so that it can run on systems without a MMU, but the resulting configuration is very unusual and only appropriate for very specific use-cases (with no hostile software in particular). It might not support many scenarios requiring virtual memory (swapping, mmap...).






share|improve this answer






















  • so virtual machine applications also have an MMU emulator component?
    – yoyo_fun
    Oct 2 '17 at 12:55










  • Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
    – Stephen Kitt
    Oct 2 '17 at 13:22






  • 7




    @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
    – Jörg W Mittag
    Oct 2 '17 at 13:41










  • @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
    – Stephen Kitt
    Oct 2 '17 at 13:46






  • 3




    @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
    – Jörg W Mittag
    Oct 2 '17 at 13:50

















up vote
7
down vote













It depends on exactly what you call virtual memory. An interesting model is the old Win16 model (best known from the old Windows 3.x, not Windows NT). In that model, you had GlobalLock and GlobalUnlock, LocalLock and LocalUnlock functions. These were a form of cooperative, manual management of virtual memory. As this was done in (application) software, it didn't require an MMU. And memory was virtual in the sense that unlocked memory could be swapped to disk.



However, in the Win16 model there is no protection between different processes. If another process left data in memory, you could overwrite it. This is not a fundamental restriction. With fast SSD's these days, you could remove a non-running process from memory entirely, and do so in a reasonable time.






share|improve this answer



























    up vote
    7
    down vote













    It's not necessary to have a hardware MMU, if you have software that can swap processes to and from the physical memory.



    This was the mode of operation of early multi-tasking operating systems. Only one process is resident in memory at any given time, it is swapped out in its entirety when its time-slice expires (you can see that this becomes problematic with large processes). The memory contents seen by the currently-running process is not the same as that seen by any other process, and each has its own view of the address space.



    Some hardware support is helpful - a notion of a "protected" memory area for the OS's own use (e.g. all addresses with MSB set are accessible only in supervisor mode) and a "break" value indicating the highest address in use, but memory management hardware is not a absolute requirement for virtual memory; it's just a particularly effective way to achieve it.






    share|improve this answer


















    • 2




      That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
      – Stephen Kitt
      Oct 2 '17 at 15:33










    • Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
      – Toby Speight
      Oct 2 '17 at 15:35










    • Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
      – Stephen Kitt
      Oct 2 '17 at 15:36











    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395603%2fis-the-mmu-memory-management-unit-chip-necessary-for-a-processor-to-have-virtu%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    19
    down vote













    Any system emulator which emulates a system containing a MMU effectively emulates a MMU in software, so the answer to your question as stated is “yes”. However, virtual memory requires some way of enforcing memory access control, or at least address translation, so it needs either full software emulation of the CPU running the software being controlled, or it needs hardware assistance.



    So you could conceivably build a system with no MMU, port QEMU to it, add the missing pieces to make virtual memory actually useful (e.g., add support for swap on the host system), and run a MMU-requiring operating system in QEMU, with all the protection you’d expect in the guest operating system (barring QEMU bugs).



    One real, and old, example of an MMU-less “emulation” used to provide virtual memory is the Z-machine, which was capable of paging and swapping its code and data, on 8-bit systems in the late seventies and early eighties. This worked by emulating a virtual processor on the underlying real processor; that way, the interpreter keeps full control over the memory layout which the running program “sees”.



    In practice, it’s generally considered that a MMU is required for virtual memory support, at least at the operating system level. As indicated MMU-less kernel?, it is possible to build the Linux kernel so that it can run on systems without a MMU, but the resulting configuration is very unusual and only appropriate for very specific use-cases (with no hostile software in particular). It might not support many scenarios requiring virtual memory (swapping, mmap...).






    share|improve this answer






















    • so virtual machine applications also have an MMU emulator component?
      – yoyo_fun
      Oct 2 '17 at 12:55










    • Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
      – Stephen Kitt
      Oct 2 '17 at 13:22






    • 7




      @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
      – Jörg W Mittag
      Oct 2 '17 at 13:41










    • @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
      – Stephen Kitt
      Oct 2 '17 at 13:46






    • 3




      @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
      – Jörg W Mittag
      Oct 2 '17 at 13:50














    up vote
    19
    down vote













    Any system emulator which emulates a system containing a MMU effectively emulates a MMU in software, so the answer to your question as stated is “yes”. However, virtual memory requires some way of enforcing memory access control, or at least address translation, so it needs either full software emulation of the CPU running the software being controlled, or it needs hardware assistance.



    So you could conceivably build a system with no MMU, port QEMU to it, add the missing pieces to make virtual memory actually useful (e.g., add support for swap on the host system), and run a MMU-requiring operating system in QEMU, with all the protection you’d expect in the guest operating system (barring QEMU bugs).



    One real, and old, example of an MMU-less “emulation” used to provide virtual memory is the Z-machine, which was capable of paging and swapping its code and data, on 8-bit systems in the late seventies and early eighties. This worked by emulating a virtual processor on the underlying real processor; that way, the interpreter keeps full control over the memory layout which the running program “sees”.



    In practice, it’s generally considered that a MMU is required for virtual memory support, at least at the operating system level. As indicated MMU-less kernel?, it is possible to build the Linux kernel so that it can run on systems without a MMU, but the resulting configuration is very unusual and only appropriate for very specific use-cases (with no hostile software in particular). It might not support many scenarios requiring virtual memory (swapping, mmap...).






    share|improve this answer






















    • so virtual machine applications also have an MMU emulator component?
      – yoyo_fun
      Oct 2 '17 at 12:55










    • Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
      – Stephen Kitt
      Oct 2 '17 at 13:22






    • 7




      @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
      – Jörg W Mittag
      Oct 2 '17 at 13:41










    • @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
      – Stephen Kitt
      Oct 2 '17 at 13:46






    • 3




      @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
      – Jörg W Mittag
      Oct 2 '17 at 13:50












    up vote
    19
    down vote










    up vote
    19
    down vote









    Any system emulator which emulates a system containing a MMU effectively emulates a MMU in software, so the answer to your question as stated is “yes”. However, virtual memory requires some way of enforcing memory access control, or at least address translation, so it needs either full software emulation of the CPU running the software being controlled, or it needs hardware assistance.



    So you could conceivably build a system with no MMU, port QEMU to it, add the missing pieces to make virtual memory actually useful (e.g., add support for swap on the host system), and run a MMU-requiring operating system in QEMU, with all the protection you’d expect in the guest operating system (barring QEMU bugs).



    One real, and old, example of an MMU-less “emulation” used to provide virtual memory is the Z-machine, which was capable of paging and swapping its code and data, on 8-bit systems in the late seventies and early eighties. This worked by emulating a virtual processor on the underlying real processor; that way, the interpreter keeps full control over the memory layout which the running program “sees”.



    In practice, it’s generally considered that a MMU is required for virtual memory support, at least at the operating system level. As indicated MMU-less kernel?, it is possible to build the Linux kernel so that it can run on systems without a MMU, but the resulting configuration is very unusual and only appropriate for very specific use-cases (with no hostile software in particular). It might not support many scenarios requiring virtual memory (swapping, mmap...).






    share|improve this answer














    Any system emulator which emulates a system containing a MMU effectively emulates a MMU in software, so the answer to your question as stated is “yes”. However, virtual memory requires some way of enforcing memory access control, or at least address translation, so it needs either full software emulation of the CPU running the software being controlled, or it needs hardware assistance.



    So you could conceivably build a system with no MMU, port QEMU to it, add the missing pieces to make virtual memory actually useful (e.g., add support for swap on the host system), and run a MMU-requiring operating system in QEMU, with all the protection you’d expect in the guest operating system (barring QEMU bugs).



    One real, and old, example of an MMU-less “emulation” used to provide virtual memory is the Z-machine, which was capable of paging and swapping its code and data, on 8-bit systems in the late seventies and early eighties. This worked by emulating a virtual processor on the underlying real processor; that way, the interpreter keeps full control over the memory layout which the running program “sees”.



    In practice, it’s generally considered that a MMU is required for virtual memory support, at least at the operating system level. As indicated MMU-less kernel?, it is possible to build the Linux kernel so that it can run on systems without a MMU, but the resulting configuration is very unusual and only appropriate for very specific use-cases (with no hostile software in particular). It might not support many scenarios requiring virtual memory (swapping, mmap...).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Oct 11 '17 at 2:11

























    answered Oct 2 '17 at 9:13









    Stephen Kitt

    145k22317382




    145k22317382











    • so virtual machine applications also have an MMU emulator component?
      – yoyo_fun
      Oct 2 '17 at 12:55










    • Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
      – Stephen Kitt
      Oct 2 '17 at 13:22






    • 7




      @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
      – Jörg W Mittag
      Oct 2 '17 at 13:41










    • @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
      – Stephen Kitt
      Oct 2 '17 at 13:46






    • 3




      @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
      – Jörg W Mittag
      Oct 2 '17 at 13:50
















    • so virtual machine applications also have an MMU emulator component?
      – yoyo_fun
      Oct 2 '17 at 12:55










    • Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
      – Stephen Kitt
      Oct 2 '17 at 13:22






    • 7




      @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
      – Jörg W Mittag
      Oct 2 '17 at 13:41










    • @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
      – Stephen Kitt
      Oct 2 '17 at 13:46






    • 3




      @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
      – Jörg W Mittag
      Oct 2 '17 at 13:50















    so virtual machine applications also have an MMU emulator component?
    – yoyo_fun
    Oct 2 '17 at 12:55




    so virtual machine applications also have an MMU emulator component?
    – yoyo_fun
    Oct 2 '17 at 12:55












    Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
    – Stephen Kitt
    Oct 2 '17 at 13:22




    Yes — not necessarily as a separate component, but they do have the necessary support in the emulation.
    – Stephen Kitt
    Oct 2 '17 at 13:22




    7




    7




    @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
    – Jörg W Mittag
    Oct 2 '17 at 13:41




    @JenniferAnderson: Some modern CPUs have features that let the emulator (partially) offload the MMU emulation to the MMU itself. E.g. a program running inside an emulator will itself use multiple emulated pages of memory, these pages of memory are of course "nested" in the pages of memory used by the emulator. Both newer high-end Intel and AMD CPUs have support for nested page tables, which allow the emulator to express this nesting within the MMU itself, instead of having to (expensively) emulate it.
    – Jörg W Mittag
    Oct 2 '17 at 13:41












    @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
    – Stephen Kitt
    Oct 2 '17 at 13:46




    @Jörg indeed, thanks for the clarification. Most hypervisors still include some level of software emulation though so that they will work without the extra hardware support. I was blinkered by the “Is it possible” aspect of the question ;-).
    – Stephen Kitt
    Oct 2 '17 at 13:46




    3




    3




    @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
    – Jörg W Mittag
    Oct 2 '17 at 13:50




    @JenniferAnderson: Yes, this functionality was specifically introduced for para-virtualization. (Note that it is nothing new, hardware-assisted para-virtualization has existed in the mainframe world since the early 1960s.) It turns out however, that it can also be used for other interesting applications, such as speeding up Garbage Collection (see the C4 collector in Azul's Zing JVM for an example). However, note, that all of this works in both directions: in the same way that extending MMUs with virtualization support is nothing more than a performance optimization, and virtualization …
    – Jörg W Mittag
    Oct 2 '17 at 13:50












    up vote
    7
    down vote













    It depends on exactly what you call virtual memory. An interesting model is the old Win16 model (best known from the old Windows 3.x, not Windows NT). In that model, you had GlobalLock and GlobalUnlock, LocalLock and LocalUnlock functions. These were a form of cooperative, manual management of virtual memory. As this was done in (application) software, it didn't require an MMU. And memory was virtual in the sense that unlocked memory could be swapped to disk.



    However, in the Win16 model there is no protection between different processes. If another process left data in memory, you could overwrite it. This is not a fundamental restriction. With fast SSD's these days, you could remove a non-running process from memory entirely, and do so in a reasonable time.






    share|improve this answer
























      up vote
      7
      down vote













      It depends on exactly what you call virtual memory. An interesting model is the old Win16 model (best known from the old Windows 3.x, not Windows NT). In that model, you had GlobalLock and GlobalUnlock, LocalLock and LocalUnlock functions. These were a form of cooperative, manual management of virtual memory. As this was done in (application) software, it didn't require an MMU. And memory was virtual in the sense that unlocked memory could be swapped to disk.



      However, in the Win16 model there is no protection between different processes. If another process left data in memory, you could overwrite it. This is not a fundamental restriction. With fast SSD's these days, you could remove a non-running process from memory entirely, and do so in a reasonable time.






      share|improve this answer






















        up vote
        7
        down vote










        up vote
        7
        down vote









        It depends on exactly what you call virtual memory. An interesting model is the old Win16 model (best known from the old Windows 3.x, not Windows NT). In that model, you had GlobalLock and GlobalUnlock, LocalLock and LocalUnlock functions. These were a form of cooperative, manual management of virtual memory. As this was done in (application) software, it didn't require an MMU. And memory was virtual in the sense that unlocked memory could be swapped to disk.



        However, in the Win16 model there is no protection between different processes. If another process left data in memory, you could overwrite it. This is not a fundamental restriction. With fast SSD's these days, you could remove a non-running process from memory entirely, and do so in a reasonable time.






        share|improve this answer












        It depends on exactly what you call virtual memory. An interesting model is the old Win16 model (best known from the old Windows 3.x, not Windows NT). In that model, you had GlobalLock and GlobalUnlock, LocalLock and LocalUnlock functions. These were a form of cooperative, manual management of virtual memory. As this was done in (application) software, it didn't require an MMU. And memory was virtual in the sense that unlocked memory could be swapped to disk.



        However, in the Win16 model there is no protection between different processes. If another process left data in memory, you could overwrite it. This is not a fundamental restriction. With fast SSD's these days, you could remove a non-running process from memory entirely, and do so in a reasonable time.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 2 '17 at 13:20









        MSalters

        30019




        30019




















            up vote
            7
            down vote













            It's not necessary to have a hardware MMU, if you have software that can swap processes to and from the physical memory.



            This was the mode of operation of early multi-tasking operating systems. Only one process is resident in memory at any given time, it is swapped out in its entirety when its time-slice expires (you can see that this becomes problematic with large processes). The memory contents seen by the currently-running process is not the same as that seen by any other process, and each has its own view of the address space.



            Some hardware support is helpful - a notion of a "protected" memory area for the OS's own use (e.g. all addresses with MSB set are accessible only in supervisor mode) and a "break" value indicating the highest address in use, but memory management hardware is not a absolute requirement for virtual memory; it's just a particularly effective way to achieve it.






            share|improve this answer


















            • 2




              That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
              – Stephen Kitt
              Oct 2 '17 at 15:33










            • Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
              – Toby Speight
              Oct 2 '17 at 15:35










            • Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
              – Stephen Kitt
              Oct 2 '17 at 15:36















            up vote
            7
            down vote













            It's not necessary to have a hardware MMU, if you have software that can swap processes to and from the physical memory.



            This was the mode of operation of early multi-tasking operating systems. Only one process is resident in memory at any given time, it is swapped out in its entirety when its time-slice expires (you can see that this becomes problematic with large processes). The memory contents seen by the currently-running process is not the same as that seen by any other process, and each has its own view of the address space.



            Some hardware support is helpful - a notion of a "protected" memory area for the OS's own use (e.g. all addresses with MSB set are accessible only in supervisor mode) and a "break" value indicating the highest address in use, but memory management hardware is not a absolute requirement for virtual memory; it's just a particularly effective way to achieve it.






            share|improve this answer


















            • 2




              That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
              – Stephen Kitt
              Oct 2 '17 at 15:33










            • Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
              – Toby Speight
              Oct 2 '17 at 15:35










            • Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
              – Stephen Kitt
              Oct 2 '17 at 15:36













            up vote
            7
            down vote










            up vote
            7
            down vote









            It's not necessary to have a hardware MMU, if you have software that can swap processes to and from the physical memory.



            This was the mode of operation of early multi-tasking operating systems. Only one process is resident in memory at any given time, it is swapped out in its entirety when its time-slice expires (you can see that this becomes problematic with large processes). The memory contents seen by the currently-running process is not the same as that seen by any other process, and each has its own view of the address space.



            Some hardware support is helpful - a notion of a "protected" memory area for the OS's own use (e.g. all addresses with MSB set are accessible only in supervisor mode) and a "break" value indicating the highest address in use, but memory management hardware is not a absolute requirement for virtual memory; it's just a particularly effective way to achieve it.






            share|improve this answer














            It's not necessary to have a hardware MMU, if you have software that can swap processes to and from the physical memory.



            This was the mode of operation of early multi-tasking operating systems. Only one process is resident in memory at any given time, it is swapped out in its entirety when its time-slice expires (you can see that this becomes problematic with large processes). The memory contents seen by the currently-running process is not the same as that seen by any other process, and each has its own view of the address space.



            Some hardware support is helpful - a notion of a "protected" memory area for the OS's own use (e.g. all addresses with MSB set are accessible only in supervisor mode) and a "break" value indicating the highest address in use, but memory management hardware is not a absolute requirement for virtual memory; it's just a particularly effective way to achieve it.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 2 '17 at 15:36

























            answered Oct 2 '17 at 15:23









            Toby Speight

            5,0521928




            5,0521928







            • 2




              That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
              – Stephen Kitt
              Oct 2 '17 at 15:33










            • Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
              – Toby Speight
              Oct 2 '17 at 15:35










            • Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
              – Stephen Kitt
              Oct 2 '17 at 15:36













            • 2




              That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
              – Stephen Kitt
              Oct 2 '17 at 15:33










            • Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
              – Toby Speight
              Oct 2 '17 at 15:35










            • Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
              – Stephen Kitt
              Oct 2 '17 at 15:36








            2




            2




            That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
            – Stephen Kitt
            Oct 2 '17 at 15:33




            That’s not really virtual memory though, it’s just process swapping... (We’d really need to define “virtual memory” for a proper answer to this question!)
            – Stephen Kitt
            Oct 2 '17 at 15:33












            Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
            – Toby Speight
            Oct 2 '17 at 15:35




            Each process has its own view of the address space - I'll edit to clarify the definition I'm using.
            – Toby Speight
            Oct 2 '17 at 15:35












            Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
            – Stephen Kitt
            Oct 2 '17 at 15:36





            Right, but it’s the same one-to-one mapping for all processes. (From the point of view of processes there’s not much difference so there’s no real argument there...)
            – Stephen Kitt
            Oct 2 '17 at 15:36


















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395603%2fis-the-mmu-memory-management-unit-chip-necessary-for-a-processor-to-have-virtu%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?