CS 570 Final

¡Supera tus tareas y exámenes ahora con Quizwiz!

RAID level ________ refers to disk arrays with striping at the level of blocks, but without any redundancy.

0

The page number in the 24-bit address 0x123456 with an 256-byte page size is:

0x1234 256 byte page size = 8-bit offset then the first 16 bits will be page number

A logical address of 0x514413ab on a 32-bit page-based virtual memory system with 4 KB pages has the following offset:

0x3ab 4 KB pages → 12-bit offset = bottom three nibbles

Please name two advantages to decouple a process address space from the machine's physical memory in modern operating system design.

1. allows an executable program to be loaded to different areas of a machine's memory in different runs. 2. enables program size to exceed the size constraints of the machine's physical memory.

What are the two main functions of an operating system?

1. manages computer hardware i.e allocation of resources, management of memory, etc. 2. serves as an interface between the user and hardware hiding all the ugly nitty gritty stuff from the user

Suppose that you have a 32-bit address with a two-level paging hierarchy and a 4 KB page size. The top-level index table has 1024 entries. How many entries does each partial page table have?

1024 (2^10) OFFSET 12 bits: 2nd level page table: 10 bits 1st level page table: 10 bits

With a direct mapping paging system on a 32-bit processor with 32 KB pages, what is the size of each process' page table?

128K entries Page size = 32 KB → 15-bit page offset (2^15 = 32K) If offset = 15 bits then the page # in an address is 32-15 = 17 bits 2^17 = 128K

A system uses 32-bit logical addresses, a 16K byte (2^14) page size, and 36-bit physical addresses (64 GB memory).

2^18 entries Page number = (32 - 14) = 18 bits Page table size = 2^18 page table entries The physical memory address size does not matter.

How many times does the following program print hello? #include <stdio.h> #include <unistd.h> main() { int i; for (i=0; i<3; i++) fork(); printf("hello\n"); }

2^3 = 8

Which cannot be a valid page size?

3,072 bytes A page size must be a power of two. 3,072 is not a power of two.

RAID level _____ is also known as block interleaved parity organisation and uses block level striping and keeps a parity block on a separate disk.

4

A system with 32-bit addresses, 1 GB (2^30) main memory, and a 1 megabyte (20-bit) page size will have a page table that contains:

4,096 (4K, 2^12) entries. The amount of main memory does not matter. If the page size takes 20 bits (offset) then the page number takes the first 32-20 = 12 bits 2^12 = 4096 entries

How many times does the following program print hello? #include <stdio.h> #include <unistd.h> main() { if (fork() == 0) printf("hello\n"); else if (fork() == 0) printf("hello\n"); printf("hello\n"); }

5

RAID level ____ spreads parity and data among all N+1 disks rather than storing data in N disks and parity in 1.

5

The wait system call on UNIX systems puts a process to sleep until:

A child process terminates.

What's different between the concepts: process and program?

A process is basically a program in execution.

A process control block is:

A structure that stores information about a single process.

What is a trap instruction? Explain its use in operating systems?

A trap instruction is an exception one can create to purposely cause an interrupt. Typically a trap instruction invokes the kernel space and causes the instructions in the kernel to be executed. Traps allow the execution of a program or task to be continued without loss of continuity.

Which of the following instructions should be allowed only in kernel mode?

A. disable all interrupts B. read the time of day clock C. set the time of day clock D. change the memory map

What is the difference between an absolute and relative pathname?

Absolute pathnames start with '/' and specifies a path starting from the root directory Relative pathnames specify a path starting in the current working directory

A Unix inode stores

Access permissions and file allocation information for a file, as well as some other information.

An inode based file system uses 4 Kbyte blocks and 4-byte block numbers. What is the largest file size that the file system can handle if an inode has 12 direct blocks, 1 indirect block, and 1 double indirect block?

Approximately 4 GB. Direct blocks: 12 block pointers × 4K bytes = 48 KB Indirect block: 1 × 1K block pointers × 4K bytes = 4 MB Double indirect block: 1 × 1K block pointers × 1K block pointers × 4K bytes = 4 GB Total size = 4 GB + 4 MB + 48 KB ≈ 4 GB

A USB mouse is a

Character device

The following is not a character device:

DVD A block device is one where you can address fixed-size blocks. It stores data persistently and can hold a file system. Any other device is either a network device or a character device. With these devices, the data stream is always changing and there is no concept of addressing the storage.

In contrast to segmentation, paging:

Divides memory into fixed-size chunks.

RAID level 3 supports a lower number of I/Os per second, because

Every disk has to participate in every I/O request

A context switch from one process to another can be accomplished without executing OS code in kernel mode

False

Hardware support for mutual exclusion, such as test-and-set locks has the advantage of avoiding the need for spin locks.

False

If you have execute-permission for a directory, you can delete a file in that directory

False

It is feasible to have a hard link to a file in a different file system

False

LRU always performs as well or better than FIFO.

False

Programmed I/O (PIO) uses fewer CPU resources than DMA.

False

Using mutual exclusion can ensure that a system avoids deadlock.

False

A Page Fault occurs when the desired page table entry is not found in the Translation Lookaside Buffer (TLB)

False A page fault occurs when a program attempts to access data or code that is in its address space, but is not currently located in the system RAM.

In the Dynamic Partitioning technique of memory management, the first-fit placement algorithm scans memory from the location of the last placement and chooses the first available block it finds that satisfies the request

False Scans the main memory from the beginning and first available block that is large enough

The POSIX execve system call creates a new process

False The exec() family of functions replaces the current process image with a new process image. It loads the program into the current process space and runs it from the entry point.

In a memory system employing paging, the chunks of a process (called frames) can be assigned to available chunks of memory (called pages)

False available chunks of memory -> frames chunks of a process -> pages

When the dirty bit is set in, the contents of the TLB entry do not match the contents in the page table.

False dirty bit means contents of page in memory do not match contents on disk.

Journaling is preferred for

Faster file system recovery

Briefly (2-3 sentences) state the differences between a hard link and a soft link

Hard links point to the same inode, while soft links simply list a directory entry. Hard links use reference counting. Soft links do not and may have problems withdangling references if the referenced file is moved or deleted. Soft links can span file systems, while hard links are limited to the same file system.

Page-based virtual memory is subject to

Internal fragmentation

Starvation is the case when a thread:

Is never scheduled to run.

Multiprogramming is:

Keeping several programs in memory at once and switching between them

A superblock holds

Key information about the structure of the file system.

Microsoft's FAT32 file system is an example of:

Linked allocation.

The logs in a log structured file system differ from journaling in that:

Logs are the primary storage structure of the file system.

Memory compaction is a technique to

Move a process to a different part of memory to create a larger region of contiguous memory

What is multiprogramming? Give 2 reasons for having it

Mulitprogramming refers to the rapid switching of the CPU between multiple processes in memory. It is commonly used to keep the CPU busy at all times, improving efficiency and speed. 1. It allows two or more people to use the same PC at the same time. 2. It allows a single user to use several independent processes at the same time.

To implement a user-level threads package, it helps if the operating system provides:

Non-blocking system calls.

The real address of a word in memory is translated from the following portions of a virtual address:

Page number and offset

Which state transition is not valid?

Ready → Blocked

The reason for using a multilevel page table is to:

Reduce the amount of memory used for storing page tables.

Contiguous allocation of files has some advantages and some disadvantages. Which of the following is NOT a disadvantage of contiguous allocation?

Slow seek time.

Threads within the same process do not share the same:

Stack The primary difference is that threads within the same process run in a shared memory space, while processes run in separate memory spaces.Threads are not independent of one another like processes are, and as a result threads share with other threads their code section, data section, and OS resources (like open files and signals).

A File Allocation Table:

Stores a list of blocks used by every single file in the file system.

The situation that occurs when the desired page table entry is not found in the Translation Lookaside Buffer (TLB) is called a:

TLB miss

Why is a hard link indistinguishable from the original file itself?

The "original file" is really just a hard link itself to the file's inode. If you add a new hard link, it will behave identically.

Disk controllers tend to use Direct Memory Access (DMA) over Programmed I/O (PIO) because:

The CPU does not have to copy the disk data byte by byte

What is the purpose of the cache?

The cache holds frequently requested data and instructions so that they are immediately available to the CPU. Its purpose is to reduce the average time it takes to access data from the main memory.

An advantage of a file allocation table (FAT) file structure over a simple linked file structure is

The file allocation table method allows faster seeks in files.

The page table for each process maintains:

The frame location for each page of the process

A Thread Control Block (PCB) stores:

The machine state (registers, program counter)

A process exists in the zombie (also known as defunct) state because:

The parent may need to read its exit status.

What's the biggest problem with spinlocks?

They waste CPU resources. The problem with spinlocks is if the thread yields while the lock is held, then that can cause any other thread that wants the lock to waste a lot of time spinning.

The situation where the processor spends most of its time swapping process pieces rather than executing instructions is called:

Thrashing

A memory management unit (MMU) is responsible for:

Translating a process' memory addresses to physical addresses

A thread that is blocked on a semaphore is awakened when another thread:

Tries to increment the semaphore.

An advantage of implementing threads in user space is that they don't incur the overhead of having the OS schedule their execution.

True

If the hard link is removed, and if the file's (inode's) hard link count goes to 0, the file is also removed

True

The OS can run multiple processes whose total allocated address space exceeds the amount of physical memory available in the system.

True

The modify (M) bit is a control bit in a page table entry that indicates whether the contents of the corresponding page have been altered since the page was last loaded into memory.

True

The problem of internal fragmentation can be lessened in a system employing a fixed-partition memory management scheme by using unequal size partitions.

True

The value of a semaphore can never be negative.

True

Switching among threads in the same process is more efficient than switching among processes

True Process switching is a type of context switching where we switch one process with another process. It involves switching of all the process resources with those needed by a new process. This means switching the memory address space. This includes memory addresses, page tables, and kernel resources, caches in the processor.

A race condition is

When the outcome of processes is dependent on the exact order of execution among them.

Which memory allocation strategy picks the largest hole?

Worst fit

In UNIX, the return value for the fork system call is _____ for the child process and _____ for the parent process.

Zero, A nonzero integer

Base and limit addressing is most useful in:

a segmentation system.

The memory map of a multithreaded process looks similar to that of a singlethreaded process except that the multithreaded one has:

a stack for each thread

A better way of contiguous allocation to extend the file size is :

adding an extent (another chunk of contiguous space)

If a process does not call exec after forking,

all the threads should be duplicated

The NFS servers :

are stateless

A process is moved to wait queue when I/O request is made with

blocking I/O

Mutual exclusion can be provided by the

both mutex locks and binary semaphores

A process can be

both single threaded and multithreaded

If the kernel is single threaded, then any user level thread performing a blocking system call will:

cause the entire process to block even if the other threads are available to run

The VFS (virtual file system) activates file system specific operations to handle local requests according to their

file system types

A Translation Lookaside Buffer (TLB) caches:

frequently accessed page table entries.

What physical address, if any, would each of the following virtual addresses correspond to? (If there would be a page fault, just indicate that one would take place. Do not try to handle it.) a) 1052 b) 2221

given page size = 1024 bytes offset = log2(1024) = log2(2^10) = 10 bits 1052 in binary = 10000011100 1052 = 1024 + 28, so the page number is 1 and the offset is 28. The page table shows that page 1 is not currently resident, so there would be a page fault. 2221 in binary = 10 00101 01101 2221 = 2 * 1024 + 173 , so the page number is 2 and the offset is 173. The page table shows that page 2 is resident in frame 7, so the physical address would be 7 * 1024 + 173 = 7341.

A binary semaphore puts a thread to sleep:

if it tries to decrement the semaphore's value below 0. The two operations on a semaphore are down(s) and up(s). Down(s) decrements the semaphore s but does not allow its value to go <0. If it will, then the value stays at 0 but the process blocks until another process does an up(s).

The following page table has the same number of entries as there are page frames:

inverted page table

What is the difference between kernel and user mode?

kernel-mode has heightened privileges and is allowed to access the system's memory and hardware, whereas user-mode is not. However, user-mode is more commonly used due to how risky it is to constantly run programs in kernel-mode.

Which one is not the major methods of allocating disk space mentioned in the textbook?

listed

What is the command to create a soft link "slink" to the file "/u/maclean/junk.txt"

ln -s /u/maclean/junk.txt slink

The master boot record (MBR)

loads a boot loader from a boot partition.

When hardware is accessed by reading and writing to the specific memory locations, then it is called

memory-mapped I/O

If a process is executing in its critical section, then no other processes can be executing in their critical section. This condition is called

mutual exclusion

A thread shares its resources(like data section, code section, open files, signals) with :

other threads that belong to the same process

If a thread invokes the exec system call,

the program specified in the parameter to exec will replace the entire process

A parent process calling _____ system call will be suspended until children processes terminate.

wait


Conjuntos de estudio relacionados

A&P I Chapter 13 ( Brain and Cranial nerves)

View Set

Operation Management Lecture 1: Operations Management

View Set

Jane Eyre Old Testament Bible Verses

View Set

English 3 Fall - The Iroquois Creation Myth: "The World on Turtle's Back"

View Set