Quiz 5 Flashcards
A program must be in what for it to run?
In memory
What are the only sources of storage can the CPU access directly?
Main memory and registers
Why can main memory cause stalls?
Because accessing it may require multiple cycles
What is between main memory and CPU registers?
Cache
What is the order of memory from smallest to largest?
Register->Cache->Main Memory->External Storage
How does the OS ensures that a process can only access those addresses in its address space?
It uses a pair of base and limit registers to define the logical address space of a process
What must the CPU do to insure that every memory access generated in user mode is between the base and limit for the user?
It checks if the address is larger than the base register and smaller than the base + limit register, if this is not the case it causes an error.
Where do programs brought into memory execute from?
The input queue
What binds relocatable addresses to absolute addresses?
Linkers or loaders
What are the three stages where the binding of instructions and data to memory addresses can occur?
Compile time, Load Time and Execution Time
When memory addresses are bound during compile time what type of code can be generated?
Absolute code, assuming that the memory location is known a priori
When memory addresses are bound during load time what type of code can be generated?
Relocatable code
What is a logical address?
An address generated by the CPU
What is a physical address?
Address seen by the memory unit
When are logical and physical addresses are the same?
During compile time and load-time address-binding schemes
When do logical and physical addresses differ?
During execution time address binding schemes
What is the logical address space?
The set of all logical addresses generated by a program
What is the physical address space?
The set of all physical addresses generated by a program
What is the memory management unit?
A hardware device that maps virtual addresses to physical addresses
During a simple scheme what occurs?
The base register is called a relocation register
The value in the relocation register is added to every address generated by a user process
During a simple scheme what does the user program deal with?
Logical addresses
What is dynamic loading?
Loading only what you require into memory while executing a program
When are routines loaded during dynamic loading?
When they are called
Is special support needed from the operating system when you use dynamic loading?
No
What is static linking?
The system libraries and program code is combined by the loader into the binary program image
What is dynamic linking
When linking is postponed until execution time
What is used to locate the appropriate memory resident library routine?
The stub
What do stubs do?
Replaces itself with the address of the routine it stands in for and executes the routine
What is an early method of allocating memory?
Contiguous allocation
What was the two partitions of the main memory?
The low memory, which contained the resident operating system and the high memory which was held user processes
What does the limit register do with contiguous allocation?
It insures that the logical addresses are less than it
What is variable partition?
The memory is segmented into various sizes and when a process arrives it gets placed into one of these segments large enough to accommodate it
What are the three algorithms for dynamic storage?
First fit, Best fit and Worst fit
How does the first fit algorithm allocate holes?
It allocates holes large enough to fit the process
How does the best fit algorithm allocate holes?
Allocates the smallest hole big enough to fit the process
How does the worst fit fit algorithm allocate holes?
Allocate the largest hole
What are the two types of framentation?
External fragmentation and Internal Fragmentation
What is External Fragmentation?
Total memory space exists to satisfy a request, but it is not contiguous
What is internal fragmentation?
Allocated memory is slightly larger than the request memory, and is not being used by the process
For the first fit algorithm how much memory is lost due to fragmentation?
50%
What can be done to reduce external fragmentation?
Compaction, ie shuffling memory contents to place all free memory together in one large block
What are frames?
A section of physical memory divided into a block
What are the qualities of the memory of a frame?
The size of the memory is a power of 2, it is between 512 bytes and 16 megabytes
What are pages?
Sections of logical memory divided into chunks
What is a page table?
A table that keeps track of the pages in a program
What are the two sections of an address generated by the CPU?
A page number, and a page offset
What is a page number?
An index into a page table
What is a page offset?
A number added to the physical memory address that is sent to the memory unit