This is the exact (non-race?) condition for students to collectively provide answers to the old exam. We are a couple of (benevolent) students who have come up with the following answers. In case you don't agree with us, please let us know! Exam OS1 (1DT044) / OSPP (1DT096), 2018-08-22 Mixed concepts 1 - K 2 - T 3 - R 4 - I 5 - N 6 - M 7 - J 8 - C 9 - G 10 - S Module 1 1.1 B 1.2 B 1.3 B 1.4 D 1.5 D 1.6 C Module 2 2.1 C 2.2 A 2.3 C 2.4 D 2.5 B 2.6 D (The dup2 syscall is used for redirection.) 2.7 B (The PCB is managed by the kernel.) 2.8 B 2.9 A Module 3 3.1 D 3.2 D 3.3 A 3.4 Avereage response time = 0 + (2-1) + (11-4) + (8-7) 9 = --------------------------- = --- = 2,25 4 4 Avereage waiting time = (4-2 + 15-5) + (2-1 + 5-4) + (11-4 + 16-15) + (8-7 + 18-11) 30 = ----------------------------------------------------------- = ---- = 7,5 4 4 3.5 Preemptive Shortest Job First: --------------------------------------------------------------------------------- | P1 | P2 | P3 | P1 | P4 | P5 | P4 | |___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Round-Robin, quantum = 3: --------------------------------------------------------------------------------- | P1 | P2 | P1 | P3 | P4 | P4 | P5 | P4| |___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Module 4 4.1 C 4.2 A 4.3 D 4.4 D 4.5 TRUE while key lock 4.6 Fill in the need matrix (0.5 pt): | A | B | C | D | T0 | 2 | 1 | 0 | 4 | T1 | 4 | 2 | 2 | 0 | T2 | 0 | 1 | 1 | 1 | T3 | 2 | 1 | 3 | 1 | Show each step of the Banker’s algorithm using the available matrix and the done and choice vectors (2 pt): | Available | Step | A | B | C | D | Choice 1 | 1 | 1 | 1 | 2 | T2 2 | 6 | 2 | 2 | 2 | T1 3 | 6 | 3 | 4 | 2 | T3 4 | 6 | 5 | 7 | 3 | -- 5 | - | - | - | - | According to the result of Banker’s algorithm from above, is the state safe (0.5 pt)? - No. T0 will not be able to run. The whole exercise is somewhat pointless, because you can see that the vector of totally available is = <8,5,8,5> but T0's request for resource D is 6, which exceeds what is totally available ... Module 5 5.1 stack heap data text 5.2 C 5.3 8kB = 2^3 • 2^10 B = 2^13 B, so 13 bits are used for each page (offset). 0x A 6 1 9 = 0b 1010 0110 0001 1001 = -- 5 0 0110 0001 1001 which according to the page table translates to -- 3 0 0110 0001 1001 = 0x 0110 0110 0001 1001 = 0x 6 6 1 9 = = = = = = = = = = = 5.4 B 5.5 C