Top Banner
Solutions for the First Quiz COSC 6360 Spring 2014
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Solutions for the First Quiz COSC 6360 Spring 2014.

Solutions for the First Quiz

COSC 6360

Spring 2014

Page 2: Solutions for the First Quiz COSC 6360 Spring 2014.

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.

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.

special files

Actually represent hardware devices.

Page 5: Solutions for the First Quiz COSC 6360 Spring 2014.

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.

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.

superblocks

Describe the contents of a given file system.

Page 8: Solutions for the First Quiz COSC 6360 Spring 2014.

synchronous updates

Used to guarantee the correct serial execution of metadata updates.

Page 9: Solutions for the First Quiz COSC 6360 Spring 2014.

cylinder groups

Contain both data blocks and i-node blocks.

Page 10: Solutions for the First Quiz COSC 6360 Spring 2014.

bit maps

Keep track of free blocks on disk.

Page 11: Solutions for the First Quiz COSC 6360 Spring 2014.

fork()

Creates a new process.

Page 12: Solutions for the First Quiz COSC 6360 Spring 2014.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Mach VM implementation

How does Mach prevent deadlocks in its virtual memory system?

Page 22: Solutions for the First Quiz COSC 6360 Spring 2014.

Answer

To prevent deadlocks, all algorithms gain locks using the same ordering.