Mohammad Saddam Mashuri's OS202
The Address Space
The address space allows the OS to create an easy to use abstraction of physical memory. This abstraction is called the address space. Understanding this fundamental OS abstraction of memory is key to understanding how memory is virtualized. The address space of a process contains all of the memory state of the running program.
Paging
To keep allocation from being more challenging over time, it may be worth to chop up space into fixed-sized pieces, rather than into a variable-sized one. In virtual memory, this is called paging. Instead of splitting up a process’s address space into some number of variable-sized logical segments (e.g., code, heap, stack), we divide it into fixed-sized units, each of which we call a page. Another advantage of paging, is the simplicity of free-space management that paging offers.
Page Table
Page table is a data structure used by the virtual memory system to store the mapping between logical addresses and physical addresses. Logical addresses are generated by the CPU for the pages of the processes therefore they are generally used by the processes. Physical addresses are the actual frame address of the memory. They are generally used by the hardware or more specifically by RAM subsystems.
Address Translation
In virtualizing memory, attaining both efficiency and control while providing the desired virtualization, requires a strategy commonly referred to as hardware-based address translation AKA address translation. With address translation, the hardware transforms each memory access, changing the virtual address provided by the instruction to a physical address where the desired information is actually located. Hence, on each and every memory reference, an address translation is performed by the hardware to redirect application memory references to their actual locations in memory.
Swapping
Swapping is a mechanism in which a process can be swapped temporarily out of main memory to secondary storage and make that memory available to other processes. The purpose of swapping is to maximize the number of processes in the system. Swapping is a useful technique that enables a computer to execute programs and manipulate data files larger than main memory.
No Swapping on Mobile Systems
Mobile systems typically do not support swapping in any form. Mobile devices usually use flash memory rather than hard disks for non-volatile storage. Instead of swapping, mobile system such as Apple’s iOS asks application to relinquish allocated memory. Androids adapts similar strategy as iOS, but it may terminate a process if insufficient free memory is available.
Big Endian and Little Endian
This topic was talked briefly in the IDS / PSD course, but I think it’s high time we need to review about this topic for a few seconds. Big endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest. Little endian system, in contrast, stores the least significant byte of a word at the smallest memory address.
I’ll show you an example, for the hex ‘0x12674592’ in 32-bit representation, can be stored as -
Sources:
Abraham Silberschatz - Operating System Concepts -Wiley (2018)
http://pages.cs.wisc.edu/~remzi/OSTEP/
https://www.tutorialspoint.com/big-endian-and-little-endian
https://www.tecmint.com/understanding-shared-libraries-in-linux/