Provide an outline for the data structure for a process control block. A short comment must identify the purpose of each field in your struct. 5 marks. Explain the behaviour of the parent and the child in the following code fragment. if ((pid = fork()) < 0) { perror("fork"); exit(1); } if (pid == 0) { execvp(*args, args); perror(*args); exit(1); } waitpid(pid,&status,0) != pid; if WIFEXITED(status) printf("return value was %d \\n" ,WEXITSTATUS(status); 12 marks. Explain, with the aid of the following kernel code, the role of 'goodness' and also the different scheduling strategies. static inline int goodness(struct task_struct * p, int this_cpu, struct mm_struct *this_mm) { int weight; weight = -1; if (p->policy & SCHED_YIELD) goto out; if (p->policy == SCHED_OTHER) { weight = p->counter; if (!weight) goto out; #ifdef CONFIG_SMP if (p->processor == this_cpu) weight += PROC_CHANGE_PENALTY; #endif if (p->mm == this_mm || !p->mm) weight += 1; weight += 20 - p->nice; goto out; } weight = 1000 + p->rt_priority; out: return weight; } /* * the 'goodness value' of replacing a process on a given CPU. * positive value means 'replace', zero or negative means 'dont'. */ static inline int preemption_goodness(struct task_struct * prev, struct task_struct * p, int cpu) { return goodness(p, cpu, prev->active_mm) - goodness(prev, cpu, prev->active_mm); } 15 marks Unix and Gnu/Linux treat most devices as files. How can you identify the device type from a directory listing? 4 marks The i386 architecture dependent part of memory management in the Linux kernel relies on pages. Explain, with the aid of diagrams, how this is structured? 15 marks Explain the role of a command line interpreter ( 3 marks) and provide a pseudo-code outline for a simple interpreter that includes built in functionality and backgrounding of tasks. 15 marks.