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

Info iconThis 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 BSS DATA STACK STACK STACK e HEAP TEXT 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.
Background image of page 1

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

View Full DocumentRight 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? A non-preemptive operating system has the danger of being hang if one of the applications never gives up the processor. Modern operating systems have preemptive scheduling to prevent this problem, giving a fair share of time to each ready process. 7. (4 pts.) How many processes can be in
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 7

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online