Explore BrainMass
Share

Explore BrainMass

    Memory Management

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I need help with the following problem.

    Decribe in a few paragraphs
    Which of the following components is responsible for loading the initial value in the program counter for an application program before it starts running:
    • Compiler
    • Linker
    • Loader
    • Boot module or boot ROM
    Identify three styles of switching from user mode to supervisor mode.
    Explain the steps that an operating system goes through when the CPU receives an interrupt.
    Describe the advantages of using a MMU (memory management unit) that incorporates segmentation and paging over ones that either use pure paging or pure segmentation.
    Describe how an operating system that uses paging could make stacks grow dynamically if the original size proves too small. What would the page table data structures look like? Explain what would happen when a thread's stack grows past the area that has been allocated for it (e.g., how would the OS notice this fact, and what would happen inside the OS when it notices this fact). Could a similar effect be achieved with multi-level page tables? Segments? Paged segmentation? Inverted page tables?

    © BrainMass Inc. brainmass.com October 9, 2019, 7:47 pm ad1c9bdddf
    https://brainmass.com/computer-science/processor-architectures/components-memory-management-129510

    Attachments

    Solution Preview

    Contents
    Question 1 2
    Answer 1 2
    Question 2 2
    Answer 2 2
    Question 3 2
    Answer 3 2
    Question 4 3
    Answer 4 3
    Question 5 3
    Answer 5 3
    Question 6 3
    Answer 6 3
    Inverted page table 4
    Multilevel page table 5
    Virtualized page table 5
    Question 7 5
    Answer 7 5
    Question 8 6
    Answer 8 6

    I need help with the following problem.

    Decribe in a few paragraphs
    Question 1
    Which of the following components is responsible for loading the initial value in the program counter for an application program before it starts running:
    • Compiler
    • Linker
    • Loader
    • Boot module or boot ROM
    Answer 1
    Loader

    Question 2
    Identify three styles of switching from user mode to supervisor mode.
    Answer 2
    1. Interrupts, when a device sends an interrupt to the CPU.
    2. When a program executes a system call, which is usually implemented by a trap instruction.
    3. When a program performs an operation that causes a hardware exception, such as divide by zero, illegal memory access or execution of an illegal opcode.

    Question 3
    Explain the steps that an operating system goes through when the CPU receives an interrupt.
    Answer 3
    • First, the hardware switches the machine to supervisor mode and causes control to transfer to a routine at a pre-specified address. The operating system has already loaded that address with a pointer to a function that handles the interrupt.
    • The function starts by saving all registers, possibly setting the allowed interrupts to a level that guarantees correct execution of the operating system, and then executes the code to serve the interrupt.
    • When the operating system is done, it restores the registers again and calls the "reti" to return to the user program that was running when the interrupt occurred.
    • If there is no runnable program, the operating system jumps to the idle loop and waits for an interrupt.
    • Finally, if the interrupt occurred while the operating system was running, then the OS simply restores the registers and jumps to the instruction following the
    one at ...

    Solution Summary

    The expert examines the components of memory management.

    $2.19