📝 Address binding in Main memory (13 MCQs)
📖 From Operating System • 8. Main Memory • 13 questions available
What is Address binding in Main memory?
Definition:
Address binding is the process of mapping symbolic or logical addresses to physical memory locations at compile time, load time, or run time using base registers or MMU translation.
Example:
When a program references variable at logical address , the OS binds it to physical address during loading by adding the base register value.
Reason:
Binding enables multiprogramming and memory protection by decoupling program code from fixed physical locations allowing flexible memory management.
📝 All Address binding in Main memory MCQs
Q1. Which component of the operating system is primarily responsible for converting symbolic addresses to physical memory locations when a program is loaded?
📖 Explanation: The loader reads the executable file, applies the address binding information, and maps the program’s symbolic addresses to actual physical addresses. The assembler only translates assembly code to machine code, the linker resolves external references but does not perform the final mapping, and the compiler works at a higher level before code generation. Understanding the loader’s role clarifies how programs become ready for execution in real hardware.
Q2. Why is it important for an operating system to perform address binding at load time rather than at compile time?
📖 Explanation: Address binding at load time adapts the program to the actual memory layout present when it runs, but it does not affect the executable file size. Binding at compile time would fix addresses, limiting portability. Virtual memory and CPU speed are unrelated to the timing of binding. Recognizing this distinction helps students see why loaders handle binding dynamically.
Q3. How does static address binding differ from dynamic address binding in terms of flexibility and memory usage?
📖 Explanation: Static address binding fixes addresses at compile or load time, making relocation difficult and preventing memory sharing. Dynamic binding, often implemented with relocation tables, lets the OS place programs anywhere in memory, enabling sharing of common code and better utilization of RAM. This contrast highlights why modern systems favor dynamic binding for efficiency and flexibility.
Q4. A program compiled for a system with a 32‑bit address space is loaded on a machine that supports 64‑bit addresses. Which binding strategy ensures the program runs correctly without modification?
📖 Explanation: Dynamic binding uses relocation tables that the loader can adjust to the actual memory addresses at run time, allowing a 32‑bit program to execute on a 64‑bit system. Static binding would fix addresses unsuitable for the new environment, and hard‑coded absolute addresses would likely reference invalid locations. Link‑time resolution occurs before loading, so it cannot adapt to the runtime address space.
Q5. During execution, a process attempts to access memory address 0x7FFF F000, but the OS maps it to a different physical frame. Which mechanism is responsible for this translation?
📖 Explanation: Paging divides memory into fixed‑size pages and uses a page table to translate virtual addresses like 0x7FFF F000 to physical frames. Segmentation uses variable‑size segments, which is a different scheme. The loader’s address binding occurs before execution, establishing initial mappings, while cache protocols handle data consistency, not address translation. Knowing paging’s role clarifies how modern OSes manage virtual‑to‑physical address conversion.
Q6. A developer writes a program that uses a shared library compiled for a different version of the OS. Which binding technique allows the program to locate and use the correct library at run time?
📖 Explanation: Dynamic linking defers the resolution of library functions until the program runs, enabling the OS to locate the appropriate version of the shared library and resolve addresses then. Static linking incorporates library code at compile time, preventing version flexibility. Compile‑time binding is similar to static linking, and hard‑coded paths limit portability. Understanding dynamic linking helps explain how programs can adapt to evolving library versions.
Q7. What advantage does logical address abstraction provide to programmers when writing portable code?
📖 Explanation: Logical addresses allow programmers to write code without knowing the actual physical memory layout, making the program portable across systems with different memory capacities. This abstraction does not directly affect execution speed, error handling, or binary size. Recognizing this benefit explains why operating systems expose logical addresses rather than raw physical addresses.
Q8. Consider a system where a process’s code segment must be relocated to a different base address each time it is loaded. Which binding approach best supports this requirement?
📖 Explanation: Hard‑wired address mapping would fix the code at a single location, contradicting the need for relocation. Static binding with absolute addresses also lacks flexibility. Dynamic binding with relocation information enables the loader to adjust the base address at load time, satisfying the requirement. Understanding these options illustrates why dynamic binding is essential for relocatable code.
Q9. A program uses an array of size 1024 integers. If the system uses a page size of 4 KB, how many pages will the array occupy?
📖 Explanation: Each integer typically occupies 4 bytes, so the array uses bytes, exactly one page of 4 KB. Therefore, the array fits within a single page. Miscalculations might assume more pages by overlooking the exact match between array size and page size. This example shows how address binding interacts with paging to determine memory allocation.
Q10. Why might an operating system choose to perform address binding at run time rather than at load time for certain processes?
📖 Explanation: Run‑time address binding enables techniques such as address space layout randomization (ASLR), which randomizes where code and data are placed in memory, enhancing security by making exploits harder to predict. It does not affect compilation speed, disk I/O, or linker simplicity directly. Recognizing the security motive clarifies why some systems defer binding until execution.
Q11. In a system that supports both paging and segmentation, which component primarily handles the translation from a logical address to a physical address?
📖 Explanation: When both paging and segmentation are used, the logical address is first divided into a segment selector and offset; the segment table locates the segment, then the offset is further divided into page number and offset within the page, which the page table translates to a physical frame. Thus, the page table performs the final mapping. Understanding this hierarchy helps students see how multiple translation mechanisms cooperate.
Q12. Which term describes the address that a program uses while it is executing, independent of its actual location in physical memory?
📖 Explanation: A logical or virtual address is the address a program sees during execution; it is independent of where the operating system places the program in physical memory. Physical addresses refer to actual hardware locations, while absolute addresses are fixed values that do not change. Recognizing the distinction helps learners grasp why address translation is necessary.
Q13. A system uses a base register to add a constant offset to all addresses of a process. What kind of address binding does this represent?
📖 Explanation: Base‑relative binding adds a constant offset (the base register value) to each logical address at run time, allowing the process to be relocated without changing the code. This is a form of dynamic binding because the actual physical address is calculated during execution. It differs from static binding, which fixes addresses at compile or load time, and from segmented binding, which uses segment descriptors.