{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Fall 1999 - Fall 1999 1(6 pts Assume the following program...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 1999 1. (6 pts.) Assume the following program. Write the memory section in the program that corresponds to each of the following memory addresses: Memory Address Memory Section &a BSS &b DATA &c STACK &d STACK &e STACK e HEAP &main TEXT &printf SHARED LIBARY or TEXT int a[300]; int b = 25; void foo() { int d; } int main()( int c; int * e = new int; } 2. (4 pts.) Describe the steps of an interrupt routine 1. Save registers and return address 2. Jump to the address in the interrupt vector that corresponds to this interrupt 3. Service the interrupt 4. Retry the offending instruction if necessary 5. Restore the registers and return to the saved return address. 3. (4 pts.) What is protected and unprotected CPU mode? In the CPU protected mode (kernel mode) the CPU is able to execute an extended set of instructions, such as writing to devices. In this mode the CPU is also able to write to any address in physical memory and to change the interrupt vector.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
In unprotected mode (user mode), the CPU is able to execute a reduced set of instructions and it is only allowed to acces a restricted range of memory. 4. (4 pts.) Which CPU mode do interrupts run in and why? Interrupts run in protected mode (kernel mode) to be able to access device registers and kernel memory. 5. (4 pts.) Why do system calls use software interrupts instead of procedure calls? System calls is the way to access operating system services and need to run in kernel mode. Software interrupts allow to switch from user to kernel mode. 6. (4 pts.) Why do modern operating systems use preemptive scheduling?
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern