In: Computer Science
Part A
Operating systems generally maintain a computer’s file system. Which of the following items of information about a file would you expect an operating system to maintain? Note: This question gives a small amout of negative marks for wrong answers.
Select one or more:
a. File password
b. Modification date
c. Ownership
d. Font size
e. Access permissions
f. Last access date
g. File checksum
h. Location (directory)
i. Colour
j. Expiry date
k. File name
l. File size
m. Create date
n. Importance
PART B
Memory management is part of the tasks of a multi-programmed operating system. In multi-programmed operating systems, the OS runs each program in its own (virtual machine) memory area. That is, the program’s stack and program counter as well as working memory are within that memory area allocated by the OS. Each time a program tries to write data to memory, the OS needs to check that the memory location that the program wants to write to is within that program’s memory area. Under Unix operating systems, a segmentation fault indicates that the operating system has caught a process A trying to write to a memory address allocated to a different process B.
What do you think should happen, and why?
Select one:
a. The OS should terminate process A, and keep process B running. Since the memory areas obviously overlap, B will eventually cause its own segmentation fault and will be terminated by the OS then.
b. The OS does not need to terminate either process - the write attempt can simply be left unsuccessful and the segmentation fault can be ignored.
c. The OS should terminate both process A and B. An attempt by process A to write to process B's memory area indicates a problem with the program of process A, but it also indicates that the program of process B has a vulnerability.
d. The OS should terminate process A, and keep process B running. An attempt by process A to write to process B's memory area indicates a problem with the program of process A, not with the program of process B.
e. The OS should terminate both process A and B. An attempt by process A to write to process B's memory area indicates a problem with the program of process A, but process B gets damaged as its memory area gets written to before the segmentation fault.
f. The OS should terminate process B as it got in the way of process A's write attempt. Not terminating B would cause A to deadlock.
PART C
Part A:
(a) File password - Maintained by operating system.
(b) Modification date - Last change date is maintained by operating system.
(c) Ownership - User name is maintained by operating system.
(d) Font size - Font size is maintained by operating system.
(e) Access permissions - Access permissions are maintained by operating system.
(f) Last access date - Last access date is maintained by operating system.
(g) File checksum - File checksum is not maintained by operating system. This is an attribute of the file itself.
(h) Location (directory) - File path is maintained by operating system.
(i) Color - Some system files are colored as blue which indicates high importance. This is maintained by operating system.
(j) Expiry date - There is no such attribute of a file.
(k) File name - It is maintained by operating system.
(l) File size - It is maintained by operating system.
(m) Create date - It is maintained by operating system.
(n) Importance - It is not maintained by operating system.
Part B:
Option (d) is the correct answer.
The OS should terminate process A, and keep process B running. An attempt by process A to write to process B's memory area indicates a problem with the program of process A, not with the program of process B. The segmentation fault occured due to the access authorization issue of process A.
Hope this helps.