Operating System Concepts: Address Space and Binding

ElegantGallium5225 avatar
ElegantGallium5225
·
·
Download

Start Quiz

Study Flashcards

34 Questions

A pair of ______ and limit registers define the logical address space.

base

An input queue is a collection of ______ on the disk that are waiting to be brought into memory.

process

User programs usually go through several ______ before being run.

steps

At compile time, if memory location known a priori, _______ code can be generated.

absolute

Source code addresses are usually ______ like count.

symbolic

Compiled code addresses bind to ______ addresses.

relocatable

If memory location is not known at compile time, compiler must generate _______ code.

relocatable

If the process can be moved during its execution from one memory segment to another, binding delayed until _______ time.

run

The address space of the computer starts at ______.

00000

Special _______ support is needed for address maps.

hardware

Binding of instructions and data to memory addresses can happen at _______ different stages.

three

Address binding of instructions and data to memory addresses can happen at compile time, load time, or _______ time.

execution

The best-fit method allocates the smallest ______ that is big enough.

hole

First-fit and best-fit are better than worst-fit in terms of ______ and storage utilization.

speed

External fragmentation occurs when total memory space exists to satisfy a request, but it is not ______.

contiguous

Internal fragmentation occurs when allocated memory may be slightly larger than requested memory, resulting in ______ internal to a partition.

memory

Compaction involves shuffling memory contents to place all free memory together in one large ______.

block

Paging is a memory management scheme that allows physical memory space of a process to be non ______.

contiguous

Logical address 0 is page 0, offset 0→ indexing into the page table we get page 0 is in frame ______.

5

Logical address 0 maps to physical address ______ = [(5*4) +0].

20

Page size = ______ bytes.

2,048

Internal fragmentation of 2,048 - 1,086 = ______ bytes.

962

On average fragmentation = ______ / 2 frame size.

1

Since the operating system is managing physical ______, it has to maintain allocation details.

memory

Assume __________ Hit ratio.

80%

If it takes 20 nSec to search the __________ and 100 nSec to access memory,

TLB

A mapped memory access takes 120 nSec when the page number is in the __________.

TLB

The Effective Memory Access Time = 0.80120 + 0.20220 = 140 nSec due to a __________ of 40% slow down.

memory

One copy of read-only (reentrant) code shared among processes is called __________ pages.

shared

A segment is a logical unit such as main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, and __________.

arrays

Logical address consists of a two tuple: segment number, __________.

offset

With each entry in segment table, associate a validation bit, which is 0 for an __________ segment.

illegal

Memory allocation is a __________ storage-allocation problem due to varying segment lengths.

dynamic

The capability of operating systems that enables programs to address more memory locations than are actually provided in main memory is called __________ memory.

virtual

Study Notes

Base and Limit Registers

  • A pair of base and limit registers define the logical address space.
  • The base register holds the smallest legal physical address, and the limit register holds the largest legal physical address.

Hardware Address Protection with Base and Limit Registers

  • The base and limit registers are used to protect the address space from unauthorized access.
  • The base register ensures that the program cannot access memory locations below the base address, and the limit register ensures that the program cannot access memory locations above the limit address.

Address Binding

  • Address binding is the process of translating logical addresses to physical addresses.
  • Address binding can occur at three stages: compile time, load time, and execution time.
  • Compile-time binding is used when the memory location is known a priori.
  • Load-time binding is used when the memory location is not known at compile time.
  • Execution-time binding is used when the process can be moved during its execution from one memory segment to another.

Multistep Processing of a User Program

  • The processing of a user program involves several stages, including compilation, loading, and execution.
  • The compiler translates the source code into object code, and the linker resolves external references.
  • The loader loads the object code into memory, and the operating system manages the memory allocation.

Logical vs. Physical Address Space

  • The logical address space is the range of addresses that a program can generate.
  • The physical address space is the range of addresses that are physically available in the computer.
  • The physical address space is usually smaller than the logical address space.

Memory Allocation

  • Memory allocation involves assigning physical memory to a process.
  • The first-fit algorithm assigns the first available block of memory that is large enough to satisfy the request.
  • The best-fit algorithm assigns the smallest available block of memory that is large enough to satisfy the request.
  • The worst-fit algorithm assigns the largest available block of memory that is large enough to satisfy the request.

Fragmentation

  • Fragmentation occurs when free memory is broken into small, non-contiguous blocks, making it difficult to allocate large blocks of memory.
  • External fragmentation occurs when free memory is scattered throughout the memory space.
  • Internal fragmentation occurs when allocated memory is larger than the requested memory, leaving unused space.

Paging

  • Paging is a memory management scheme that divides physical memory into fixed-size blocks called pages.
  • The logical address space is divided into fixed-size blocks called pages, and each page is mapped to a frame in physical memory.
  • The page table maps logical page numbers to physical frame numbers.

Paging (Cont.)

  • Calculating internal fragmentation: the page size, process size, and internal fragmentation can be calculated.
  • The worst-case fragmentation is one frame minus one byte, and the average fragmentation is half a frame size.

Free Frames

  • The operating system maintains a list of free frames, which are frames that are not allocated to any process.
  • The operating system uses a frame allocation algorithm to allocate free frames to processes.

Shared Pages

  • Shared pages allow multiple processes to share the same page of memory.
  • Shared code, such as read-only reentrant code, can be shared among processes.

Segmentation

  • Segmentation is a memory-management scheme that supports the user's view of memory.
  • A program is divided into logical segments, such as main program, procedure, function, method, object, local variables, global variables, and common block.

Segmentation Architecture

  • The logical address consists of a two-tuple: .
  • The segment table maps the two-dimensional physical addresses, and each table entry has a base and limit.
  • The segment-table base register points to the segment table's location in memory.

Segmentation Architecture (Cont.)

  • Protection is achieved through validation bits and protection bits associated with segments.
  • Code sharing occurs at the segment level, and memory allocation is a dynamic storage-allocation problem.

Test your knowledge on operating system concepts, including base and limit registers, hardware address protection, and address binding. Learn about logical address spaces and program execution in memory.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser