Old Exam 3 - Computer Architecture - Operating Systems | ECE 3055, Exams of Electrical and Electronics Engineering

Material Type: Exam; Class: Computer Arch & Oper Sys; Subject: Electrical & Computer Engr; University: Georgia Institute of Technology-Main Campus; Term: Fall 2006;

Typology: Exams

Pre 2010

Uploaded on 08/05/2009

koofers-user-cb9
koofers-user-cb9 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE3055 Prof. H.-H. S. Lee
Georgia Tech Page 1 of 6
ECE3055 Fall 2006
Computer Architecture and Operating Systems
Exam #3 December 4, 2006
in-class exam.
Close books, close notes.
Calculator OK.
This exam is given under the Georgia Tech Honor Code System. You must
observe and sign the Honor Pledge: “I have neither given nor received aid on
this exam.” Your print name and signature below signifies your compliance
with this honor code.
Name (Print): ________SOLUTION_________________
Signature: _________________________________________________
1. _____________ (25 pts)
2. _____________ (35 pts)
3. _____________ (20 pts)
4. _____________ (20 pts)
Total (100 pts) ____________
pf3
pf4
pf5

Partial preview of the text

Download Old Exam 3 - Computer Architecture - Operating Systems | ECE 3055 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

Georgia Tech Page 1 of 6

ECE3055 Fall 2006

Computer Architecture and Operating Systems

Exam #3 December 4, 2006

in-class exam.

Close books, close notes.

Calculator OK.

This exam is given under the Georgia Tech Honor Code System. You must

observe and sign the Honor Pledge: “I have neither given nor received aid on

this exam.” Your print name and signature below signifies your compliance

with this honor code.

Name (Print): ________ SOLUTION _________________

Signature: _________________________________________________

1. _____________ (25 pts)

2. _____________ (35 pts)

3. _____________ (20 pts)

4. _____________ (20 pts)

Total (100 pts) ____________

Georgia Tech Page 2 of 6

  1. (25%) Q&A. Keep your answer concise within one or two sentences.

1.1. Name the five possible states of a process during a process’ life.

New, Ready, Running, Waiting, Terminate

1.2. Which of the following components can be shared by multiple threads that belong to the same process? (a) Stack pointer; (b) Global data variables; (c) Code; (d) Register file; (e) Program counter

(b) Global data variables and (c) Code

1.3. Is a TLB absolutely necessary for successful address translations? Why?

No. TLB is simply a small cache to capture locality for page table entries.

1.4. When does a page fault take place?

When a memory page is not present in memory (i.e. no translation is found in page table), a page fault is triggered to bring the corresponding page into memory.

1.5. Explain how can “starvation” occur when priority scheduling is applied. Also explain the solution to resolve it.

Low priority processes are never scheduled for CPU time. Aging can be used to promote a lower priority process to higher priority over time.

Georgia Tech Page 4 of 6

2.3. (10%) To which “ virtual address ”, of “ which process ”, does the physical address 0x78e968 map? Please derive and write down the complete address in Hex value. If you cannot find a valid mapping, please answer “address not found”.

0x78e968 = 0111 1000 1110 1001 0110 1000 PPN = 011 = 3 Æ the 4th^ entry which has a valid entry with VPN=0x7fd for PID= Virtual address = 0x7fd || 1 1000 1110 1001 0110 1000 Virtual address = 1111 1111 1011 1000 1110 1001 0110 1000 Virtual address = 0xffb8e968 of Process P

2.4. (10%) Now the OS writer decides to use an index-based linear page table for each process. How big (in bits or bytes) the total page tables are needed for these active processes? Assume you have 2 extra bits (valid and dirty) in addition to the PPN for each page table entry.

From 2.2, we know the VPN has 11 bits. In other words, the total number of entries of an index-based linear page table will be 2^11 = 2048 possible translations.

Since there are only 8 pages in physical memory, thus PPN = 3 bits. Each page table entry = 3 + 2 (v and d bits) = 5 bits 5 * 2048 * 3 processes = 15*2K bits = 30Kbits = 3.75KB

Georgia Tech Page 5 of 6

  1. Process fork (20%). Given the following code, fill in the correct (compound) conditions in the question marks (???) so that all the new children and grandchildren processes will enter the if-clause while only the original master process enters the else-clause.

Version 1: if (ret_pid == 0 || ret_ppid == 0)

or

Version 2: if (! (ret_pid != 0 || ret_ppid != 0) )

#include <stdio.h> #include <unistd.h>

main() { int ret_pid, ret_ppid; int mypid;

ret_pid = fork(); ret_ppid = fork(); mypid = getpid();

if ( ??? ) { /* All Children/Grandchildren execute here / fprintf(stdout, "Child : mypid is %d\n", mypid); exit(0); } else { / The Master comes here */ fprintf(stdout, "Master: mypid is %d\n", mypid); wait(NULL); exit(0); } }

Ret_pid=C1_pid Ret_pid=

P C

P C2 C11 C

Ret_pid=C1_pid Ret_ppid=C2_pid My_pid=P_pid

Ret_pid=C1_pid Ret_ppid= My_pid=C2_pid

Ret_pid= Ret_ppid=C My_pid=C11_pid

Ret_pid= Ret_ppid= My_pid=C12_pid