The programmer need not worry about physical memory

On older OSes and even modern RTOSes, the programmer is expected to understand the memory layout of the entire system in detail and use memory accordingly (recall Fig 1). Obviously, this places a major burden on the developer; they have to ensure that they work well within the physical constraints of the system.

Most modern developers working on modern OSes never even think this way: if we want, say, 512 Kb of memory, do we not just allocate it dynamically (with malloc(3), seen later in detail in Chapter 4, Dynamic Memory Allocation), leaving the precise details of how and where it's done to the library and OS layers? In fact, we can do this kind of thing dozens of times and not worry about stuff such as, "Will there be enough physical RAM? Which physical page frames should be used? What about fragmentation/wastage?"

We get the added benefit that the memory returned to us by the system is guaranteed to be contiguous; of course, it's just virtually contiguous, it need not be physically contiguous, but that kind of detail is exactly what the VM layers take care of!

All is handled, really efficiently, by the library layer and the underlying memory-management system in the OS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset