Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 In what way is an operating system like a government?

Similar presentations


Presentation on theme: "Chapter 1 In what way is an operating system like a government?"— Presentation transcript:

1 Chapter 1 In what way is an operating system like a government?
It seldom functions correctly. It creates an environment within which other programs can do useful work. It performs most useful functions by itself. It is always concerned primarily with the individual's needs.    ____ operating systems are designed primarily to maximize resource utilization. PC Handheld computer Mainframe Network The most common secondary storage device is ____. random access memory solid state disks tape drives magnetic disk

2 Chapter 1 Which of the following would lead you to believe that a given system is an SMP-type system? Each processor is assigned a specific task. There is a boss–worker relationship between the processors. Each processor performs all tasks within the operating system. None of the above A ____ can be used to prevent a user program from never returning control to the operating system. portal program counter firewall timer

3 Chapter 2 A _____ is an example of a systems program.
command interpreter Web browser text formatter database system If a program terminates abnormally, a dump of memory may be examined by a ____ to determine the cause of the problem. module debugger shell control card A message-passing model is ____. easier to implement than a shared memory model for intercomputer communication faster than the shared memory model a network protocol, and does not apply to operating systems only useful for small simple operating systems

4 Chapter 2 Policy ____ determines how to do something
determines what will be done is not likely to change across places is not likely to change over time The major difficulty in designing a layered operating system approach is ____. appropriately defining the various layers making sure that each layer hides certain data structures, hardware, and operations from higher-level layers debugging a particular layer making sure each layer is easily converted to modules

5 Chapter 3 The ____ of a process contains temporary data such as function parameters, return addresses, and local variables. text section data section program counter stack    A process control block ____. includes information on the process's state stores the address of the next instruction to be processed by a different process determines which process is to be executed next is an example of a process queue The list of processes waiting for a particular I/O device is called a(n) ____. standby queue device queue ready queue interrupt queue Job = process

6 Chapter 3 The _____________ refers to the number of processes in memory. process count long-term scheduler degree of multiprogramming CPU scheduler    When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process? The child process runs concurrently with the parent. The child process has a new program loaded into it. The child is a duplicate of the parent. All of the above Job = process

7 Chapter 4 Green threads a specification for thread behavior.
 ____ is a thread library for Solaris that maps many user-level threads to one kernel thread. Pthreads Green threads Sthreads Java threads Pthreads refers to ____. the POSIX standard. an implementation for thread behavior. a specification for thread behavior. an API for process creation and synchronization. The ____ multithreading model multiplexes many user-level threads to a smaller or equal number of kernel threads. many-to-one model one-to-one model many-to-many model many-to-some model Job = process

8 Chapter 4 Cancellation points are associated with ____ cancellation.
asynchronous deferred synchronous non-deferred    Which of the following would be an acceptable signal handling scheme for a multithreaded program? Deliver the signal to the thread to which the signal applies. Deliver the signal to every thread in the process. Deliver the signal to only certain threads in the process. All of the above Job = process

9 Chapter 5 Which of the following is true of cooperative scheduling?
It requires a timer. A process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state. It incurs a cost associated with access to shared data. A process switches from the running state to the ready state when an interrupt occurs. ____ is the number of processes that are completed per time unit. CPU utilization Response time Turnaround time Throughput ____ scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts. Multilevel queue RR FCFS SJF Job = process

10 Chapter 5 The ____ scheduling algorithm is designed especially for time-sharing systems. SJF FCFS RR Multilevel queue    Which of the following scheduling algorithms must be nonpreemptive? priority algorithms Job = process

11 Chapter 6 A race condition ____.
results when several threads try to access the same data concurrently results when several threads try to access and modify the same data concurrently will result only if the outcome of execution does not depend on the order in which instructions are executed None of the above An instruction that executes atomically ____. must consist of only one machine instruction executes as a single, uninterruptible unit cannot be used to solve the critical section problem All of the above A counting semaphore ____. is essentially an integer variable is accessed through only one standard operation can be modified simultaneously by multiple threads cannot be used to control access to a thread's critical sections Job = process

12 Chapter 6 A mutex lock ____. is exactly like a counting semaphore
is essentially a boolean variable is not guaranteed to be atomic can be used to eliminate busy waiting In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical section. turn lockflag[i] turn[i] Job = process

13 Chapter 7 A deadlocked state occurs whenever ____.
a process is waiting for I/O to a device that does not exist the system has no available free resources every process in a set is waiting for an event that can only be caused by another process in the set a process is unable to release its request for a resource after use One necessary condition for deadlock is ____, which states that at least one resource must be held in a nonsharable mode. hold and wait mutual exclusion circular wait no preemption One necessary condition for deadlock is ______, which states that a process must be holding one resource and waiting to acquire additional resources. Job = process

14 Chapter 7 One necessary condition for deadlock is ______, which states that a resource can be released only voluntarily by the process holding the resource. hold and wait mutual exclusion circular wait no preemption One necessary condition for deadlock is ______, which states that there is a chain of waiting processes whereby P0 is waiting for a resource held by P1, P1 is waiting for a resource held by P2, and Pn is waiting for a resource held by P0. Job = process

15 Chapter 8 Absolute code can be generated for ____.
compile-time binding load-time binding execution-time binding interrupt binding  _____ is the method of binding instructions and data to memory performed by most general-purpose operating systems. Interrupt binding Compile time binding Execution time binding Load-time binding  An address generated by a CPU is referred to as a ____. physical address logical address post relocation register address Memory-Management Unit (MMU) generated address Job = process

16 Chapter 8 Suppose a program is operating with execution-time binding and the physical address generated is 300. The relocation register is set to 100. What is the corresponding logical address? 199 201 200 300 The mapping of a logical address to a physical address is done in hardware by the ________. memory-management-unit (MMU) memory address register relocation register dynamic loading register Job = process

17 Chapter 9 Which of the following is a benefit of allowing a program that is only partially in memory to execute? Programs can be written to use more memory than is available in physical memory. CPU utilization and throughput is increased. Less I/O is needed to load or swap each user program into memory. All of the above In systems that support virtual memory, ____. virtual memory is separated from logical memory. virtual memory is separated from physical memory. physical memory is separated from secondary storage. physical memory is separated from logical memory. The vfork() system call in UNIX ____. allows the child process to use the address space of the parent uses copy-on-write with the fork() call is not intended to be used when the child process calls exec() immediately after creation duplicates all pages that are modified by the child process Job = process

18 Chapter 9 Belady's anomaly states that ____.
giving more memory to a process will improve its performance as the number of allocated frames increases, the page-fault rate may decrease for all page replacement algorithms for some page replacement algorithms, the page-fault rate may decrease as the number of allocated frames increase for some page replacement algorithms, the page-fault rate may increase as the number of allocated frames increases Optimal page replacement ____. is the page-replacement algorithm most often implemented is used mostly for comparison with other page-replacement schemes can suffer from Belady's anomaly requires that the system keep track of previously used pages Job = process

19 Chapter 10 A(n) ____ file is a sequence of functions. text source
object executable A(n) ____ file is a sequence of bytes organized into blocks understandable by the system's linker. A(n) ____ file is a series of code sections that the loader can bring into memory and execute. Job = process

20 Chapter 10 In an environment where several processes may open the same file at the same time, ____. the operating system typically uses only one internal table to keep track of open files the operating system typically uses two internal tables called the system-wide and per-disk tables to keep track of open files the operating system typically uses three internal tables called the system-wide, per-disk, and per-partition tables to keep track of open files the operating system typically uses two internal tables called the system-wide and per-process tables to keep track of open files Suppose that the operating system uses two internal tables to keep track of open files. Process A has two files open and process B has three files open. Two files are shared between the two processes. How many entries are in the per-process table of process A, the per-process table of process B, and the system-wide tables, respectively? 5, 5, 5 2, 3, 3 2, 3, 5 2, 3, 1  Job = process

21 Chapter 11 Transfers between memory and disk are performed a ____.
byte at a time file at a time block at a time sector at a time    Order the following file system layers in order of lowest level to highest level.  [1] I/O control [2] logical file system [3] basic file system [4] file-organization module [5] devices 1, 3, 5, 4, 2 5, 1, 3, 2, 4 1, 5, 3, 4, 2 5, 1, 3, 4, 2 Job = process

22 Chapter 11 A volume control block ____.
can contain information needed by the system to boot an operating system from that partition is a directory structure used to organize the files contains many of the file's details, including file permissions, ownership, size, and location of the data blocks contains information such as the number of blocks in a partition, size of the blocks, and free-block and FCB count and pointers Which of the following is the simplest method for implementing a directory? tree data structure linear list hash table nonlinear list    In the Linux VFS architecture, a(n) ____ object represents an individual file. inode file superblock dentry Job = process

23 Chapter 12 The surface of a magnetic disk platter is divided into ____. sectors arms tracks cylinders On media that uses constant linear velocity, the ____. disk's rotation speed increases as the head moves towards the middle of the disk from either side disk's rotation speed remains constant density of bits decreases from the inner tracks to the outer tracks density of bits per track is uniform Job = process

24 Chapter 12 The SSTF scheduling algorithm ____.
services the request with the maximum seek time services the request with the minimum seek time chooses to service the request furthest from the current head position None of the above Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11, 75, 185, 100, 87. Using the SCAN scheduling algorithm, what is the order that the requests are serviced, assuming the disk head is at cylinder 88 and moving upward through the cylinders? – 87 – 3 – 3 Job = process

25 Chapter 12 Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11, 75, 185, 100, 87. Using the FCFS scheduling algorithm, what is the order that the requests are serviced, assuming the disk head is at cylinder 88 and moving upward through the cylinders? – 87 – 3 – 3 – 87  Job = process

26 Chapter 13 The ____ register of an I/O port can be written by the host to start a command or to change the mode of a device. status control data-in transfer An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-priority interrupts to preempt the execution of a low priority interrupt defer the handling of low-priority interrupt without masking off all interrupts All of the above Job = process

27 Chapter 13 DMA controllers ___
do not utilize an additional, special purpose, processor are a nonstandard component in PCs of today can steal memory access cycles from the main CPU can access main memory at the same time as the main CPU A character-stream device ____. transfers data in blocks of bytes transfers data a byte at a time is a device such as a disk drive is similar to a random access device Job = process

28 Chapter 13 ____ I/O accesses a block device as a simple array of blocks. Raw Stream Indirect Cooked Job = process

29 Chapter 14 In the UNIX operating system, a domain is associated with the ____. user process procedure task In MULTICS, the protection domains are organized in a _____. star structure linear structure ring structure directory structure Job = process

30 Chapter 14 In an access matrix, the ____ right allows a process to change the entries in a row. owner copy control switch The ____ implementation of an access table consists of sets of ordered triples. global table access list for objects lock-key mechanism capability list Job = process

31 Chapter 14 In capability lists, each object has a ____ to denote its type. gate tag key lock Job = process

32 Chapter 15 The most common method used by attackers to breach security is ____. masquerading message modification session hijacking phishing    A code segment that misuses its environment is called ____. a backdoor a trap door a worm a Trojan horse Job = process

33 Chapter 15 Worms ____. use the spawn mechanism to ravage system performance can shut down an entire network continue to grow as the Internet expands All of the above A denial of service attack is ____. aimed at gaining information aimed at stealing resources aimed at disrupting legitimate use of a system generally not network based Job = process

34 Chapter 15 In a paired-password system, ____.
the user specifies two passwords the computer supplies one part of a password and the user enters the other part passwords must contain equal amounts of numbers and digits paired together two users must enter their own separate password to gain access to the system  Job = process


Download ppt "Chapter 1 In what way is an operating system like a government?"

Similar presentations


Ads by Google