Solutions for the First Quiz COSC 6360 Spring 2014.
-
Upload
nickolas-wright -
Category
Documents
-
view
223 -
download
0
Transcript of Solutions for the First Quiz COSC 6360 Spring 2014.
![Page 1: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/1.jpg)
Solutions for the First Quiz
COSC 6360
Spring 2014
![Page 2: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/2.jpg)
First question
Match each of the following features with the single sentence that describes it best:
![Page 3: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/3.jpg)
pipes
Forward the standard output of a process to the standard input of another one.
![Page 4: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/4.jpg)
special files
Actually represent hardware devices.
![Page 5: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/5.jpg)
file systems
Are the UNIX equivalents of Windows disk partitions.
Will also accept: Contain both data blocks and i-node blocks.
![Page 6: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/6.jpg)
symbolic links
Allow a directory entry to refer to a file located in a different file system.
![Page 7: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/7.jpg)
superblocks
Describe the contents of a given file system.
![Page 8: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/8.jpg)
synchronous updates
Used to guarantee the correct serial execution of metadata updates.
![Page 9: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/9.jpg)
cylinder groups
Contain both data blocks and i-node blocks.
![Page 10: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/10.jpg)
bit maps
Keep track of free blocks on disk.
![Page 11: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/11.jpg)
fork()
Creates a new process.
![Page 12: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/12.jpg)
exec()
Loads in memory the new program to be executed by a given process.
![Page 13: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/13.jpg)
UNIX file system
In a 64-bit UNIX file system, what is the minimum block size that would allow users to access X GB using two levels of indirection?
Hint: use trial and error
![Page 14: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/14.jpg)
Answer
Block Size = 8KBwith two levels of indirection we can access
1K×1K×8 KB = 8 GB Block Size = 16KB
with two levels of indirection we can access2K×2K×16KB = 64 GB
Block Size = 32KBwith two levels of indirection we can access
4K×4K×32KB = 512 GB
![Page 15: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/15.jpg)
UNIX directory structure
What does UNIX do to avoid loops in its directory structure?
![Page 16: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/16.jpg)
Answer
To avoid loops in directory structure, directory files cannot have more than one pathname
![Page 17: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/17.jpg)
Mach shared libraries
In the Mach virtual memory system, what type of memory object is associated with a dynamic library?
![Page 18: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/18.jpg)
Answer
Since Mach implements shared libraries through the mapped file interface, the memory object associated with a shared library is a file
![Page 19: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/19.jpg)
Mach threads
How does Mach specify that the children of a given process should be regular processes or threads?
![Page 20: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/20.jpg)
Answer
By setting the inheritance attribute of the address map entry for the data segment toCOPY before creating a regular processSHARED before creating a thread
![Page 21: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/21.jpg)
Mach VM implementation
How does Mach prevent deadlocks in its virtual memory system?
![Page 22: Solutions for the First Quiz COSC 6360 Spring 2014.](https://reader035.fdocuments.net/reader035/viewer/2022062322/5697bf731a28abf838c7eef8/html5/thumbnails/22.jpg)
Answer
To prevent deadlocks, all algorithms gain locks using the same ordering.