Hubbry Logo
Address spaceAddress spaceMain
Open search
Address space
Community hub
Address space
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Address space
Address space
from Wikipedia

In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity.

For software programs to save and retrieve stored data, each datum must have an address where it can be located. The number of address spaces available depends on the underlying address structure, which is usually limited by the computer architecture being used. Often an address space in a system with virtual memory corresponds to a highest level translation table, e.g., a segment table in IBM System/370.

Address spaces are created by combining enough uniquely identified qualifiers to make an address unambiguous within the address space. For a person's physical address, the address space would be a combination of locations, such as a neighborhood, town, city, or country. Some elements of a data address space may be the same, but if any element in the address is different, addresses in said space will reference different entities. For example, there could be multiple buildings at the same address of "32 Main Street" but in different towns, demonstrating that different towns have different, although similarly arranged, street address spaces.

An address space usually provides (or allows) a partitioning to several regions according to the mathematical structure it has. In the case of total order, as for memory addresses, these are simply chunks. Like the hierarchical design of postal addresses, some nested domain hierarchies appear as a directed ordered tree, such as with the Domain Name System or a directory structure. In the Internet, the Internet Assigned Numbers Authority (IANA) allocates ranges of IP addresses to various registries so each can manage their parts of the global Internet address space.[1]

Examples

[edit]

Uses of addresses include, but are not limited to the following:

Address mapping and translation

[edit]
Illustration of translation from logical block addressing to physical geometry

Another common feature of address spaces are mappings and translations, often forming numerous layers. This usually means that some higher-level address must be translated to lower-level ones in some way. For example, a file system on a logical disk operates using linear sector numbers, which have to be translated to absolute LBA sector addresses, in simple cases, via addition of the partition's first sector address. Then, for a disk drive connected via Parallel ATA, each of them must be converted to logical cylinder-head-sector address due to the interface historical shortcomings. It is converted back to LBA by the disk controller, then, finally, to physical cylinder, head and sector numbers.

The Domain Name System maps its names to and from network-specific addresses (usually IP addresses), which in turn may be mapped to link layer network addresses via Address Resolution Protocol. Network address translation may also occur on the edge of different IP spaces, such as a local area network and the Internet.

Virtual address space and physical address space relationship

An iconic example of virtual-to-physical address translation is virtual memory, where different pages of virtual address space map either to page file or to main memory physical address space. It is possible that several numerically different virtual addresses all refer to one physical address and hence to the same physical byte of RAM. It is also possible that a single virtual address maps to one, one, or more than one physical address.

See also

[edit]

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In , an address space is the range of valid memory addresses that a processor or can generate and use to access locations, serving as an abstraction of the underlying physical provided by the operating system. This concept is fundamental to , enabling processes to operate as if they have exclusive access to a large, contiguous region, regardless of the actual physical hardware constraints. Typically, it encompasses virtual addresses generated by the CPU, which are mapped to physical addresses through hardware mechanisms like the (MMU). Address spaces are divided into virtual address spaces and physical address spaces. The virtual address space is the memory view presented to a running program or , including segments for (static instructions), stack (local variables and function calls), and heap (dynamically allocated data), allowing each to perceive a complete, private environment. In contrast, the physical address space refers to the actual range of addresses corresponding to the hardware's installed , such as RAM, which is limited by the system's architecture (e.g., 1 MB for early systems or up to 64 bits in modern processors). This distinction is central to systems, where the operating system uses techniques like paging and segmentation to translate virtual addresses to physical ones, supporting multiprogramming by loading multiple processes into simultaneously. The primary purposes of address spaces include isolation, , and efficient resource utilization. By assigning each process its own address space, the OS prevents one program from accessing or corrupting another's , enforced via MMU translations and privilege modes (e.g., user vs. kernel). This isolation enhances stability and , while virtual address spaces allow programs to exceed physical memory limits through swapping or demand paging. In shared-memory multiprocessing, address spaces can also facilitate controlled sharing via explicit mappings, balancing concurrency with safety.

Basic Concepts

Definition

In , an address space is defined as the range of discrete addresses available to a computer for identifying and accessing locations or other resources, such as peripherals or storage sectors. This range is typically represented as a contiguous sequence of bit patterns, where each unique address corresponds to a specific location within the 's . The concept enables efficient referencing of data and instructions, forming the foundation for in both hardware and software environments. The term "address space" originated in the context of early computer memory management during the late 1950s and 1960s, with the term notably formalized by Jack Dennis in 1965 in the design of the operating system, evolving from fixed addressing schemes in machines like the 7090, which featured a 15-bit field supporting 32,768 words of core memory. This development was influenced by pioneering systems such as the Atlas computer at the , where distinctions between program-generated addresses and physical memory locations first highlighted the need for abstracted addressing to handle limited hardware resources. By the mid-1960s, the concept had become integral to multiprogramming systems, allowing multiple processes to operate within isolated address ranges. In , address space primarily pertains to memory addressing mechanisms in hardware architectures and operating systems, distinct from analogous uses in networking, such as spaces that delineate ranges of protocol identifiers for devices. Key attributes include its size, which is determined by the width of the address bus—for instance, a 32-bit address space accommodates up to 4 GB (2^{32} bytes) of addressable —and its conventional starting point at 0. Address spaces may be physical, tied directly to hardware, or virtual, providing an illusion of larger, contiguous to software, though these distinctions are elaborated elsewhere.

Components and Units

An in an address space is structured as a consisting of a fixed number of bits, where each bit position represents a successive power of 2, enabling the enumeration of discrete locations from 0 to 2n12^n - 1 for an nn-bit . This binary representation forms the foundational unit of addressing in , with the least significant bit corresponding to 202^0 and higher bits scaling exponentially. For instance, a 32-bit uses bits 0 through 31 to specify up to 23212^{32} - 1 unique positions. The addressable unit defines the smallest granularity of memory that can be directly referenced by an address, typically a byte of 8 bits in modern systems. Byte-addressable architectures, such as x86 and MIPS, assign a unique address to every byte, allowing precise access to individual bytes within larger data structures like words or cache lines. In contrast, word-addressable systems treat the word—often 32 or 64 bits—as the basic unit, where each address points to an entire word rather than its constituent bytes, requiring additional byte-selection mechanisms for sub-word access. This distinction affects memory efficiency and programming models, with byte-addressability predominating in contemporary designs for its flexibility. The total size of an address space is determined by the formula 2n×u2^n \times u, where nn is the number of address bits and uu is the size of the addressable unit in bytes; in byte-addressable systems, this simplifies to 2n2^n bytes. For a 32-bit byte-addressable space, the maximum addressable is thus 2322^{32} bytes, equivalent to 4,294,967,296 bytes or 4 GB. Similarly, 64-bit systems support up to 2642^{64} bytes, or 16 exbibytes, though practical implementations may limit this due to hardware constraints.

Types of Address Spaces

Physical Address Space

The physical address space encompasses the range of actual locations in a computer's hardware , such as RAM, where and instructions are stored. It is defined by the physical addresses generated directly by the processor to access these hardware components, without any intermediary . This space is inherently tied to the physical of the system, including the capacity of chips and the interconnects like the memory bus. The size of the physical address space is primarily determined by the width of the address bus, which specifies the number of bits available to represent addresses. For instance, an n-bit address bus allows the system to address up to 2^n unique locations, typically in bytes. In 64-bit systems like , the theoretical maximum is 2^64 bytes (approximately 16 exabytes), but practical implementations are limited by hardware design; most current processors support up to 52 bits for physical addresses, enabling a maximum of 2^52 bytes (4 petabytes). Hardware constraints often restrict the physical address space below theoretical limits, such as chip capacity or bus architecture, necessitating techniques like bank switching or memory mapping to expand access. Bank switching divides the memory into fixed-size banks that can be selectively mapped into the addressable range, allowing systems to access more total memory than the native bus width permits by swapping banks via hardware registers or latches. For example, early 8-bit processors, such as those using the Z80, which commonly featured a 16-bit address bus despite their data width, were limited to a maximum physical address space of 64 KB (2^16 bytes); bank switching was employed in some Z80-based systems to extend effective memory access beyond 64 KB. In contrast, the Intel 8086, a 16-bit processor, used segmented addressing with a 20-bit effective address bus to access up to 1 MB. The CPU interacts with the physical address space through direct addressing, where memory operations use these raw physical addresses to read from or write to hardware locations without translation. This direct access ensures low-latency performance but makes the space vulnerable to fragmentation in multi-process environments, as contiguous blocks allocated to different processes can become scattered over time due to repeated allocations and deallocations.

Virtual Address Space

A virtual address space is an abstraction provided by the operating system to each process, creating the illusion of a large, contiguous, and private block of that appears dedicated solely to that process, regardless of the underlying physical configuration. This concept enables processes to operate as if they have exclusive access to a vast region, while the system maps these virtual addresses to actual physical locations as needed. The idea originated in the operating system, where it was implemented to support efficient sharing of resources among multiple users in a environment. It was further popularized in Unix systems, particularly through the adoption of paging mechanisms in (BSD) releases starting in the late 1970s. In typical implementations, the size of a virtual address space is determined by the processor's addressing capabilities: 232 bytes (4 GB) for 32-bit architectures and up to 264 bytes (16 exabytes) for 64-bit architectures, allocated independently to each process. This per-process allocation allows multiple processes to run concurrently, sharing the physical without direct interference, as the operating system manages the mappings dynamically. For instance, in a 64-bit system, each process can theoretically address petabytes of memory, though practical limits due to hardware and software constraints often reduce this to 48 bits or less for virtual addresses. Key benefits of virtual address spaces include robust isolation, which prevents one from accessing or corrupting the of another, thereby enhancing system security and reliability. Additionally, techniques like demand paging complement this abstraction by loading pages into physical RAM only upon access, reducing initial demands and allowing efficient use of secondary storage for less frequently used . This combination supports multitasking environments where can exceed the available physical without immediate failure. However, virtual address spaces have limitations, such as thrashing, which arises when the collective working sets—the actively referenced pages—of running processes surpass the physical RAM capacity, causing excessive page faults and swapping that degrade performance. The 32-bit virtual address space constraint, capping each process at 4 GB, also historically limited scalability, prompting innovations like (PAE) in x86 architectures to enable access to larger physical memory pools despite the virtual limit.

Address Mapping and Translation

Translation Mechanisms

In address translation, a virtual address (VA) is divided into two primary components: the virtual page number (VPN), which identifies the page in virtual memory, and the offset, which specifies the byte position within that page. The VPN is used to index a , retrieving the corresponding physical frame number (PFN) if the page is resident in physical memory; the physical address (PA) is then constructed by combining the PFN with the unchanged offset. This process enables the abstraction of a contiguous mapped onto potentially non-contiguous physical memory locations. The basic mapping can be expressed as: PA=(PFNpage_shift)+offset\text{PA} = (\text{PFN} \ll \text{page\_shift}) + \text{offset} where page_shift=log2(page_size)\text{page\_shift} = \log_2(\text{page\_size}), and a common page size is 4 KB (requiring a shift of 12 bits). This formula ensures that the offset aligns correctly within the physical frame, preserving the relative positioning of data. Two primary mechanisms underpin address translation: paging and segmentation. Paging employs fixed-size units called pages, typically 4 KB, to divide both virtual and physical memory into uniform blocks, facilitating efficient allocation and reducing external fragmentation. In contrast, segmentation partitions memory into variable-sized segments that correspond to logical program units, such as code or data sections, allowing for more intuitive sharing and protection but potentially introducing internal fragmentation. Some systems, including x86 architectures, adopt a hybrid approach that combines segmentation for high-level logical division with paging for fine-grained physical mapping. Protection is integral to the translation process, where hardware checks permissions associated with each page or segment entry—such as read, write, and execute rights—before granting access, thereby enforcing isolation between processes and preventing unauthorized modifications. Violations of these permissions trigger a fault, ensuring system security without compromising performance.

Hardware and Software Support

The (MMU) is a hardware component integrated into the CPU that performs real-time virtual-to-physical translation during access operations. It evolved from designs in the 1970s, notably in Digital Equipment Corporation's VAX systems, where the VAX-11/780 model, introduced in 1977, incorporated an MMU to support a 32-bit virtual space of 4 GB, with a 29-bit physical space allowing up to 512 MB of . In modern processors like those based on x86 architecture, the MMU handles paging mechanisms by walking through hierarchical page tables to resolve translations, enforcing attributes such as read/write permissions and user/ modes. Page tables serve as the core data structures for address mapping, organized hierarchically to manage large address spaces efficiently. In the 32-bit x86 (IA-32) architecture, a two-level structure consists of page directory entries (PDEs) and page table entries (PTEs); PDEs point to page tables or map 4 MB pages, while PTEs map individual 4 KB pages, with each entry including bits for presence, accessed status, and protection. For the 64-bit x86-64 (Intel 64) extension, a four-level hierarchy expands this capability: the Page Map Level 4 (PML4) table indexes to Page Directory Pointer Tables (PDPTs), which lead to Page Directories (PDs) and finally Page Tables (PTs), supporting up to 48-bit virtual addresses and page sizes of 4 KB, 2 MB, or 1 GB to accommodate expansive memory layouts. Later extensions, such as five-level paging introduced by Intel in 2017, support up to 57-bit virtual addresses (512 TiB) in compatible processors. This multi-level design reduces memory overhead by allocating tables on demand and only for used address regions. The (TLB) acts as a high-speed cache within the MMU to store recent translations, minimizing the latency of full walks on every access. Implemented with associative mapping for rapid parallel lookups, TLBs typically achieve hit rates exceeding 95% in workloads with good locality, such as sequential accesses, though rates can drop in sparse or random patterns. On x86 processors, the TLB miss penalty involves multiple references for traversal, often 10-100 cycles, underscoring its role in overall system performance. Software support for address translation is primarily provided by the operating system kernel, which dynamically allocates and populates page tables to reflect process address spaces. In systems like , the kernel maintains a multi-level (e.g., PGD, PUD, PMD, PTE) and updates entries during memory allocation or context switches. When the MMU encounters an unmapped or protected access, it triggers a , which the kernel handles via dedicated routines such as do_page_fault() on x86; the handler resolves the fault by allocating pages, updating tables, or signaling errors like segmentation faults to the process. This software-hardware interplay ensures efficient fault resolution while maintaining isolation between processes.

Practical Examples and Applications

In Operating Systems

In operating systems, the kernel plays a central role in managing address spaces by assigning a unique virtual address space to each process upon its creation, ensuring isolation and protection from other processes. This assignment occurs during process initialization, where the kernel allocates and initializes the virtual memory regions, such as the text, data, heap, and stack segments, tailored to the process's needs. For instance, in Unix-like systems, the fork() system call creates a child process by replicating the parent's virtual address space, providing an identical mapping that allows the child to start with a copy of the parent's memory state. To optimize memory usage and enhance security, operating systems employ advanced techniques within these address spaces. (COW) is a key mechanism that enables efficient sharing of memory pages between es, such as parent and child after a , by initially mapping the same physical pages to both while deferring actual duplication until a write occurs, thus reducing overhead during process creation. Additionally, (ASLR), introduced in the early 2000s as part of security enhancements like the PaX project in , randomizes the base addresses of key memory regions (e.g., stack, heap, and libraries) to thwart exploits such as buffer overflows by making return addresses and locations unpredictable. When a process's virtual address space exceeds available physical memory, the operating system handles growth through swapping, which involves moving inactive pages to disk-based swap space to free up RAM for active use, maintaining the illusion of ample memory. This technique, integral to virtual memory systems, allows processes to operate beyond physical limits by paging out less frequently accessed portions. For example, in 64-bit Linux, each process can utilize up to a 256-terabyte virtual address space (limited by 48-bit canonical addressing), far surpassing typical physical RAM capacities and relying on swapping for scalability. In multi-tasking environments, context switching between processes necessitates careful handling of address spaces to preserve and correctness. The operating system reloads the new process's page tables into the (MMU) during the switch, ensuring that memory accesses are translated according to the current process's virtual-to-physical mappings. To prevent information leakage from residual translations, the (TLB) is often flushed or invalidated, as stale entries could otherwise allow unauthorized access to another process's physical memory.

In Computer Architectures

Address spaces in computer architectures have evolved significantly to accommodate increasing memory demands and computational complexity. Early 8-bit architectures, such as the Intel 8080 introduced in 1974, featured a flat address space limited to 64 KB (65,536 bytes), where program, data, and stack memories shared the same contiguous region without segmentation or paging mechanisms. This design sufficed for simple embedded applications but constrained scalability as software grew more sophisticated. By the 32-bit era, architectures like MIPS introduced segmented addressing to divide the virtual address space into distinct regions for user, supervisor, and kernel modes, enhancing protection and flexibility within a 4 GB total space; for instance, MIPS32 Release 3's Programmed Segmentation Control allocates six segments based on virtual address bits, allowing fine-grained control over access permissions. Transitioning to 64-bit designs, the ARM AArch64 architecture provides vast virtual address spaces, supporting 48-bit addresses by default (256 TB) with optional extensions to 52-bit or 56-bit (up to 4 PB or 64 PB, respectively), enabling massive memory mappings for modern servers and mobile devices while maintaining compatibility with 32-bit legacy code. Specialized architectures adapt address spaces to domain-specific constraints. In embedded systems, 16-bit microcontrollers like the MSP430 series employ limited address spaces, typically 64 KB of byte-addressable memory, to prioritize low power and cost; the MSP430's 16-bit address bus divides this into sections for special-purpose registers, peripherals, and RAM/Flash, suiting real-time control applications where exceeding 64 KB would require external memory interfaces. Graphics processing units (GPUs) have innovated with unified address spaces to simplify programming across heterogeneous compute units. NVIDIA's framework introduced unified addressing with the Fermi architecture in 2010, allowing a single 40-bit shared between host CPU and device GPU memory, eliminating manual pointer conversions and enabling seamless data access across 1 TB of addressable space per device. To support multitasking without performance penalties, many architectures incorporate Address Space Identifiers (ASIDs) as hardware tags in translation lookaside buffers (TLBs). In architectures, ASIDs (8-16 bits wide) uniquely identify process address spaces, caching translations per-ASID to avoid full TLB flushes on context switches, which reduces overhead in systems with up to 256 or 65,536 concurrent processes. Similarly, RISC-V's Sv32, Sv39, and Sv48 modes include ASID fields (up to 16 bits) in the Supervisor Address Translation and Protection (SATPs) register, tagging TLB entries to isolate virtual-to-physical mappings across processes and hypervisors, enhancing efficiency in multi-tenant environments. As of 2025, future trends in address space design emphasize extensibility for emerging workloads. continues to evolve with ratified extensions like Sv48 (48-bit virtual addresses, 256 TB space) and Sv57 (57-bit, 128 PB space), building on Sv39's 39-bit baseline to support hyperscale data centers and AI accelerators requiring terabyte-scale mappings without altering the core ISA. These advancements, combined with ongoing research into post-quantum secure memory isolation, position open architectures like to address both capacity and cryptographic resilience in next-generation systems.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.