Midterm Exam and solutions

Midterm Exam and solutions - Midterm Exam & Solutions...

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

View Full Document Right Arrow Icon
CS252 Spring 2000 1. (4 pts.) What is a real-time system, a hard real-time system, and a soft real-time system? A real-time system is used when there is a rigid time requirement in the operation. For example, for medical equipment, traffic lights, computer systems for cars, etc. There are two types of real-time systems. A hard real- time systems deal with critical tasks that should be completed on time while soft real-time systems deal with critical tasks that get the highest priority until completion. 2. (4 pts.) What are the differences between kernel and user mode? In kernel mode, the system has access to an extended set of instructions; it can modify the interrupt vector, and can modify any section of memory. In user mode, the system has access to only a restricted set of instructions, cannot modify the interrupt vector, and has access to a restricted range of memory. 3. (4 pts.) Why modern CPU's have kernel and user mode? Modern CPU's have kernel and user mode because of reliability and security. Reliability because the user program can crash without crashing other programs. Security because different user processes are kept separate, and resources can be protected by unwanted users. 4. (4 pts.) Why system calls use software interrupts? System calls use software interrupts because software interrupts allow switching from user to kernel mode. System calls is the way to access operating system services and need to run in kernel mode. In kernel mode, the system will have access to the interrupt vector and the memory it will need to perform its operations. 5. (4 pts.) What are the steps for servicing an interrupt? Steps for servicing an interrupt a. interrupt b. save registers, program counter, return address, etc. c. go to interrupt vector and jump to address corresponding to that interrupt d. execute driver e. restore all registers and other memory saved in b. f. return to place in code where interrupt was executed -> to return address 6. (4 pts.) How many program counters and sets of registers are stored in a single process table entry?
Background image of page 1

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

View Full DocumentRight Arrow Icon
There is one program counter and one set of registers for each thread in the process. 7. (4 pts.) In which state processes are most of the time and in what kind of programs this is not true? Processes are in the "waiting" state most of the time. The exception are numerical analysis programs and screen-savers that are CPU intensive and do not require to wait for input. 8. (4 pts.) What are the advantages and disadvantages of using threads vs. using processes?
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 / 8

Midterm Exam and solutions - Midterm Exam & Solutions...

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