Reference no: EM132650044
CSC2404 Operating Systems Assignment - University of Southern Queensland, Australia
Question 1 - Answer the following questions:
a. Consider the following page reference string:
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6
Using the above page reference string display the contents of the frames and marking when a page fault occurs after each page reference. Use the following algorithms
- LRU replacement
- FIFO replacement
- Optimal replacement
and assume 3 frames. Repeat using 4 frames.
Remember that all frames are initially empty, so the first unique pages will cost one fault each.
b. The VAX/VMS system uses a FIFO replacement algorithm for resident pages and a free-frame pool of recently used pages. Assume that the free-frame pool is managed using the least recently used (LRU) replacement policy. Answer the following questions:
(i) If a page fault occurs and if the page does not exist in the free-frame pool, how is free space generated for the newly requested page?
(ii) If a page fault occurs and if the page exists in the free-frame pool, how is the resident page set and the free-frame pool managed to make space for the requested page?
(iii) What does the system's paging algorithm reduce to if the number of resident pages is set to one?
(iv) What does the system's paging algorithm reduce to if the number of pages in the free-frame pool is zero?
Question 2 - Answer the following questions:
a. Explain what information is stored in a file-system's directory structure.
b. Explain why it is important that a file-system's directory structure be acyclic.
c. What methods can a system employ to ensure that the directory structure is acyclic?
d. Consider a file system in which a file can be deleted and its disk space reclaimed while links (directory file entries) to that file still exist.
(i) What problems may occur if a new file is created in the same storage area or with the same absolute path name?
(ii) How can these problems be avoided?
Question 3 - Answer the following questions:
a. Explain what a file-system "journal file" or "transactional log file" is.
b. Explain why the existence of the "log" or "journal" file ensures recovery of a file system after a system crash.
c. When copying a file to a USB flash drive on a Unix system it is extremely important to unmount the flash drive before removing the device. Explain why. If the USB flash drive is removed before unmounting then the copied file will normally appear on the flash drive's file system (have a directory entry and an inode) but will be empty. Explain why the file meta data is copied synchronously but the file data is copied asynchronously.
Question 4 - What are the steps required to be performed by the Ext2 file system kernel module to create a new file that contains 4000 bytes of data? Assume that a copy of the directory inode the file is to be created in is already in memory. Also assume the block size is 1024 bytes. Either list the steps required or use a flowchart. (See the week 11 practical for information on the Ext2 file system and examples of listing the required steps or writing a flowchart).