Operating Systems for Programmers - C191 Study Set
As an example, consider the bitmap shown below:
001011101 Resources 2, 4, 5, 6, and 8 are unavailable resources 0, 1, 3, and 7 are available
Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page offset? Select one: a. 0xAE b. 0xF9 c. 0xA d. 0xF900
0xF9
Protection of memory space is accomplished by having the CPU hardware compare every address generated in user mode with the registers.
Any attempt by a program executing in user mode to access operating-system memory or other users' memory results in a trap to the operating system, which treats the attempt as a fatal error
Two operating systems currently dominate mobile computing:
Apple iOS and Google Android
Scheduler activations
Both M:M and Two-level models require communication to maintain and appropriate number of kernel threads allocated to the application Scheduler activations provide upcalls -- a communication mechanism from the kernel to the thread library This communication allows an application to maintain the correct number of kernel threads
The following list includes several forms of accidental and malicious security violations:
Breach of confidentiality -- This type of violation involves unauthorized reading of data (or theft of information). Typically, a breach of confidentiality is the goal of an intruder. Breach of integrity -- This violation involves unauthorized modification of data. Such attacks can, for example, result in passing of liability to an innocent party or modification of the source code of an important commercial application Breach of availability -- This violation involves unauthorized destruction of data. Some crackers would rather wreak havoc and gain status or bragging rights than gain financially. Website defacement is a common example of this type of security breach Theft of service - this violation involves unauthorized use of resources. For example, an intruder (or intrusion program) may install a daemon on a system that acts as a file server Denial of service (DOS) -- are sometimes accidental. The original internet worm turned into a DOS attach when a bug failed to delay its rapid spread
Early operating systems were written in assembly language. Now, although some operating systems are still written in assembly language, most are written in a higher-level language such as ______ or an even higher-level language such as _________.
C C++ An operating system can also be written in multiple languages...with some parts being written in assembly and others in C++, C, PERL, Python, or shell scripts
logical to physical address translation in IA-32
CPU -(logical address)-> segmentation unit --(linear address)--> paging unit --(physical address) -> physical memory
Maximum CPU utilization is obtained with multiprogramming
CPU-I/O Burst Cycle -- Process execution consists of a cycle of CPU execution and I/O wait CPU burst followed by I/O burst CPU burst distribution is of main concern
The close() system call in UNIX is used to close a file. What is the equivalent system call in Windows? Select one: a. CloseHandle() b. close() c. CloseFile() d. Exit()
CloseHandle()
deterministic evaluation
Consider 5 processes arriving at 0: (Process) P1, (Burst Time) 10 (Process) P2, (Burst Time) 29 (Process) P3, (Burst Time) 3 (Process) P4, (Burst Time) 7 (Process) P5, (Burst Time) 12 * For each algorithm, calculate minimum average waiting time * Simple and fast, but requires exact numbers for input, applies only to those inputs - FCS is 28ms: P1 (0 to 10) P2 (10 to 39) P3 (39 to 42) P4 (42 to 49) P5 (49 to 61) - Non-preemptive SFJ is 13ms: P3 (0 to 3) P4 (3 to 10) P1 (10 to 20) P5 (20 to 32) P2 (32 to 61) - RR is 23ms: P1 (0 to 10) P2 (10 to 20) P3 (20 to 23) P4 (23 to 30) P5 (30 to 40) P2 (40 to 50) P5 (50 to 52) P2 (52 to 61)
___________________ process can affect or be affected by the execution of another process
Cooperating
With indirect communication, messages are directed and received from mailboxes (also referred to as ports)
Each mailbox has a unique id Processes can communicate only if they share a mailbox
One-to-One multithreading model
Each user-level thread maps to kernel thread Examples: Windows NT/XP/2000 Linux Solaris 9 and later
With virtualization, for example, Windows can be the host operating system, and the VMware application is the VMM.
The VMM runs the guest operating systems, manages their resource use, and protects each guest from the others
programmable interval timer
The hardware to measure elapsed time and to trigger operations It can be set to wait a certain amount of time and then generate an interrupt, and it can be set to do this once or to repeat the process to generate periodic interrupts. The scheduler uses this mechanism to generate an interrupt that will preempt a process at the end of its time slice.
writing a file
To write a file, we make a system call specifying both the name of the file and the information to be written to the file. Given the name of the file, the system searches the directory to find the file's location. The system must keep a write pointer to the location in the file where the next write is to take place. The write pointer must be updated whenever a write occurs.
A code segment that misuses its environment is called a _______________________. Long search paths, such as are common on UNIX systems, exacerbate the Trojan-horse problem. The search path lists the set of directories to search when an ambiguous program name is given. The path is searched for a file of that name, and the file is executed. All the directories in such a search path must be secure, or a Trojan horse could be slipped into the user's path and executed accidentally.
Trojan horse
We should note that ___________________ supports similarly efficient snapshots, clones, and replication
ZFS file system
Frequently, the free-space list is implemented as a ______________ or ______________. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0.
bit map bit vector
Transfers between memory and disk are performed a ____. Select one: a. byte at a time b. file at a time c. block at a time d. sector at a time
block at a time
A __________________ is an example of a systems program. a. command interpreter b. web browser c. text formatter d. database system
command interpreter
Group functionality can be implemented as a sytem-wide list of group names and ________________________.
group identifiers
base register
holds the smallest legal physical memory address
disk controller
is built into each disk drive.
Embedded computers typically run on a ____ operating system. Select one: a. real-time b. Windows XP c. network d. clustered
real-time
An example of a __________________________ is the typical application program that a user executes after she logs on.
simple subject
Software may trigger an interrupt by executing a special operation called a _____________
system call (also called a monitor call)
If old pointers and blocks are kept, a snapshot is created;
the snapshot is a view of the file system before the last update took place. This solution should require no consistency checking if the pointer update is done atomically
cascading termination
when all children are terminated
_________ involves distributing tasks across multiple computing cores. Select one: a. Concurrency b. Task parallelism c. Data parallelism d. Parallelism
Task parallelism
What is the issue with thread cancellation?
Terminating a thread before it is finished Two general approaches: Asynchronous cancellation terminates the target thread immediately Deferred cancellation allows the target thread to periodically check if it should be cancelled
Process
a program in execution; process execution must process in sequential fashion
metropolitan area network (MAN)
could link buildings within a city
Types of system calls made with file management
create file, delete file open, close read, write, reposition get file attributes, set file attributes
types of system calls used within communications
create, delete communication connection send, receive messages transfer status information attach or detach remote devices
batch interface
commands and directives to control those commands are entered into files, and those files are executed (this is like what Joey made when you were working with him at the Libraries)
In the case of Microsoft's _________________________, network information is used in conjunction with user authentication (user name and password) to create a network login that the server uses to decide whether to allow or deny access to a requested file system.
common Internet file system (CIFS)
________________________________ scheduling is a variant of SCAN designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other, servicing requests along the way. When the head reaches the other end, however, it immediately returns to the beginning of the disk without servicing any requests on the return trip
Circular SCAN (C-SCAN)
Another vulnerability of firewalls is ___________________, in which an unauthorized host pretends to be an authorized host by meeting some authorization criterion
spoofing
Kernighan's Law
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"
On UNIX, the first system process is ____________, and it starts many other daemons
"init" Once this phase is complete, the system is fully booted, and the system waits for some event to occur
Each element in a hashed page table consists of three fields:
(1) the virtual page number (2) the value of the mapped page frame (3) a pointer to the next element in the linked list
Most computers have hardware clocks and timers that provide three basic functions:
- Give the current time - Give the elapsed time - Set a timer to trigger operation X at time t
The NFS protocol provides a set of RPCs for remote file operations. The procedures support the following operations:
- Searching for a file within a directory - Reading a set of directory entries - Manipulating links and directories - Accessing file attributes - Reading and writing files
intel pentium processor event-vector table (vector number/description)
0 divide error 1 debug exception 2 null interrupt 3 breakpoint 4 INTO-detected overflow 5 bound range exception 6 invalid optcode 7 device not available 8 double fault 9 coprocessor segment overrun (reserved) 10 invalid task state segment 11 segment not present 12 stack fault 13 general protection 14 page fault 15 (Intel reserved, do not use) 16 floating-point error 17 alignment check 18 machine check 19-31 (Intel reserved, do not use) 32-255 maskable interrupts
if we have a reference to a page p, then any references to page p that immediately follow will never cause a page fault. Page p will be in memory after the first reference, so the immediately following references will not fault For example, if we trace a particular process, we might record the following address sequence: 0100 , 0432 , 0101 , 0612 , 0102 , 0103 , 0104 , 0101 , 0611 , 0102 , 0103 , 0104 , 0101 , 0610 , 0102 , 0103 , 0104 , 0101 , 0609 , 0102 , 0105 At 100 bytes per page, this sequence is reduced to the following reference string:
1, 4, 1, 6, 1, 6, 1, 6, 1, 6, 1
In Linux, a slab may be in one of three possible states:
1.) Full (all objects in the slab are marked as used) 2.) Empty (all objects in the slab are marked as free) 3.) Partial (The slab consists of both used and free objects)
Multiprocessor systems have three main advantages:
1.) Increased throughput 2.) Economy of scale 3.) Increased reliability
The procedure for handling this page fault is straightforward
1.) We check an internal table (usually kept with the process control block) for this process to determine whether the reference was a valid or invalid memory access 2.) If the reference was invalid, we terminate the process. If it was valid but we have not yet brought in that page, we now page it in. 3.) We find a free frame (by taking one from the free-frame list, for example) 4.) We schedule a disk operation to read the desired page into the newly allocated frame. 5. When the disk read is complete, we modify the internal table kept with the process and the page table to indicate that the page is now in memory. 6. We restart the instruction that was interrupted by the trap. The process can now access the page as though it had always been in memory.
Common port numbers
20 File Transfer Protocol (FTP) Data Transfer 21 File Transfer Protocol (FTP) Command Control 22 Secure Shell (SSH) Secure Login 23 Telnet remote login service, unencrypted text messages 25 Simple Mail Transfer Protocol (SMTP) E-mail routing 53 Domain Name System (DNS) service 67, 68 Dynamic Host Configuration Protocol (DHCP) 80 Hypertext Transfer Protocol (HTTP) used in the World Wide Web 110 Post Office Protocol (POP3) 119 Network News Transfer Protocol (NNTP) 123 Network Time Protocol (NTP) 143 Internet Message Access Protocol (IMAP) Management of digital mail 161 Simple Network Management Protocol (SNMP) 194 Internet Relay Chat (IRC) 443 HTTP Secure (HTTPS) HTTP over TLS/SSL
Suppose we have the following page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and that there are three frames within our system. Using the FIFO replacement algorithm, what will be the final configuration of the three frames following the execution of the given reference string? Select one: a. 4, 1, 3 b. 3, 1, 4 c. 4, 2, 3 d. 3, 4, 2
3, 4, 2
What size segment will be allocated for a 39 KB request on a system using the buddy system for kernel memory allocation? Select one: a. 39 KB b. 42 KB c. 64 KB d. none of the above
64 KB
Suppose we have the following page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and that there are three frames within our system. Using the LRU replacement algorithm, what is the number of page faults for the given reference string? Select one: a. 14 b. 13 c. 8 d. 10
8
Consider a 32-bit address for a two-level paging system with an 8 KB page size. The outer page table has 1024 entries. How many bits are used to represent the second-level page table? Select one: a. 10 b. 8 c. 12 d. 9
9
rate monotonic scheduling
A priority is assigned based on the inverse of its period Shorter periods = higher priority; Longer periods = lower priority P1 is assigned a higher priority than P2 (in this model demonstrated within figure 6.41) missed deadlines can occur with rate monotonic scheduling
To allow controlled domain switching, we modify the ring field of the segment descriptor to include the following:
Access bracket -- a pair of integers, b1 and b2, such that b1 <= b2 Limit -- an integer b3 such that b3 > b2 List of gates -- identifies the entry points (or gates) at which the segments may be called
A system consists of a collection of processes, some of which are operating system processes (those that execute system code) and the rest which are user processes (those that execute user code)
All these processes can potentially execute concurrently—by multiplexing on a single CPU, for example.
Which of the following would be an acceptable signal handling scheme for a multithreaded program? Select one: a. Deliver the signal to the thread to which the signal applies. b. Deliver the signal to every thread in the process. c. Deliver the signal to only certain threads in the process. d. All of the above
All of the above
A typical instruction-execution cycle, for example, first fetches an instruction from memory. The instruction is then decoded and may cause operands to be fetched from memory. After the instruction has been executed on the operands, results may be stored back in memory. The memory unit sees only a stream of memory addresses; it does not know how they are generated (by the instruction counter, indexing, indirection, literal addresses, and so on) or what they are for (instructions or data).
Accordingly, we can ignore how a program generates a memory address. We are interested only in the sequence of memory addresses generated by the running program.
Pthread scheduling
API allows specifying either process-contention scope (PCS) or system-contention scope (SCS) during thread creation - PTHREAD_SCOPE_PROCESS schedules threads using PCS scheduling - PTHREAD_SCOPE_SYSTEM schedules threads using SCS scheduling Can be limited by OS -- Linux and Mac OS X only allow PTHREAD_SCOPE_SYSTEM
What are some other terms for kernel mode? Select one: a. supervisor mode b. system mode c. privileged mode d. All of the above
All of the above
first fit
Allocate the first hole that is big enough. Searching can start either at the beginning of the set of holes or at the location where the previous first-fit search ended. We can stop searching as soon as we find a free hole that is large enough.
worst fit
Allocate the largest hole. Again, we must search the entire list, unless it is sorted by size. This strategy produces the largest leftover hole, which may be more useful than the smaller leftover hole from a best-fit approach.
best fit
Allocate the smallest hole that is big enough. We must search the entire list, unless the list is ordered by size. This strategy produces the smallest leftover hole.
The in-memory information is used for both file-system management and performance improvement via caching. The data are loaded at mount time, updated during file-system operations, and discarded at dismount. Several types of structures may be included.
An in-memory mount table contains information about each mounted volume. An in-memory directory-structure cache holds the directory information of recently accessed directories. (For directories at which volumes are mounted, it can contain a pointer to the volume table.) The system-wide open-file table contains a copy of the FCB of each open file, as well as other information. The per-process open-file table contains a pointer to the appropriate entry in the system-wide open-file table, as well as other information Buffers hold file-system blocks when they are being read from disk or written to a disk
We can also view a computer system as consisting of hardware, software, and data. The operating system provides the means for proper use of these resources in the operation of the computer system.
An operating system is similar to a government. Like a government, it performs no useful function by itself. It simply provides and environment within which other programs can do useful work.
volume
Any entity containing a file system. The volume may be a subset of a device, a whole device, or multiple devices linked together into a RAID set. Each volume can be thought of as a virtual disk. Volumes can also store multiple operating systems, allowing a system to boot and run more than one operating system
Shortest-Job-First (SJF) Scheduling
Associate with each process the length of its next CPU burst - use these lengths to schedule the process with the shortest time SJF is optimal -- gives minimum average waiting time for a given set of processes - the difficulty is knowing the length of the next CPU request - could ask the user
_____________________ removes a page from the buffer as soon as the next page is requested. The previous pages are not likely to be used again and waste buffer space.
Free-behind
The operating system is responsible for the following activities in connection with disk management:
Free-space management Storage allocation Disk scheduling
multiple-processor scheduling
CPU scheduling is more complex when multiple CPUs are available * Homogeneous processors within a multiprocessor * Asymmetric multiprocessing -- only one processor accesses the system data structures, alleviating the need for data sharing * Symmetric multiprocessing (SMP) -- each processor is self-scheduling, all processes in common ready queue, or each has its own private queue of ready processes (this is currently the most common) * Processor affinity -- process has affinity for processor on which it is currently running - soft affinity - hard affinity - variations including processor sets
Which of the following is a property of peer-to-peer systems? Select one: a. Clients and servers are not distinguished from one another. b. Separate machines act as either the client or the server but not both. c. They do not offer any advantages over traditional client-server systems. d. They suffer from the server acting as the bottleneck in performance.
Clients and servers are not distinguished from one another
Classically, the binding of instructions and data to memory addresses can be done at any step along the way:
Compile time Load time Execution time
Assume an adaptive mutex is used for accessing shared data on a Solaris system with multiprocessing capabilities. Which of the following statements is not true? Select one: a. A waiting thread may spin while waiting for the lock to become available. b. A waiting thread may sleep while waiting for the lock to become available. c. The adaptive mutex is only used to protect short segments of code. d. Condition variables and semaphores are never used in place of an adaptive mutex.
Condition variables and semaphores are never used in place of an adaptive mutex
The operating system is responsible for the following activities in connection with file management
Creating and deleting files Creating and deleting directories to organize files Supporting primitives for manipulating files and directories Mapping files onto secondary storage Backing up files on stable (nonvolatile) storage media
Handshaking between the DMA controller and the device controller is performed via a pair of wires called ______________ and __________________. The device controller places a signal on the DMA-request wire when a word of data is available for transfer. This signal causes the DMA controller to seize the memory bus, place the desired address on the memory-address wires, and place a signal on the DMA-acknowledge wire. When the device controller receives the DMA-acknowledge signal, it transfers the word of data to memory and removes the DMA-request signal.
DMA-request DMA-acknowledge
The power of bitmaps becomes apparent when we consider their space efficiency. If we were to use an eight-bit Boolean value instead of a single bit, the resulting data structure would be eight times larger. Thus, bitmaps are commonly used when there is a need to represent the availability of a large number of resources.
Disk drives provide a nice illustration. A medium-sized disk drive might be divided into several thousand individual units, called disk blocks. A bitmap can be used to indicate the availability of each disk block.
A modern general-purpose computer system consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory
Each device controller is in charge of a specific type of device (audio devices, video displays, etc.) The CPU an the device controllers can execute in parallel, competing for memory cycles. To ensure orderly access to the shared memory, a memory controller synchronizes access to the memory
Which of the following would lead you to believe that a given system is an SMP-type system? Select one: a. Each processor is assigned a specific task. b. There is a boss-worker relationship between the processors. c. Each processor performs all tasks within the operating system. d. None of the above
Each processor performs all tasks within the operating system
There are literally thousands of viruses, but they fall into several main categories. Note that many viruses belong in more than one category
File Boot Macro Source code Polymorphic Encrypted Stealth Tunneling Multipartite Armored
System programs can be divided into these categories:
File management Status information File modification Programming-language support Program loading and execution Communications Background services
As an example of an open-source operating system, consider _______________________.
GNU/Linux
The program stored in the boot block may be sophisticated enough to load the entire operating system into memory and begin its execution. More typically, it is simple code (as it fits in a single disk block) and knows only the address on disk and length of the bootstrap program. ______________ is an example of an open-source bootstrap program for Linux systems.
GRUB
____ is a thread library for Solaris that maps many user-level threads to one kernel thread. Select one: a. Pthreads b. Green threads c. Sthreads d. Java threads
Green threads
File management is one of the most visible components of an operating system. Computers can store information on several different types of physical media.
Hard disk, optical disk, and magnetic tape are the most common. Each of these media has its own characteristics and physical organization. Each medium is controlled by a device, such as a disk drive or tape drive, that also has its own unique characteristics. These properties include access speed, capacity, data-transfer rate, and access method (sequential or random).
_______________________ provide the bulk of secondary storage for modern computer systems. Conceptually, disks are relatively simple. Each disk platter has a flat circular shape, like a CD. Common platter diameters range from 1.8 to 3.5 inches. The two surfaces of a platter are covered with a magnetic material. We store information by recording it magnetically on the platters
Hard disks
direct access (or relative access)
Here, a file is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order. The direct-access method is based on a disk model of a file, since disks allow random access to any file block. For direct access, the file is viewed as a numbered sequence of blocks or records. Thus, we may read block 14, then read block 53, and then write block 7. There are no restrictions on the order of reading or writing for a direct-access file. Direct-access files are of great use for immediate access to large amounts of information. Databases are often of this type. When a query concerning a particular subject arrives, we compute which block contains the answer and then read that block directly to provide the desired information.
graphical user interface (GUI)
Here, the interface is a window system with a pointing device to direct I/O, choose from menus, and make selections and a keyboard to enter text. Some systems provide two or three of these variations
A disk drive is attached to a computer by a set of wires called an ________________.
I/O bus
multiple-processor scheduling -- load balancing
If SMP, need to keep up all CPUs loaded for efficiency Load balancing attempts to keep workload evenly distributed Push migration -- periodic task checks load on each processor, and if found, pushes task from overloaded CPU to other CPUs Pull migration -- idle processors pulls waiting task from busy processor
Otherwise, a trap to the operating system occurs, and the situation is handled as follows:
If i < b1, then the call is allowed to occur, because we have a transfer to a ring (or domain) with fewer privileges. However, if parameters are passed that refer to segments in a lower ring (that is, segments not accessible to the called procedure), then these segments must be copied into an area that can be accessed by the called procedure. If i > b2, then the call is allowed to occur only if b3 is greater than or equal to i and the call has been directed to one of the designated entry points in the list of gates. This scheme allows processes with limited access rights to call procedures in lower rings that have more access rights, but only in a carefully controlled manner.
During recovery from a failure, each pair of physical blocks is examined. If both are the same and no detectable error exists, then no further action is necessary.
If one block contains a detectable error then we replace its contents with the value of the other block
Many different memory-management schemes are used. These schemes reflect various approaches, and the effectiveness of any given algorithm depends on the situation.
In selecting a memory-management scheme for a specific system, we must take into account many factors—especially the hardware design of the system. Each algorithm requires its own hardware support.
two-level directory structure
In the two-level directory structure, each user has his own user file directory (UFD). The UFDs have similar structures, but each lists only the files of a single user. When a user job starts or a user logs in, the system's master file directory (MFD) is searched. The MFD is indexed by user name or account number, and each entry points to the UFD for that user
___________________ process cannot affect or be affected by the execution of another process
Independent
Process Control Block (PCB)
Information associated with each process: Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O status information
Where should the I/O functionality be implemented -- in the device hardware, in the device driver, or in application software? Sometimes we observe a progression that looks a little something like this:
Initially, we implement experimental I/O algorithms at the application level, because application code is flexible and application bugs are unlikely to cause system crashes. When an application-level algorithm has demonstrated its worth, we may reimplement it in the kernel. This can improve performance, but the development effort is more challenging, because an operating-system kernel is a large, complex software system The highest performance may be obtained through a specialized implementation in hardware, either in the device or in the controller. The disadvantages of a hardware implementation include the difficulty and expense it for making further improvements or of fixing bugs
Which of the following is true of the direct access method? Select one: a. It is the most common mode of access. b. It allows programs to read and write records in no particular order. c. Files are made up of records of variable lengths. d. It is not a good method for accessing large amounts of data quickly.
It allows programs to read and write records in no particular order
The second layer is called the virtual file system (VFS) layer. The VFS layer serves two important functions:
It separates file-system-generic operations from their implementation by defining a clean VFS interface. Several implementations for the VFS interface may coexist on the same machine, allowing transparent access to different types of file systems mounted locally. It provides a mechanism for uniquely representing a file throughout a network. The VFS is based on a file-representation structure, called a vnode, that contains a numerical designator for a network-wide unique file. (UNIX inodes are unique within only a single file system.) This network-wide uniqueness is required for support of network file systems. The kernel maintains one vnode structure for each active node (file or directory).
Java Threads
Java threads are managed by the JVM Typically implemented using the threads model provided by underlying OS Java threads may be created by either extending a Thread class or Implementing the Runnable interface
effective access time
Let p be the probability of a page fault (0 <= p <= 1). We would expect p to be close to zero--that is, we would expect to have only a few page faults. The effective access time is then... effective access time = (1 - p) * ma + p * page fault time
__________ is a set of software frameworks that provide additional services to application developers. Select one: a. System programs b. Virtualization c. Cloud computing d. Middleware
Middleware
Figure 1.11 is super cool
Might want to study but it is also just super super cool
_____ allow operating system services to be loaded dynamically. Select one: a. Virtual machines b. Modules c. File systems d. Graphical user interfaces
Modules
_______________________________ is better still. Consider how strong authentication can be with a USB device that must be plugged into the system, a PIN, and a fingerprint scan. Except for having to place ones finger on a pad and plug the USB into the system, this authentication method is no less convenient than that using normal passwords. Recall, though, that strong authentication by itself is not sufficient to guarantee the ID of the user. An authenticated session can still be hijacked if it is not encrypted
Multifactor authentication
Network file systems are commonplace. They are typically integrated with the overall directory structure and interface of the client system
NFS is a good example of a widely used, well implemented client-server network file system
obtaining the page size on Linux Systems
On a Linux system, the page size varies according to the architecture, and there are several ways of obtaining the page size. One approach is to use the getpagesize() system call. Another strategy is to enter the following command on the command line: getconf PAGESIZE Each of these techniques returns the page size as a number of bytes
Computers access disk storage in two ways. What are they?
One way is via I/O ports (or host-attached storage); this is common on small systems. The other way is through a remote host in a distributed file system; this is referred to as a network-attached storage.
copy protection or digital rights management (DRM)
Operating systems and other programs can limit the ability to play back movies and music or display electronic books to authorized computers.
Three primary thread libraries used within user threads:
POSIX Pthreads Win32 threads Java threads
RAID level 6
RAID level 6, also called the P + Q redundancy scheme, is much like RAID level 5 but stores extra redundant information to guard against multiple disk failures. Instead of parity, error-correcting codes such as the Reed-Solomon codes are used.
threading issues
Semantics of fork() and exec() system calls Thread cancellation of target thread (asynchronous or deferred) Signal handling Thread pools Thread-specific data Scheduler activations
If you look at a disk drive, you will see a circuit board attached to one side. This board is the disk controller. It implements the disk side of the protocol for some kind of connection--SCSI or _____________________________________________, for instance. It has microcode and a processor to do many tasks, such as bad-sector mapping, prefetching, buffering, and caching
Serial Advanced Technology Attachment (SATA)
File modification system programs
Several text editors may be available to create and modify the content of files stored on disk or other storage devices. There may also be special commands to search contents of files or perform transformations of the text
Systems that use inverted page tables have difficulty implementing shared memory.
Shared memory is usually implemented as multiple virtual addresses (one for each process sharing the memory) that are mapped to one physical address. This standard method cannot be used with inverted page tables; because there is only one virtual page entry for every physical page, one physical page cannot have two (or more) shared virtual addresses. A simple technique for addressing this issue is to allow the page table to contain only one mapping of a virtual address to the shared physical address.
A scan within an individual system can check a variety of aspects of the system:
Short or easy-to-guess passwords Unauthorized privileged programs, such as setuid programs Unauthorized programs in system directories Unexpectedly long-running processes Improper directory protections on user and system directories Improper protections on system data files, such as the password file, device drivers, or the operating-system kernel itself Dangerous entries in the program search path (for example, the Trojan horse discussed in Section 14.2.1) Changes to system programs detected with checksum values Unexpected or hidden network daemons
50-percent rule
Statistical analysis of first fit, for instance, reveals that, even with some optimization, given N allocated blocks, another 0.5 N blocks will be lost to fragmentation. That is, one-third of memory may be unusable! This is known as the 50-percent rule
FCFS Scheduling (continued...)
Suppose that the processes arrive in the order: P2, P3, P1 The Gantt chart for the schedule is: P2 (0 to 3) P3 (0 to 6) P1 (6 to 30) Waiting time for P1 = 6; P2 = 0; P3 = 3 Average waiting time (6 + 0 + 3) / 3 = 3 Much better than the previous case This is an example of the Convoy Effect -- short processes should be behind the long processes (consider one CPU-bound and many I/O-bound processes)
_________________________ occur in the order in which the disk subsystem receives them, and the writes are not buffered. Thus, the calling routine must wait for the data to reach the disk drive before it can proceed.
Synchronous writes
_____ provide(s) an interface to the services provided by an operating system. Select one: a. Shared memory b. System calls c. Simulators d. Communication
System calls
_________________________ sit between applications and the kernel, monitoring system-call execution. For example, in Solaris 10, the "least privilege" feature implements a list of more than fifty system calls that processes may or may not be allowed to make. A process that does not need to spawn other processes can have that ability taken away, for instance
System-call firewalls
Concurrent execution on a single-core system
T1, T2, T3, T4, T1, T2, T3, T4, T1, ... over time
parallel execution on a multicore system
T1, T3, T1, T3, T1,... T2, T4, T2, T4, T2,... simultaneously over time, with T1 and T3 being executed on core 1 and T2 and T4 being executed on core 2
application programming interface (API)
The API specifies a set of functions that are available to an application programmer, including the parameters that are passed to each function and the return values the programmer can expect. Three of the most common APIs available to application programmers are the Windows API for Windows systems, the POSIX API for POSIX-based systems (which include virtually all versions of UNIX, Linux, and Mac OS X), and the Java API for programs that run on the Java virtual machine.
To create an operating system for a particular machine configuration, we must perform system generation. For the computer system to begin running, the CPU must initialize and start executing the bootstrap program in firmware.
The bootstrap can execute the operating system directly if the operating system is also in the firmware, or
Repositioning within a file
The directory is searched for the appropriate entry, and the current-file-position pointer is repositioned to a given value. Repositioning within a file need not involve any actual I/O. This file operation is also known as a file seek.
Error detection
The operating system needs to be detecting and correcting errors constantly. Errors may occur in the CPU and memory hardware (such as a memory error or a power failure), in I/O devices (such as a parity error on disk, a connection failure on a network, or lack of paper in the printer), and in the user program (such as an arithmetic overflow, an attempt to access an illegal memory location, or a too-great use of CPU time). For each type of error, the operating system should take the appropriate action to ensure correct and consistent computing. Sometimes, it has no choice but to halt the system. At other times, it might terminate an error-causing process or return an error code to a process for the process to detect and possibly correct.
cache coherency
The situation becomes more complicated in a multiprocessor environment where, in addition to maintaining internal registers, each of the CPUs also contains a local cache (Figure 1.6). In such an environment, a copy of A may exist simultaneously in several caches. Since the various CPUs can all execute in parallel, we must make sure that an update to the value of A in one cache is immediately reflected in all other caches where A resides.
To start a new process, the shell executes a fork() system call
Then, the selected program is loaded into memory via an exec() system call, and the program is executed Depending on the way the command was issued, the shell then either waits for the process or runs the process "in the background." In the latter case, the shell immediately requests another command. When the process is done, it executes an exit() system call to terminate, returning to the invoking process a status code of 0 or a nonzero error code
Which statement concerning privileged instructions is considered false? Select one: a. They may cause harm to the system. b. They can only be executed in kernel mode. c. They cannot be attempted from user mode. d. They are used to manage interrupts.
They cannot be attempted from user mode
Which of the following statements regarding solid state disks (SSDs) is false? Select one: a. They generally consume more power than traditional hard disks. b. They have the same characteristics as magnetic hard disks, but can be more reliable. c. They are generally more expensive per megabyte than traditional hard disks. d. They have no seek time or latency.
They generally consume more power than traditional hard disks
Most programs—including compilers, assemblers, word processors, editors, and formatters—are stored on a disk until loaded into memory.
They then use the disk as both the source and destination of their processing. Hence, the proper management of disk storage is of central importance to a computer system.
For most computers, the bootstrap is stored in read-only memory (ROM).
This location is convenient, because ROM needs no initialization and is at a fixed location that the processor can start executing when powered up or reset.
The operating system, executing in kernel mode, is given unrestricted access to both operating-system memory and users' memory.
This provision allows the operating system to load users' programs into users' memory, to dump out those programs in case of errors, to access and modify parameters of system calls, to perform I/O to and from user memory, and to provide many other services.
_____ occurs when a process spends more time paging than executing. Select one: a. Thrashing b. Memory mapping c. Demand paging d. Swapping
Thrashing
deleting a file
To delete a file, we search the directory for the named file. Having found the associated directory entry, we release all file space, so that it can be reused by other files, and erase the directory entry.
Another possible solution to the external-fragmentation problem is to permit the logical address space of the processes to be noncontiguous, thus allowing a process to be allocated physical memory wherever such memory is available.
Two complementary techniques achieve this solution: segmentation and paging. These techniques can also be combined.
creating a file
Two steps are necessary to create a file. First, space in the file system must be found for the file. We discuss how to allocate space for the file in Chapter 11. Second, an entry for the new file must be made in the directory.
Which of the following statements is false? Select one: a. Swapping works in conjunction with virtual memory techniques. b. Some systems allow for multiple swap spaces (disks). c. Solaris only swaps pages of anonymous memory. d. Typically, entire processes are swapped into memory.
Typically, entire processes are swapped into memory
multiprocessing can cause a system to change its memory access model from uniform memory access (UMA) to non-uniform memory access (NUMA)
UMA is defined as the situation in which access to any RAM from any CPU takes the same amount of time. With NUMA, some parts of memory may take longer to access than other parts, creating a performance penalty. Operating systems can minimize the NUMA penalty through resource management, as discussed in
One potential difficulty with hash functions is that two inputs can result in the same output value—that is, they can link to the same table location.
We can accommodate this hash collision by having a linked list at that table location that contains all of the items with the same hash value. Of course, the more collisions there are, the less efficient the hash function is.
Data structures are pervasive in operating system implementations
We will explore kernel algorithms and their implementations
History has taught us that even though memory capacities, CPU speeds, and similar computer capabilities seem large enough to satisfy demand for the foreseeable future, the growth of technology ultimately absorbs available capacities, and we find ourselves in need of additional memory or processing power, often sooner than we think.
What might the future of technology bring that would make a 64-bit address space seem to small?
context switch
When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch Context of a process represented in the PCB Context-switch time is overhead; the system does no useful work while switching Time dependent on hardware support
Which of the following is true of the Java programming language in relation to protection? Select one: a. When a class is loaded, the JVM assigns the class to a protection domain that gives the permissions of that class. b. It does not support the dynamic loading of untrusted classes over a network. c. It does not support the execution of mutually distrusting classes within the same JVM. d. Methods in the calling sequence are not responsible for requests to access a protected resource.
When a class is loaded, the JVM assigns the class to a protection domain that gives the permissions of that class
Which one of the following operating systems is not open source? a. Windows b. BSD UNIX c. Linux d. PCLinuxOS
Windows
Operating system examples
Windows XP Threads Linux Thread
In some ways, the third method, the __________________________, is a reversion to the first. A browser is needed to gain access to the remote files, and separate operations (essentially a wrapper for ftp) are used to transfer files.
World Wide Web
_____ is the dynamic storage allocation algorithm that results in the largest leftover hole in memory. Select one: a. First-fit b. Best-fit c. Worst-fit d. None of the above
Worst-fit
The Andrew file system (OpenAFS) uses the following consistency semantics:
Writes to an open file by a user are not visible immediately to other users that have the same file open. Once a file is closed, the changes made to it are visible only in sessions starting later. Already open instances of the file do not reflect these changes.
core dump
a capture of the memory of the process—and store it in a file for later analysis. (Memory was referred to as the "core" in the early days of computing.) Running programs and core dumps can be probed by a debugger, which allows a programmer to explore the code and memory of a process.
firewall
a computer, appliance, or router that sits between the trusted and the untrusted. A network firewall limits network access between the two security domains and monitors and logs all connections. It can also limit connections
inode
a data structure for storing file system metadata
crash
a failure in the kernel
acyclic graph
a graph with no cycles -- allows directories to share subdirectories and files. The same file or subdirectory may be in two different directories. The acyclic graph is a natural generalization of the tree-structured directory scheme
general tree
a parent may have an unlimited number of children
binary tree
a parent may have at most two children, which we term the left child and the right child.
garbage collection
a scheme that helps us determine when the last reference has been deleted and the disk space can be reallocated Garbage collection involves traversing the entire file system, marking everything that can be accessed. Then, a second pass collects everything that is not marked onto a list of free space. (A similar marking procedure can be used to ensure that a traversal or search will cover everything in the file system once and only once). Garbage collection for a disk-based file system, however, is extremely time consuming and is thus seldom attempted
The most general scheme to implement identity-dependent access is to associate with each file and directory an ________________________ specifying user names and the types of access allowed for each user.
access-control list (ACL)
address space
child duplicate of parent OR child has a program loaded into it
How can the semantics of fork() and exec()
does fork() duplicate only the calling thread or all threads?
Some systems—such as cellular phones, tablets, and game consoles—store the entire operating system in ROM. Storing the operating system in ROM is suitable for small operating systems, simple supporting hardware, and rugged operation. A problem with this approach is that changing the bootstrap code requires changing the ROM hardware chips. Some systems resolve this problem by using _______________________________________________________, which is read-only except when explicitly given a command to become writable.
erasable programming read-only memory (EPROM)
Several pieces of information are associated with an open file
file pointer file-open count disk location of the file access rights
A ________________________ (an inode in UNIX file systems) contains information about the file, including ownership, permissions, and location of the file contents.
file-control block
With a multilevel queue, the ready queue is partitioned into two separate queues. What are they?
foreground background
A(n) ____ page table has one page entry for each real page (or frame) of memory. Select one: a. inverted b. clustered c. forward-mapped d. virtual
inverted
iOS
is a mobile operating system designed by Apple to run its smartphone, the iPhone, as well as its tablet computer, the iPad. iOS is structured on the Mac OS X operating system, with added functionality pertinent to mobile devices, but does not directly run Mac OS X applications.
operating system
is a program that manages a computer's hardware. It also provides a basis for application programs and acts as ann intermediary between the computer user and the computer hardware. An amazing aspect of operating systems is how they vary in accomplishing these tasks.
text file
is a sequence of characters organized into lines (and possibly pages).
snapshot
is a view of the file system before the last update took place.
cache management
is an important design problem. Careful selection of the cache size and of a replacement policy can result in greatly increased performance. Figure 1.11 compares storage performance in large workstations and small servers.
hot spare
is not used for data but is configured to be used as a replacement in case of disk failure. For instance, a hot spare can be used to rebuild a mirrored pair should one of the disks in the pair fail.
working-set minimum
is the minimum number of pages the process is guaranteed to have in memory. if sufficient memory is available, a process may be assigned as many pages as its working-set maximum.
FIFO
items are removed from a queue in the order in which they were inserted.
core services
layer that provides a variety of features, including support for cloud computing and databases. The bottom layer represents the core operating system, which is based on the kernel environment
volatile storage
loses its contents when the power to the device is removed
In the absence of expensive battery and generator backup systems, data must be written to ___________________________ for safekeeping.
nonvolatile storage
If we increase our degree of multiprogramming, we are _______________________ memory. If we run six processes, each of which is ten pages in size but actually uses only five pages, we have higher CPU utilization and throughput, with ten frames to spare.
over-allocating
unbounded-buffer
places no practical limit on the size of the buffer
Grand Central Dispatch handles blocks by ____. Select one: a. placing them on a dispatch queue b. creating a new thread c. placing them on a dispatch stack d. constructing a parallel region
placing them on a dispatch queue
thread library
provides programmer with API for creating and managing threads
The operations for inserting and removing items from a stack are known as __________ and ___________, respectively
push pop
The ________________________ is the time for the disk arm to move the heads to the cylinder containing the desired sector.
seek time
Which of the following is not a reason explaining why mobile devices generally do not support swapping? Select one: a. limited space constraints of flash memory b. small size of mobile applications do not require use of swap space c. limited number of writes of flash memory d. poor throughput between main memory and flash memory
small size of mobile applications do not require use of swap space
The server usually specifies the available files on a volume or directory level. Client identification is more difficult. A client can be specified by a network name or other identifier, such as an IP address, but these can be spoofed, or imitated. As a result of ___________________, an unauthorized client could be allowed access to the server. More secure solutions include secure authentication of the client via encrypted keys.
spoofing
A ___________________ is designed to encrypt and decrypt a stream of bytes or bits rather than a block. This is useful when the length of a communication would make a block cipher too slow. The key is input into a pseudo-random-bit generator, which is an algorithm that attempts to produce random bits. The output of the generator when fed a key is a keystream.
stream cipher
The surface of a magnetic disk platter is divided into ____. Select one: a. sectors b. arms c. tracks d. cylinders
tracks
A boot block ____. Select one: a. typically only knows the location and length of the rest of the bootstrap program b. typically is sophisticated enough to load the operating system and begin its execution c. is composed of multiple disk blocks d. is composed of multiple disk cylinders
typically only knows the location and length of the rest of the bootstrap program
application proxy firewall
understands the protocols that applications speak across the network. For example, SMTP is used for mail transfer. An application proxy accepts a connection just as an SMTP server would and then initiates a connection to the original destination SMTP server. It can monitor the traffic as it forwards the message, watching for and disabling illegal commands, attempts to exploit bugs, and so on.
In the UNIX operating system, a domain is associated with the ____. Select one: a. user b. process c. procedure d. task
user
One additional bit is generally attached to each entry in the page table: a __________________ bit. When this bit is set to valid, the associated page is in the process's logical address space and is thus a legal (or valid) page. When the bit is set to invalid, the page is not in the process's logical address space.
valid-invalid Illegal addresses are trapped by use of the valid-invalid bit. The operating system sets this bit for each page to allow or disallow access to the page.
This approach has several significant advantages:
1. Protection needs are simply declared, rather than programmed as a sequence of calls on procedures of an operating system. 2. Protection requirements can be stated independently of the facilities provided by a particular operating system. 3. The means for enforcement need not be provided by the designer of a subsystem. 4. A declarative notation is natural because access privileges are closely related to the linguistic concept of data type.
In any case, we are faced with three major components of the page-fault service time:
1. Service the page-fault interrupt 2. Read the page 3. Restart the process
Major performance improvements in operating systems are more likely to be the result of better data structures and algorithms than of excellent assembly-language code.
In addition, although operating systems are large, only a small amount of the code is critical to high performance; the interrupt handler, I/O manager, memory manager, and CPU scheduler are probably the most critical routines. After the system is written and is working correctly, bottleneck routines can be identified and can be replaced with assembly-language equivalents.
What is a port?
In computer networking, a port is a communication endpoint. At the software level, within an operating system, a port is a logical construct that identifies a specific process or a type of network service. Ports are identified for each protocol and address combination by 16-bit unsigned numbers, commonly known as the port number. The most common protocols that use port numbers are the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). A port number is always associated with an IP address of a host and the protocol type of the communication. It completes the destination or origination network address of a message. Like when you are running a ruby on rails server that is on port 3000 -- it is a typical local server port number for testing!
______ allows a thread to run on only one processor. Select one: a. Processor affinity b. Processor set c. NUMA d. Load balancing
processor affinity
Paradigm for cooperating processes, _____________ process produces information that is consumed by a ______________ process
producer consumer
A ____ provides an API for creating and managing threads. Select one: a. set of system calls b. multicore system c. thread library d. multithreading model
thread library
user threads
thread management done by user-level threads library
In addition, a _________________ is the potential for a security violation, such as the discovery of a vulnerability, whereas an ________________ is the attempt to break security
threat attack
dispatch latency
time for schedule to take current process off CPU and switch to another Conflict phase of dispatch latency: 1.) Preemption of any process running in kernel mode 2.) Release by low-priority process of resources needed by high-priority processes
interrupt latency
time from arrival of interrupt to start of routine that services interrupt
Dispatch latency
time it takes for the dispatcher to stop one process and start another running
The total of all protection systems within a computer system (hardware, software, firmware) that correctly enforce a security policy is known as a ________________________________________
trusted computer base (TCB)
Otherwise, its ability to secure connections can be compromised. Furthermore, firewalls do not prevent attacks that __________________, or travel within protocols or connections that the firewall allows.
tunnel
example of RR with Time Quantum = 4
(Process) P1, (Burst Time) 24 (Process) P2, (Burst Time) 3 (Process) P3, (Burst Time) 3 The Gantt chart is: P1 (0 to 4) P2 (4 to 7) P3 (7 to 10) P1 (10 to 14) P1 (14 to 18) P1 (18 to 22) P1 (22 to 26) P1 (26 to 30) Typically, higher average turnaround than SJF, but better response q should be large compared to context switch time q usually 10ms to 100ms, context switch < 10 usec
First-Come, First-Served (FCFS) Scheduling
(Process) P1, (Burst Time) 24 (Process) P2, (Burst Time) 3 (Process) P3, (Burst Time) 3 * Suppose that the processes arrive in the order P1, P2, P3. The Gantt Chart for the schedule is: P1 (0 to 24) P2 (24 to 27) P3 (27 to 30) these are one after another in a bar format * Waiting time for P1 = 0; P2 = 24; P3 = 27; * Average waiting time: (0 + 24 + 27) / 3 = 17
example of priority scheduling
(Process) P1, (Burst time) 10, (Priority) 3 (Process) P2, (Burst time) 1, (Priority) 4 (Process) P3, (Burst time) 2, (Priority) 4 (Process) P4, (Burst time) 1, (Priority) 5 (Process) P5, (Burst time) 5, (Priority) 2 * Priority scheduling Gantt Chart P1 (0 to 1) P2 (1 to 6) P1 (6 to 16) P3 (16 to 18) P4 (18 to 19) Average waiting time = 8.2 msec
example of SJF
(Process) P1, (Burst time) 6 (Process) P2, (Burst time) 8 (Process) P3, (Burst time) 7 (Process) P4, (Burst time) 3 Corresponding SJF scheduling chart P4 (0 to 3) P1 (3 to 9) P3 (9 to 16) P2 (16 to 24) Average waiting time = (3 + 16 + 9 + 0) / 4 = 7
The logical address is a pair _______________________, where the selector is a 16-bit number s (13) g (1) p (2) in which s designates the segment number, g indicates whether the segment is in the GDT or LDT, and p deals with protection. The offset is a 32-bit number specifying the location of the byte within the segment in question
(selector, offset)
PCI bus
(the common PC system bus) connects the processor-memory subsystem to fast devices, and an expansion bus connects relatively slow devices, such as the keyboard and serial and USB ports.
Traditional UNIX system structure
(the users) -> shells and commands compilers and interpreters system libraries -> system-call interface to the kernel { signals terminal handling character I/O system terminal drivers file system swapping block I/O system disk and tape drivers CPU scheduling page replacement demand paging virtual memory } kernal interface to the hardware terminal controllers terminals device controllers disks and tapes memory controllers physical memory
priority scheduling
* A priority number (integer) is associated with each process * The CPU is allocated to the process with the highest priority (smallest integer === highest priority) - preemptive - nonpreemptive * SJF is priority scheduling where priority is the inverse of predicted next CPU burst time * Problem = Starvation -- low priority processes may never execute * Solution = Aging -- as time progresses increase the priority of the process
Queueing Models
* Describes the arrival of processes, and CPU and I/O bursts probabilistically - Commonly exponential, and described by mean - Computes average throughput, utilization, waiting time, etc. * Computer system described as network of servers, each with queue of waiting processes - Knowing arrival rates and service rates - Computes utilization, average queue length, average wait time, etc.
simulator implementation
* Even simulators have limited accuracy * just implement new scheduler and test in real systems - high cost, high risk - environments vary * most flexible schedulers can be modified per-site or per-system * Or APIs to modify priorities * But again environments vary
algorithm evaluation
* How to select CPU-scheduling algorithm for an OS? * Determine criteria, then evaluate algorithms * Deterministic modeling - Type of analytic evaluation - Takes a particular predetermined workload and defines the performance of each algorithm for that workload
Windows Priority Classes (Cont.)
* If wait occurs, priority boosted depending on what was waited for * Foreground window given 3x priority boost * Windows 7 added user-mode scheduling (UMS) - Applications create and manage threads independent of kernel - For large number of threads, much more efficient - UMS schedulers come from programming language libraries like C++ Concurrent Runtime (ConcRT) framework
Windows XP Threads
* Implements the one-to-one mapping, kernel-level * Each thread contains - a thread id - register set - separate user and kernel stacks - private data storage area * To register set, stacks, and private storage area are known as the context of the threads * The primary data structures of a thread include: - ETHREAD (executive thread block) - KTHREAD (kernel thread block) - TEB (thread environment block)
Examples of IPC Systems - Mach
* Mach communication is message based * Even system calls are messages * Each task gets two mailboxes at creation - Kernel and Notify * Only three system calls needed for message transfer msg_send(), msg_receive(), msg_rpc() * Mailboxes needed for communication, created via port_allocate()
Pthreads
* May be provided either as user-level or kernel-level * A POSIX standard (IEEE 1003.1c) API for thread creation and synchronization * API specifies behavior of the thread library, implementation is up to development of the library * Common in UNIX operating systems (Solaris, Linux, Mac OS X)
Examples of IPC Systems -- Windows XP
* Message-passing centric via local procedure (LPC) facility * Only works between processes on the same system * Uses ports (like mailboxes) to establish and maintain communication channels * Communication works as follows - The client opens a handle to the subsystem's connection port object - The client sends a connection request - The server creates two private communication ports and returns the handle to one of them to the client - The client and server use the corresponding port handle to send messages or callbacks and to listen for replies
Examples of IPC Systems -- POSIX
* POSIX uses shared memory * Process first creates shared memory segment segment id = shmget(IPC PRIVATE, size, S IRUSR | S IWUSR); * Process wanting access to that shared memory must attach to it shared memory = (char *) shmat(id, NULL, 0); * Now the process could write to the shared memory sprintf(shared memory, "Writing to shared memory"); * When done a process can detach the shared memory from its address space shmdt(shared memory);
Solaris scheduling
* Priority-based scheduling * Six classes available - Time sharing (default) (TS) - Interactive (IA) - Real time (RT) - System (SYS) - Fair Share (FSS) - Fixed Priority (FP) * Give thread can be one class at a time * Each class has its own scheduling algorithm * Time sharing is multi-level feedback queue - Loadable table configurable by sysadmin
simulations
* Queueing models are limited * Simulations are more accurate - Programmed model of computer system - Clock is a variable - Gather statistics indicating algorithm performance - Data to drive simulation gathered via (random number generator according to probabilities; distributions defined mathematically or empirically; trace tapes record sequence of real events in real systems)
Linux scheduling continued...
* Real-time scheduling according to POSIX.1b - real-time tasks have static priorities * Real-time plus normal map into global priority scheme * Nice value of -20 maps to global priority 100 * Nice value of +19 maps to priority 139
Solaris Scheduling continued...
* Scheduler converts class-specific priorities into a per-thread global priority - Thread with highest priority runs next - Runs until (1) blocks, (2) uses time slice, (3) preempted by higher-priority thread - Multiple threads at same priority selected via RR
signal handling
* Signals are used in UNIX systems to notify a process that a particular event has occurred * A signal handler is used to process signals 1.) Signal is generated by a particular event 2.) Signal is delivered to a process 3.) Signal is handled * Options: - deliver the signal to the thread to which the signal applies - deliver the signal to every thread in the process - Deliver the signal to certain threads in the process - Assign a specific thread to receive all signals for the process
Proportional Share Scheduling
* T shares are allocated among all processes in the system * An application receives N shares where N < T * This ensures each application will receive N/T of the total processor time
POSIX Real-Time Scheduling
* The POSIX.1b standard * API provides functions for managing real-time threads * Defines two scheduling classes real-time threads
Windows Priority Classes
* Win32 API identifies several priority classes to which a process can belong - REALTIME_PRIORITY_CLASS, HIGH_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS, IDLE_PRIORITY_CLASS - All are variable except REAL TIME * Priority class and relative priority combine to give numeric priority * Base priority is NORMAL within the class * If quantum expires, priority lowered, but never below base
Windows scheduling
* Windows uses priority-based preemptive scheduling * Highest-priority thread runs next * Dispatcher is scheduler * Thread runs until (1) blocks, (2) uses time slice, (3) preempted by higher-priority thread * Real-time threads can preempt non-real-time * 32-level priority scheme * Variable class is 1-15, real-time class is 16-31 * Priority 0 is memory-management thread * Queue for each priority * If no run-able thread, runs idle thread
multilevel feedback queue
* a process can move between the various queues; aging can be implemented in this way * multilevel-feedback-queue scheduler defined by the following parameters: - number of queues - scheduling algorithms for each queue - method used to determine when to upgrade a process - method used to determine when to demote a process - method used to determine which queue a process will enter when that process needs service
determining the length of the next CPU burst
* can only estimate the length -- should be similar to the previous one - then pick the process with the shortest predicted next CPU burst * can be done by using the length of previous CPU bursts, using exponential average 1.) t_n = actual length of nth CPU burst 2.) τ_(n+1) = predicted value for the next CPU burst 3.) α, 0 <= α <= 1 4.) Define: τ_(n=1) = a*t_n + (1-a)τ_n Commonly, a set to 1/2 Preemptive version called shorted-remaining-time-first
thread scheduling
* distinction between user-level and kernel-level threads * when threads supported, threads scheduled, not processes * Many-to-one and many-to-many models, thread library schedules user-level threads to run on LWP - Known as process-contention scope (PCS) since scheduling competition is within the process - Typically done via priority set by programmer * Kernel thread scheduled onto available CPU is system-contention scope (SCS) -- competition among all threads in system
virtualization software schedules multiple guests onto CPU(s)
* each guest doing its own scheduling - not knowing it doesn't own the CPUs - Can result in poor response time - Can effect time-of-day clocks in guests * Can undo good scheduling algorithm efforts of guests
round robin (RR)
* each process gets a small unit of CPU time (time quantum q), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue * If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units * Timer interrupts every quantum to schedule next process * Performance - q large => FIFO - q small => q must be large with respect to context switch, otherwise overhead is too high
multilevel queue
* process permanently in a given queue * Each queue has its own scheduling algorithm - foreground --RR - background -- FCFS * scheduling must be done between the queues - fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation - time slice -- each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR - 20% to background in FCFS
example of multilevel feedback queue
* three queues: - Q_0 -- RR with time quantum 8 milliseconds - Q_1 -- RR time quantum 16 milliseconds - Q_2 -- FCFS * scheduling - A new job enters queue Q_0 which is served FCFS (When it gains CPU, jobs receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to Q_1) - At Q_1 job is again served FCFS and receives 16 additional milliseconds (If it still does not complete, it is preempted and moved to queue Q_2)
We can enhance the second-chance algorithm by considering the reference bit and the modify bit (described in Section 8.4.1) as an ordered pair. With these two bits, we have the following four possible classes:
1. (0, 0) neither recently used nor modified—best page to replace 2. (0, 1) not recently used but modified—not quite as good, because the page will need to be written out before replacement 3. (1, 0) recently used but clean—probably will be used again soon 4. (1, 1) recently used and modified—probably will be used again soon, and the page will be need to be written out to disk before it can be replaced
The 32-bit ARM architecture supports the following page sizes:
1. 4-KB and 16-KB pages 2. 1-MB and 16-MB pages (termed sections)
Disks provide most of the secondary storage on which file systems are maintained. Two characteristics make them convenient for this purpose:
1. A disk can be rewritten in place; it is possible to read a block from the disk, modify the block, and write it back into the same place 2. A disk can access directly any block of information it contains. Thus, it is simple to access any file either sequentially or randomly, and switching from one file to another requires only moving the read-write heads and waiting for the disk to rotate
An I/O operation requires a great many steps that together consume a tremendous number of CPU cycles:
1. A process issues a blocking read() system call to a file descriptor of a file that has been opened previously. 2. The system-call code in the kernel checks the parameters for correctness. In the case of input, if the data are already available in the buffer cache, the data are returned to the process, and the I/O request is completed. 3. Otherwise, a physical I/O must be performed. The process is removed from the run queue and is placed on the wait queue for the device, and the I/O request is scheduled. Eventually, the I/O subsystem sends the request to the device driver. Depending on the operating system, the request is sent via a subroutine call or an in-kernel message. 4. The device driver allocates kernel buffer space to receive the data and schedules the I/O. Eventually, the driver sends commands to the device controller by writing into the device-control registers. 5. The device controller operates the device hardware to perform the data transfer. 6. The driver may poll for status and data, or it may have set up a DMA transfer into kernel memory. We assume that the transfer is managed by a DMA controller, which generates an interrupt when the transfer completes. 7. The correct interrupt handler receives the interrupt via the interrupt-vector table, stores any necessary data, signals the device driver, and returns from the interrupt. 8. The device driver receives the signal, determines which I/O request has completed, determines the request's status, and signals the kernel I/O subsystem that the request has been completed. 9. The kernel transfers data or return codes to the address space of the requesting process and moves the process from the wait queue back to the ready queue. 10. Moving the process to the ready queue unblocks the process. When the scheduler assigns the process to the CPU, the process resumes execution at the completion of the system call.
The ability to copy an access right from one domain (or row) of the access matrix to another is denoted by an asterisk (*) appended to the access right. The copy right allows the access right to be copied only within the column (that is, for the object) for which the right is defined. This scheme has two additional variants:
1. A right is copied from access(i, j) to access(k, j); it is then removed from access(i, j). This action is a transfer of a right, rather than a copy. 2. Propagation of the copy right may be limited. That is, when the right R∗ is copied from access(i, j) to access(k, j), only the right R (not R∗) is created. A process executing in domain Dk cannot further copy the right R.
To contribute to the overall reliability of a system, the access-control mechanism should be safe to use. To be useful in practice, it should also be reasonably efficient. This requirement has led to the development of a number of language constructs that allow the programmer to declare various restrictions on the use of a specific managed resource. (See the bibliographical notes for appropriate references.) These constructs provide mechanisms for three functions:
1. Distributing capabilities safely and efficiently among customer processes. In particular, mechanisms ensure that a user process will use the managed resource only if it was granted a capability to that resource. 2. Specifying the type of operations that a particular process may invoke on an allocated resource (for example, a reader of a file should be allowed only to read the file, whereas a writer should be able both to read and to write). It should not be necessary to grant the same set of rights to every user process, and it should be impossible for a process to enlarge its set of access rights, except with the authorization of the access-control mechanism. 3. Specifying the order in which a particular process may invoke the various operations of a resource (for example, a file must be opened before it can be read). It should be possible to give two processes different restrictions on the order in which they can invoke the operations of the allocated resource.
As a worst-case example, consider a three-address instruction such as ADD the content of A to B, placing the result in C. These are the steps to execute the instruction:
1. Fetch and decode the instruction (ADD) 2. Fetch A 3. Fetch B 4. Add A and B 5. Store the sum in C If we fault when we try to store in C (because C is in a page not currently in memory), we will have to get the desired page, bring it in, correct the page table, and restart the instruction.
We modify the page-fault service routine to include page replacement:
1. Find the location of the desired page on the disk 2. Find a free frame: a. If there is a free frame, use it b. If there is no free frame, use a page-replacement algorithm to select a victim frame c. Write the victim frame to the disk; change the page and frame tables accordingly 3. Read the desired page into the newly freed frame; change the page and frame tables 4. Continue the user process from where the page fault occurred
The slab allocator provides two main benefits:
1. No memory is wasted due to fragmentation. Fragmentation is not an issue because each unique kernel data structure has an associated cache, and each cache is made up of one or more slabs that are divided into chunks the size of the objects being represented. Thus, when the kernel requests memory for an object, the slab allocator returns the exact amount of memory required to represent the object. 2. Memory requests can be satisfied quickly. The slab allocation scheme is thus particularly effective for managing memory when objects are frequently allocated and deallocated, as is often the case with requests from the kernel. The act of allocating—and releasing—memory can be a time-consuming process. However, objects are created in advance and thus can be quickly allocated from the cache. Furthermore, when the kernel has finished with an object and releases it, it is marked as free and returned to its cache, thus making it immediately available for subsequent requests from the kernel.
To protect a system, we must take security measures at four levels:
1. Physical 2. Human 3. Operating system 4. Network
polling
1. The host repeatedly reads the busy bit until that bit becomes clear. 2. The host sets the write bit in the command register and writes a byte into the data-out register. 3. The host sets the command-ready bit. 4. When the controller notices that the command-ready bit is set, it sets the busy bit. 5. The controller reads the command register and sees the write command. It reads the data-out register to get the byte and does the I/O to the device. 6. The controller clears the command-ready bit, clears the error bit in the status register to indicate that the device I/O succeeded, and clears the busy bit to indicate that it is finished.
Kernel memory is often allocated from a free-memory pool different from the list used to satisfy ordinary user-mode processes. There are two primary reasons for this:
1. The kernel requests memory for data structures of varying sizes, some of which are less than a page in size. As a result, the kernel must use memory conservatively and attempt to minimize waste due to fragmentation. This is especially important because many operating systems do not subject kernel code or data to the paging system. 2. Pages allocated to user-mode processes do not necessarily have to be in contiguous physical memory. However, certain hardware devices interact directly with physical memory—without the benefit of a virtual memory interface—and consequently may require memory residing in physically contiguous pages.
To compute the effective access time, we must know how much time is needed to service a page fault. A page fault causes the following sequence to occur:
1. Trap to the operating system. 2. Save the user registers and process state. 3. Determine that the interrupt was a page fault. 4. Check that the page reference was legal and determine the location of the page on the disk. 5. Issue a read from the disk to a free frame:a. Wait in a queue for this device until the read request is serviced.b. Wait for the device seek and/or latency time.c. Begin the transfer of the page to a free frame. 6. While waiting, allocate the CPU to some other user (CPU scheduling, optional). 7. Receive an interrupt from the disk I/O subsystem (I/O completed). 8. Save the registers and process state for the other user (if step 6 is executed). 9. Determine that the interrupt was from the disk. 10. Correct the page table and other tables to show that the desired page is now in memory. 11. Wait for the CPU to be allocated to this process again. 12. Restore the user registers, process state, and new page table, and then resume the interrupted instruction.
The basic interrupt mechanism just described enables the CPU to respond to an asynchronous event, as when a device controller becomes ready for service. In a modern operating system, however, we need more sophisticated interrupt-handling features.
1. We need the ability to defer interrupt handling during critical processing. 2. We need an efficient way to dispatch to the proper interrupt handler for a device without first polling all the devices to see which one raised the interrupt. 3. We need multilevel interrupts, so that the operating system can distinguish between high- and low-priority interrupts and can respond with the appropriate degree of urgency.
Parallelism in a disk system, as achieved through striping, has two main goals:
1.) Increase the throughput of multiple small accesses (that is, page access) by load balancing 2.) Reduce the response time of large accesses
Ideally, we want the programs and data to reside in main memory permanently. This arrangement usually is not possible for the following two reasons:
1.) Main memory is usually too small to store all needed programs and data permanently 2.) Main memory is a volatile storage device that loses all of its contents when power is turned off or otherwise lost
Essentially, the attack exploits a bug in a program. The bug can be a simple case of poor programming, in which the programmer neglected to code bounds checking on an input field. In this case, the attacker sends more data than the program was expecting. By using trial and error, or by examining the source code of the attacked program if it is available, the attacker determines the vulnerability and writes a program to do the following:
1.) Overflow an input field, command-line argument, or input buffer -- for example, on a network daemon--until it writes into the stack 2.) Overwrite the current return address on the stack within the address of the exploit code loaded in step 3 3.) Write a simple set of code for the next space in the stack that includes the commands that the attacker wishes to execute-- for instance, spawn a shell
A disk write results in one of three outcomes:
1.) Successful completion. The data are written correctly on disk 2.) Partial failure. A failure occurred in the midst of transfer, so only some of the sectors were written with the new data, and the sector being written during the failure may have been corrupted. 3.) Total failure. The failure occurred before the disk write started, so the previous data values on the disk remain intact
CPU scheduling decisions may take place when a process:
1.) Switches from running to waiting state 2.) Switches from running to ready state 3.) Switches from waiting to ready 4.) Terminates
Normally, when a program is compiled, the compiler automatically constructs segments reflecting the input program. The C compiler might create separate segments for the following:
1.) The code 2.) Global variables 3.) The heap, from which memory is allocated 4.) The stacks used by each thread 5.) The standard C library
Whenever a failure occurs during the writing of a block, the system needs to detect it and invoke a recovery procedure to restore the block to a consistent state. To do that, the system must maintain two physical blocks for each logical block. An output operation is executed as follows:
1.) Write the information onto the first physical block 2.) When the first write completes successfully, write the same information onto the second physical block. 3.) Declare the operation complete only after the second write completes successfully
Buffering Queue of messages attached to the link; implemented in one of three ways:
1.) Zero capacity -- 0 messages Sender must wait for receiver (rendezvous) 2.) Bounded capacity -- finite length of n messages. Sender must wait if link full 3.) Unbounded capacity -- infinite length. Sender never waits
Consider a logical address with a page size of 8 KB. How many bits must be used to represent the page offset in the logical address? Select one: a. 10 b. 8 c. 13 d. 12
13
Imagine that a host with IP address 150.55.66.77 wishes to download a file from the web server at IP address 202.28.15.123. Select a valid socket pair for a connection between this pair of hosts. Select one: a. 150.55.66.77:80 and 202.28.15.123:80 b. 150.55.66.77:150 and 202.28.15.123:80 c. 150.55.66.77:2000 and 202.28.15.123:80 d. 150.55.66.77:80 and 202.28.15.123:3500
150.55.66.77:2000 ad 202.28.15.123:80
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? Select one: a. 199 b. 201 c. 200 d. 300
200
Consider a logical address with 18 bits used to represent an entry in a conventional page table. How many entries are in the conventional page table? Select one: a. 262144 b. 1024 c. 1048576 d. 18
262144
RAID level ____ is the most common parity RAID system. Select one: a. 0 b. 0+1 c. 4 d. 5
5
Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11, 75, 185, 100, 87. Using the SSTF scheduling algorithm, what is the order in which the requests are serviced, assuming the disk head is at cylinder 88 and moving upward through the cylinders? Select one: a. 116 - 22 - 3 - 11 - 75 - 185 - 100 - 87 b. 100 - 116 - 185 - 87 - 75 - 22 - 11 - 3 c. 87 - 75 - 100 - 116 - 185 - 22 - 11 - 3 d. 100 - 116 - 185 - 3 - 11 - 22 - 75 - 87
87-75-100-116-185-22-11-3
For simplicity of implementation, segments are numbered and are referred to by a segment number, rather than a segment name. Thus, a logical address consists of a "two tuple":
<segment-number, offset>
On disk, a file system may contain information about how to boot an operating system stored there, the total number of blocks, the number and location of free blocks, and directory structure, and individual files. Many of these structures are detailed throughout the remainder of this chapter. Here, we describe them briefly:
A boot control block (per volume) can contain information needed by the system to boot an operating system from that volume. If the disk does not contain an operating system, this block can be empty. It is typically the first block of a volume. In UFS, it is called the boot block. In NTFS, it is the partition boot sector. A volume control block (per volume) contains volume (or partition) details, such as the number of blocks in the partition, the size of the blocks, a free-block count and free-block pointers, and a free-FCB count and FCB pointers. In UFS, this is called a superblock. In NTFS, it is stored in the master file table. A directory structure (per file system) is used to organize the files. In UFS, this includes file names and associated inode numbers. In NTFS, it is stored in the master file table. A per-file FCB contains many details about the file. It has a unique identifier number to allow association with a directory entry. In NTFS, this information is actually stored within the master file table, which uses a relational database structure, with a row per file.
Although the hardware aspects of I/O are complex when considered at the level of detail of electronics-hardware design, the concepts that we have just described are sufficient to enable us to understand many I/O features of operating systems. Let's review the main concepts:
A bus A controller An I/O port and its registers The handshaking relationship between the host and a device controller The execution of this handshaking in a polling loop or via interrupts The offloading of this work to a DMA controller for large transfers
interpretation
A common example of emulation occurs when a computer language is not compiled to native code but instead is either executed in its high-level form or translated to an intermediate form.
The full bootstrap program is stored in the "boot blocks" at a fixed location on the disk.
A disk that has a boot partition is called a boot disk or a system disk
The I/O subsystem consists of several components
A memory-management component that includes buffering, caching, and spooling A general device-driver interface Drivers for specific hardware devices
Child processes inherit UNIX ordinary pipes from their parent process because: Select one: a. The pipe is part of the code and children inherit code from their parents. b. A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents. c. The STARTUPINFO structure establishes this sharing. d. All IPC facilities are shared between the parent and child processes.
A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents
ssize_t read(int fd, void *buf, size_t count)
A program that uses the read() function must include the unistd.h header file, as this file defines the ssize_t and size_t data types (among other things). The parameters passed to read() are as follows: int fd—the file descriptor to be read void *buf—a buffer where the data will be read into size_t count—the maximum number of bytes to be read into the buffer On a successful read, the number of bytes read is returned. A return value of 0 indicates end of file. If an error occurs, read() returns −1.
The ability to execute a program that is only partially in memory would confer many benefits:
A program would no longer be constrained by the amount of physical memory that is available. Users would be able to write programs for an extremely large virtual address space, simplifying the programming task. Because each user program could take less physical memory, more programs could be run at the same time, with a corresponding increase in CPU utilization and throughput but with no increase in response time or turnaround time. Less I/O would be needed to load or swap user programs into memory, so each user program would run faster
Processing must be done within the defined constraints, or the system will fail. For instance, it would not do for a robot arm to be instructed to halt after it had smashed into the car it was building.
A real-time system functions correctly only if it returns the correct result within its time constraints. Contrast this system with a time-sharing system, where it is desirable (but not mandatory) to respond quickly, or a batch system, which may have no time constraints at all.
I/O operations
A running program may require I/O, which may involve a file or an I/O device. For specific devices, special functions may be desired (such as recording to a CD or DVD drive or blanking a display screen). For efficiency and protection, users usually cannot control I/O devices directly. Therefore, the operating system must provide a means to do I/O.
An authentication algorithm using symmetric keys consists of the following components:
A set K of keys A set M of messages A set A of authenticators A function S : K → (M → A). That is, for each k ∈ K, Sk is a function for generating authenticators from messages. Both S and Sk for any k should be efficiently computable functions. A function V : K → (M × A → {true, false}). That is, for each k ∈ K, Vk is a function for verifying authenticators on messages. Both V and Vk for any k should be efficiently computable functions.
An encryption algorithm consists of the following components:
A set K of keys A set M of messages A set C of ciphertexts An encrypting function E : K → (M → C). That is, for each k ∈ K, Ek is a function for generating ciphertexts from messages. Both E and Ek for any k should be efficiently computable functions. Generally, Ek is a randomized mapping from messages to ciphertexts. A decrypting function D : K → (C → M). That is, for each k ∈ K, Dk is a function for generating messages from ciphertexts. Both D and Dk for any k should be efficiently computable functions.
We can use the timer to prevent a user program from running too long
A simple technique is to initialize a counter with the amount of time that a program is allowed to run. A program with a 7-minute time limit, for example, would have its counter initialized to 420. Every second, the timer interrupts, and the counter is decremented by 1. As long as the counter is positive, control is returned to the user program. When the counter becomes negative, the operating system terminates the program for exceeding the assigned time limit
Many-to-Many multithreading model
Allows many user level threads to be mapped to many kernel threads Allows the operating system to create a sufficient number of kernel threads Solaris prior to version 9 Windows NT/2000 with the ThreadFiber package
Which of the following is an advantage of compiler-based enforcement of access control? Select one: a. Protection schemes are programmed as opposed to simply declared. b. Protection requirements are dependent of the facilities provided by a particular operating system. c. The means for enforcement needs to be provided by the designer of the subsystem. d. Access privileges are closely related to the linguistic concept of a data type.
Access privileges are closely related to the linguistic concept of a data type
firmware
All forms of ROM are also known as firmware, since their characteristics fall somewhere between those of hardware and those of software. A problem with firmware in general is that executing code there is slower than executing code in RAM. Some systems store the operating system in firmware and copy it to RAM for fast execution. A final issue with firmware is that it is relatively expensive, so usually only small amounts are available.
Thread specific data
Allows each thread to have its own copy of data Useful when you do not have control over the thread creation process (i.e. when using a thread pool)
Background services system programs
All general-purpose systems have methods for launching certain system-program processes at boot time. Some of these processes terminate after completing their tasks, while others continue to run until the system is halted. Constantly running system-program processes are known as services, subsystems, or daemons. One example is the network daemon discussed in Section 2.4.5. In that example, a system needed a service to listen for network connections in order to connect those requests to the correct processes. Other examples include process schedulers that start processes according to a specified schedule, system error monitoring services, and print servers. Typical systems have dozens of daemons. In addition, operating systems that run important activities in user context rather than in kernel context may use daemons to run these activities.
A process may transition to the Ready state by which of the following actions? Select one: a. Completion of an I/O event b. Awaiting its turn on the CPU c. Newly-admitted process d. All of the above
All of the above
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? Select one: a. The child process runs concurrently with the parent. b. The child process has a new program loaded into it. c. The child is a duplicate of the parent. d. All of the above
All of the above
User interface
Almost all operating systems have a user interface (UI). This interface can take several forms. One is a command-line interface (CLI) Another is a batch interface Most commonly, a graphical user interface (GUI) is used Some systems provide two or all three of these variations
Some TLBs store ___________________________ in each TLB entry.
An ASID uniquely identifies each process and is used to provide address-space protection for that process. When the TLB attempts to resolve virtual page numbers, it ensures that the ASID for the currently running process matches the ASID associated with the virtual page
In peer-to-peer, when a node joins a network, it registers its service with a centralized lookup service on the network. Any node desiring a specific service first contacts this centralized lookup service to determine which node provides the service. The remainder of the communication takes place between the client and the service provider.
An alternative scheme uses no centralized lookup service. Instead, a peer acting as a client must discover what node provides a desired service by broadcasting a request for the service to all other nodes in the network. The node (or nodes) providing that service responds to the peer making the request. To support this approach, a discovery protocol must be provided that allows peers to discover services provided by other peers in the network. Figure 1.19 illustrates such a scenario.
ease of use
An operating system whose goal is to maximize the work (or play) that the user is performing
ftp is used for both anonymous and authenticated access. _________________________ allows a user to transfer files without having an account on the remote system. The World Wide Web uses anonymous file exchange almost exclusively.
Anonymous access
Although Intel chips have dominated the personal computer market for over 30 years, chips for mobile devices such as smartphones and tablet computers often instead run on 32-bit ARM processors. Interestingly, whereas Intel both designs and manufactures chips, ARM only designs them. It then licenses its designs to chip manufacturers.
Apple has licensed the ARM design for its iPhone and iPad mobile devices, and several Android-based smartphones use ARM processors as well.
The structure of Android operating system appears as follows:
Applications Application Framework { Libraries -- SQLite, openGL, surface manager, media framework, webkit, libc Android runtime -- Core Libraries, Dalvik virtual machine } Linux Kernel
For a program to be executed, it must be mapped to absolute addresses and loaded into memory.
As the program executes, it accesses program instructions and data from memory by generating these absolute addresses. Eventually, the program terminates, its memory space is declared available, and the next program can be loaded and executed.
Microkernel-based operating systems (Section 2.7.3) take the separation of mechanism and policy to one extreme by implementing a basic set of primitive building blocks. These blocks are almost policy free, allowing more advanced mechanisms and policies to be added via user-created kernel modules or user programs themselves. As an example, consider the history of UNIX.
At the other extreme is a system such as Windows, in which both mechanism and policy are encoded in the system to enforce a global look and feel. All applications have similar interfaces, because the interface itself is built into the kernel and system libraries. The Mac OS X operating system has similar functionality.
_____ is the dynamic storage allocation algorithm that results in the smallest leftover hole in memory. Select one: a. First-fit b. Best-fit c. Worst-fit d. None of the above
Best-fit
An operating system executes a variety of programs:
Batch system - jobs Time-shared systems - user programs or tasks **the textbook uses the terms job and process almost interchangeably
Which of the following statements is false with regard to allocating kernel memory? Select one: a. Slab allocation does not suffer from fragmentation. b. Adjacent segments can be combined into one larger segment with the buddy system. c. Because the kernel requests memory of varying sizes, some of which may be quite small, the system does not have to be concerned about wasting memory. d. The slab allocator allows memory requests to be satisfied very quickly.
Because the kernel requests memory of varying sizes, some of which may be quite small, the system does not have to be concerned about wasting memory
A crucial requirement for demand paging is the ability to restart any instruction after a page fault
Because we save the state (registers, condition code, instruction counter) of the interrupted process when the page fault occurs, we must be able to restart the process in exactly the same place and state, except that the desired page is now in memory and is accessible.
Scheduling criteria
CPU utilization -- keep the CPU as busy as possible Throughput -- # of processes that complete their execution per time unit Turnaround time -- amount of time to execute a particular process Waiting time -- amount of time a process has been waiting in the ready queue Response time -- amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
_____ is/are not a technique for passing parameters from an application to a system call. Select one: a. Cache memory b. Registers c. Stack d. Special block in memory
Cache memory
Real-Time CPU Scheduling
Can present obvious challenges Soft real-time systems -- no guarantee as to when critical real-time processes will be scheduled Hard real-time systems -- task must be serviced by its deadline Two types of latencies affect performance 1.) Interrupt latency - time from arrival of interrupt to start of routine that services interrupt 2.) Dispatch latency - time for schedule to take current process off CPU and switch to another
Unfortunately for device-hardware manufacturers, each type of operating system has its own standards for the device-driver interface. A given device may ship with multiple device drivers—for instance, drivers for Windows, Linux, AIX, and Mac OS X. Devices vary on many dimensions, as illustrated here:
Character-stream or block -- A character-stream device transfers bytes one by one, whereas a block device transfers a block of bytes as a unit. Sequential or random access -- A sequential device transfers data in a fixed order determined by the device, whereas the user of a random-access device can instruct the device to seek to any of the available data storage locations. Synchronous or asynchronous -- A synchronous device performs data transfers with predictable response times, in coordination with other aspects of the system. An asynchronous device exhibits irregular or unpredictable response times not coordinated with other computer events. Sharable or dedicated -- A sharable device can be used concurrently by several processes or threads; a dedicated device cannot Speed of operation -- device speeds range from a few bytes per second to a few gigabytes per second Read-write, read only, or write only -- Some devices perform both input and output, but others support only one data transfer direction
Programming-language support system programs
Compilers, assemblers, debuggers, and interpreters for common programming languages (such as C, C++, Java, and PERL) are often provided with the operating system or available as a separate download.
Linux scheduling in version 2.6.23 +
Completely Fair Scheduler (CFS) * Scheduling classes - each has a specific priority - scheduler picks highest priority task in highest scheduling class - rather than quantum based on fixed time allotments, based on proportion of CPU time - 2 scheduling classes included, others can be added (default, real-time) * Quantum calculated based on nice value from -20 to +19 - Lower value is higher priority - Calculates target latency -- interval of time during which task should run at least once - Target latency can increase if say number of active tasks increases * CFS scheduler maintains per task virtual run time in variable vruntime - Associated with decay factor based on priority of task -- lower priority is higher decay rate - Normal default priority yields virtual run time = actual run time * To decide next task to run, scheduler picks task with lowest virtual run time
________________________ represent an important criterion for evaluating any file system that supports file sharing.
Consistency semantics These semantics specify how multiple users of a system are to access a shared file simultaneously. In particular, they specify when modifications of data by one user will be observable by other users
The main problem with access lists is their length. If we want to allow everyone to read a file, we must list all users with read access. This technique has two undesirable consequences.
Constructing such a list may be a tedious and unrewarding task, especially if we do not know in advance the list of users in the system The directory entry, previously of fixed size, now must have variable size, resulting in more complicated space management **these problems can be resolved by use of a condensed version of the access list
___________________________ requires that each file occupy a set of contiguous blocks on the disk. Disk addresses define a linear ordering on the disk. With this ordering, assuming that only one job is accessing the disk, accessing block b+1 after block b normally requires no head movement
Contiguous allocation
________ allows the parent and child processes to initially share the same pages, but when either process modifies a page, a copy of the shared page is created. Select one: a. Copy-on-write b. Zero-fill-on-demand c. Memory-mapped d. Virtual memory fork
Copy-on-write
Which of the following statements is true? Select one: a. A counting semaphore can never be used as a binary semaphore. b. A binary semaphore can never be used as a counting semaphore. c. Spinlocks can be used to prevent busy waiting in the implementation of semaphores. d. Counting semaphores can be used to control access to a resource with a finite number of instances.
Counting semaphores can be used to control access to a resource with a finite number of instances
thread pools
Create a number of threads in a pool where they await work Advantages: - usually slightly faster to service a request with an existing thread than create a new thread - Allows the number of threads in the application(s) to be bound to the size of the pool
DTrace is composed of a compiler, a framework, providers of probes written within that framework, and consumers of those probes.
DTrace providers create probes. Kernel structures exist to keep trace of all probes that the providers have created. The probes are stored in a hash-table data structure that is hashed by name and indexed according to the unique probe identifiers
Commonly, files represent programs (bot source and object forms) and data.
Data files may be numeric, alphabetic, alphanumeric, or binary.
To minimize the copying needed, we can use information from each file's directory entry. For instance, if the backup program knows when the last backup of a file was done, and the file's last write date in the directory indicates that the file has not changed since that date, then the file does not need to be copied again. A typical backup schedule may then be as follows:
Day 1 : Copy to a backup medium all files from the disk. This is called a full backup Day 2 : Copy to another medium all files changed since day 1. This is an incremental backup Day 3 : Copy to another medium all files changed since day 2 ... Day N. Copy to another medium all files changed since day N - 1. Then go back to day 1
To provide inherent protection, we must distinguish capabilities from other kinds of objects, and they must be interpreted by an abstract machine on which higher-level programs run. Capabilities are usually distinguished from other data in one of two ways:
Each object has a tag to denote whether it is a capability or accessible data. The tags themselves must not be directly accessible by an application program. Hardware or firmware support may be used to enforce this restriction. Although only one bit is necessary to distinguish between capabilities and other objects, more bits are often used. This extension allows all objects to be tagged with their types by the hardware. Thus, the hardware can distinguish integers, floating-point numbers, pointers, Booleans, characters, instructions, capabilities, and uninitialized values by their tags. Alternatively, the address space associated with a program can be split into two parts. One part is accessible to the program and contains the program's normal data and instructions. The other part, containing the capability list, is accessible only by the operating system. A segmented memory space (Section 7.4) is useful to support this approach.
Which of the following is true of multilevel queue scheduling? Select one: a. Processes can move between queues. b. Each queue has its own scheduling algorithm. c. A queue cannot have absolute priority over lower-priority queues. d. It is the most general CPU-scheduling algorithm.
Each queue has its own scheduling algorithm
A domain can be realized in a variety of ways:
Each user may be a domain. In this case, the set of objects can be accessed depends on the identity of the user. Domain switching occurs when the user is changed -- generally when one user logs out and another user logs in Each process may be a domain. In this case, the set of objects that can be accessed depends on the entity of the process. Domain switching occurs when one process sends a message to another process and then waits for a response Each procedure may be a domain. In this case, the set of objects that can be accessed corresponds to the local variables defined within the procedure. Domain switching occurs when a procedure call is made.
Which of the following is a true statement regarding the relative merits between access rights enforcement based solely on a kernel, as opposed to enforcement provided largely by a compiler? Select one: a. Enforcement by the compiler provides a greater degree of security. b. Enforcement by the kernel is less flexible than enforcement by the programming language for user-defined policy. c. Kernel-based enforcement has the advantage that static access enforcement can be verified off-line at compile time. d. The fixed overhead of kernel calls cannot often be avoided in a compiler-based enforcement.
Enforcement by the kernel is less flexible than enforcement by the programming language for user-defined policy
_____ is not considered a challenge when designing applications for multicore systems. Select one: a. Deciding which activities can be run in parallel b. Ensuring there is a sufficient number of cores c. Determining if data can be separated so that it is accessed on separate cores d. Identifying data dependencies between tasks
Ensuring there is a sufficient number of cores
You may have noticed that paging itself is a form of dynamic relocation
Every logical address is bound by the paging hardware to some physical address. Using paging is similar to using a table of base (or relocation) registers, one for each frame of memory
Which of the following disk head scheduling algorithms does not take into account the current position of the disk head? Select one: a. FCFS b. SSTF c. SCAN d. LOOK
FCFS
RAID storage can be structured in a variety of ways. For example, a system can have disks directly attached to its buses. In this case, the operating system or system software can implement RAID functionality. Alternatively, an intelligent host controller can control multiple attached disks and can implement RAID on those disks in hardware.
Finally, a storage array, or RAID array, can be used. A RAID array is a standalone unit with its own controller, cache (usually), and disks. It is attached to the host via one or more standard controllers (for example, FC). This common setup allows an operating system or software without RAID functionality to have RAID-protected disks. It is even used on systems that do have RAID software layers because of its simplicity and flexibility.
Until the DTrace framework and tools became available with Solaris 10, kernel debugging was usually shrouded in mystery and accomplished via happenstance and archaic code and tools.
For example, CPUs have a breakpoint feature that will halt execution and allow a debugger to examine the state of the system. Then execution can continue until the next breakpoint or termination. This method cannot be used in a multiuser operating-system kernel without negatively affecting all of the users on the system.
Some computers have little or no user view.
For example, embedded computers in home devices and automobiles may have numeric keypads and may turn indicator lights on or off to show status, but they and their operating systems are designed primarily to run without user intervention.
In a hierarchical storage structure, the same data may appear in different levels of the storage system.
For example, suppose that an integer A that is to be incremented by 1 is located in file B, and file B resides on hard disk. The increment operation proceeds by first issuing an I/O operation to copy the disk block on which A resides to main memory. This operation is followed by copying A to the cache and to an internal register. Thus, the copy of A appears in several places: on the hard disk, in main memory, in the cache, and in an internal register
Behind the scenes, the functions that make up an API typically invoke the actual system calls on behalf of the application programmer.
For example, the Windows function CreateProcess() (which unsurprisingly is used to create a new process) actually invokes the NTCreateProcess() system call in the Windows kernel.
The separation of policy and mechanism is important for flexibility. Policies are likely to change across places or over time. In the worst case, each change in policy would require a change in the underlying mechanism. A general mechanism insensitive to changes in policy would be more desirable. A change in policy would then require redefinition of only certain parameters of the system.
For instance, consider a mechanism for giving priority to certain types of programs over others. If the mechanism is properly separated from policy, it can be used either to support a policy decision that I/O-intensive programs should have priority over CPU-intensive ones or to support the opposite policy.
At the bottom of this software stack is the Linux kernel, although it has been modified by Google and is currently outside the normal distribution of Linux releases. Linux is used primarily for process, memory, and device-driver support for hardware and has been expanded to include power management. The Android runtime environment includes a core set of libraries as well as the Dalvik virtual machine. Software designers for Android devices develop applications in the Java language.
However, rather than using the standard Java API, Google has designed a separate Android API for Java development. The Java class files are first compiled to Java bytecode and then translated into an executable file that runs on the Dalvik virtual machine. The Dalvik virtual machine was designed for Android and is optimized for mobile devices with limited memory and CPU processing capabilities.
Processes can be described as either:
I/O bound process - spends more time doing I/O than computations, many short CPU bursts CPU-bound process - spends more time doing computations; few very long CPU bursts
An ________________________ is a dedicated, special-purpose CPU found in mainframes and other high-end systems. The job of a channel is to offload I/O work from the main CPU. The idea is that the channels keep the data flowing smoothly, while the main CPU remains free to process the data. Like the device controllers and DMA controllers found in smaller computers, a channel can process more general and sophisticated programs, so channels can be tuned for particular workloads
I/O channel
The ___________________ level consists of device drivers and interrupt handlers to transfer information between the main memory and the disk system. A device driver can be thought of as a translator. Its input consists of high-level commands such as "retrieve block 123." Its output consists of low-level, hardware-specific instructions that are used by the hardware controller, which interfaces the I/O device to the rest of the system. The device driver usually writes specific bit patterns to special locations in the I/O controller's memory to tell the controller which device location to act on and what actions to take.
I/O control
kernel extensions
I/O kit for development of device drivers and dynamically loadable modules
One of the purposes of an operating system is to hide the peculiarities of specific hardware devices from the user. For example, in UNIX, the peculiarities of I/O devices are hidden from the bulk of the operating system itself by the __________________________.
I/O subsystem
Network-layer security generally has been standardized on IPSec, which defines IP packet formats that allow the insertion of authenticators and the encryption of packet contents. _______________ uses symmetric encryption and uses the _________________________ protocol for key exchange. IKE is based on pubic-key encryption. IPSec is becoming widely used as the basis for ____________________________, in which all traffic between two IPSec endpoints is encrypted to make a private network out of one that may otherwise be public. Numerous protocols also have been developed for use by applications, such as PGP for encrypting e-mail, but then the applications themselves must be coded to implement security.
IPSec Internet Key Exchange (IKE) virtual private networks (VPNs)
In our earlier discussion of the page-fault rate, we assumed that each page faults at most once, when it is first referenced. This representation is not strictly accurate, however.
If a process of ten pages actually uses only half of them, then demand paging saves the I/O necessary to load the five pages that are never used. We could also increase our degree of multiprogramming by running twice as many processes. Thus, if we had forty frames, we could run eight processes, rather than the four that could run if each required ten frames (five of which were never used).
Contiguous allocation of a file is defined by the disk address of the first block and length (in block units) of the file.
If the file is n blocks long and starts at location b, then it occupies blocks b, b + 1, b + 2, ..., b + n − 1.
In general, as mentioned, the memory blocks available comprise a set of holes of various sizes scattered throughout memory. When a process arrives and needs memory, the system searches the set for a hole that is large enough for this process
If the hole is too large, it is split into two parts. One part is allocated to the arriving process; the other is returned to the set of holes. When a process terminates, it releases its block of memory, which is then placed back in the set of holes.
The page size (like the frame size) is defined by the hardware. The size of a page is a power of 2, varying between 512 bytes and 1 GB per page, depending on the computer architecture. The selection of a power of 2 as a page size makes the translation of a logical address into a page number and page offset particularly easy.
If the size of the logical address space is 2^m, and a page size is 2^n bytes, then the high-order m - n bits of a logical address designate the page number, and the n low-order bits designate the page offset. Thus, the logical address is as follows: page number page offset p d m-n n Where p is an index into the page table and d is the displacement within the page
Suppose that the __________________________ of a single disk is 100,000 hours. Then the mean time to failure of some disk in an array of 100 disks will be 100,000/100 = 1,000 hours, or 41.66 days, which is not long at all.
If we store only one copy of the data, then each disk failure will result in loss of a significant amount of data—and such a high rate of data loss is unacceptable.
Swapping is constrained by other factors as well.
If we want to swap a process, we must be sure that it is completely idle. Of particular concern is any pending I/O. A process may be waiting for an I/O operation when we want to swap that process to free up memory. However, if the I/O is asynchronously accessing the user memory for I/O buffers, then the process cannot be swapped. Assume that the I/O operation is queued because the device is busy.
In a dynamic protection system, we may sometimes need to revoke access rights to objects shared by different users. Various questions about revocation may arise:
Immediate versus delayed -- Does revocation occur immediately, or is it delayed? Selected versus general -- When an access right to an object is revoked, does it affect all the users who have access right to that object, or can we specify a select group of users whose access rights should be revoked? Partial versus total -- Can a subset of the rights associated with an object be revoked, or must we revoke all access rights for this object? Temporary versus permanent -- Can access be revoked permanently (that is, the revoked access right will never again be available), or can access be revoked and later be obtained again?
Mach
In the mid-1980s, researchers at Carnegie Mellon University developed an operating system called Mach that modularized the kernel using the microkernel approach. This method structures the operating system by removing all nonessential components from the kernel and implementing them as system and user-level programs. The result is a smaller kernel. There is little consensus regarding which services should remain in the kernel and which should be implemented in user space. Typically, however, microkernels provide minimal process and memory management, in addition to a communication facility.
resource allocator
In this context, we can view an operating system as intimately involved with the hardware. A computer system has many resources that may be required to solve a problem: CPU time, memory space, file-storage space, I/O devices, and so on. The operating system acts as the manager of these resources. Facing numerous and possibly conflicting requests for resources, the operating system must decide how to allocate them to specific programs and users so that it can operate the computer system efficiently and fairly
peer-to-peer (P2P)
In this model, clients and servers are not distinguished from one another. Instead, all nodes within the system are considered peers, and each may act as either a client or a server, depending on whether it is requesting or providing a service.
Linked allocation solves the external-fragmentation and size-declaration problems of contiguous allocation. However, in the absence of a FAT, linked allocation cannot support efficient direct access, since the pointers to the blocks are scattered with the blocks themselves all over the disk and must be retrieved in order. ______________________ solves this problem by bringing all the pointers together into one location: __________________.
Index allocation the index block
Caching
Information is normally kept in some storage system (such as main memory). As it is used, it is copied into a faster storage system—the cache—on a temporary basis. When we need a particular piece of information, we first check whether it is in the cache. If it is, we use the information directly from the cache. If it is not, we use the information from the source, putting a copy in the cache under the assumption that we will need it again soon.
A domain is a collection of access rights, each of which is an ordered pair <object-name, rights-set>. For example, if domain D has the access right <file F, {read, write}>, then a process executing in domain D can both read and write file F.
It cannot, however, perform any other operation on that object.
Sun Microsystems (now part of Oracle Corporation) introduced yellow pages (since renamed network information service, or NIS), and most of the industry adopted its use
It centralizes storage of user names, host names, printer information, and the like. Unfortunately, it uses unsecure authentication methods, including sending user passwords unencrypted (in clear text) and identifying hosts by IP address
In what way is an operating system like a government? a.It seldom functions correctly. b. It creates an environment within which other programs can do useful work. c. It performs most useful functions by itself. d. It is always concerned primarily with the individual's needs.
It creates an environment within which other programs can do useful work
firmware (or read-only memory (ROM))
It initializes all aspects of the system, from CPU registers to device controllers to memory contents. The bootstrap program must know how to load the operating system and how to start executing that system. To accomplish this goal, the bootstrap program must locate the operating-system kernel and load it into memory.
Which of the following is true of SSL? Select one: a. It provides security at the data-link layer. b. It is a simple protocol with limited options. c. It is commonly used for secure communication on the Internet. d. It was designed by Microsoft.
It is commonly used for secure communication on the Internet
If the web server ran as a traditional single-threaded process, it would be able to service only one client at a time, and a client might have to wait a very long time for its request to be serviced.
It is generally more efficient to use one process that contains multiple threads. If the web-server process is multithreaded, the server will create a separate thread that listens for client requests. When a request is made, rather than creating another process, the server creates a new thread to service the request and resume listening for additional requests.
Which of the following statements regarding the WAFL file system is incorrect? Select one: a. Clones are similar to snapshots. b. WAFL is used exclusively on networked file servers. c. Part of caching uses non-volatile RAM (NVRAM). d. It provides little replication.
It provides little replication
Intel has had an interesting history of developing 64-bit architectures. Its initial entry was the IA-64 (later named) architecture, but that architecture was not widely adopted. Meanwhile, another chip manufacturer—AMD—began developing a 64-bit architecture known as x86-64 that was based on extending the existing IA-32 instruction set. The x86-64 supported much larger logical and physical address spaces, as well as several other architectural advances.
Itanium
process scheduling queues
Job queue - set of all processes in the system Ready queue - set of all processes residing in main memory, ready and waiting to execute Device queues - set of processes waiting for an I/O device Processes migrate among the various queues
The operating system is responsible for the following activities in connection with memory management
Keeping track of which parts of memory are currently being used and who is using them Deciding which processes (or parts of processes) and data to move into and out of memory Allocating and deallocating memory space as needed
trap (or an exception)
LMAO I can't believe they're actually calling this a trap xDDDD is a software-generated interrupt caused either by an error (for example, division by zero or invalid memory access) or by a specific request from a user program that an operating-system service be performed. The interrupt-driven nature of an operating system defines that system's general structure. For each type of interrupt, separate segments of code in the operating system determine what action should be taken. An interrupt service routine is provided to deal with the interrupt.
As we described them, both SCAN and C-SCAN move the disk arm across the full width of the disk. In practice, neither algorithm is often implemented this way. More commonly, the arm goes only as far as the final request in each direction. Then, it reverses direction immediately, without going all the way to the end of the disk. Versions of SCAN and C-SCAN that follow this pattern are called _______________ and ________________ scheduling, because they look for a request before continuing to move in a given direction
LOOK C-LOOK ** they look for the request before continuing to move in a given direction
_____ is the algorithm implemented on most systems. Select one: a. FIFO b. Least frequently used c. Most frequently used d. LRU
LRU
Properties of communication link for indirect communication
Link established only if processes share a common mailbox A link may be associated with many processes Each pair of processes may share several communication links Link may be unidirectional or bi-directional
________________________ solves all problems of contiguous allocation. With linked allocation, each file is a linked list of disk blocks; the disk blocks may be scattered anywhere on the disk. The directory contains a pointer for the first and last blocks of the file.
Linked allocation
The I/O subsystem coordinates an extensive collection of services that are available to applications and other parts of the kernel. The I/O subsystem supervises these procedures:
Management of the name space for files and devices Access control to files and devices Operation control (for example, a modem cannot seek()) File-system space allocation Device allocation Buffering, caching, and spooling I/O scheduling Device-status monitoring, error handling, and failure recovery Device-driver configuration and initialization Power management if I/O devices
If the index block is too small, however, it will not be able to hold enough pointers for a large file, and a mechanism will have to be available to deal with this issue. Mechanisms for this purpose include the following:
Linked scheme. An index block is normally one disk block. Thus, it can be read and written directly by itself. To allow for large files, we can link together several index blocks. For example, an index block might contain a small header giving the name of the file and a set of the first 100 disk-block addresses. The next address (the last word in the index block) is null (for a small file) or is a pointer to another index block (for a large file). Multilevel index. A variant of linked representation uses a first-level index block to point to a set of second-level index blocks, which in turn point to the file blocks. To access a block, the operating system uses the first-level index to find a second-level index block and then uses that block to find the desired data block. This approach could be continued to a third or fourth level, depending on the desired maximum file size. With 4,096-byte blocks, we could store 1,024 four-byte pointers in an index block. Two levels of indexes allow 1,048,576 data blocks and a file size of up to 4 GB. Combined scheme. Another alternative, used in UNIX-based file systems, is to keep the first, say, 15 pointers of the index block in the file's inode. The first 12 of these pointers point to direct blocks; that is, they contain addresses of blocks that contain data of the file. Thus, the data for small files (of no more than 12 blocks) do not need a separate index block. If the block size is 4 KB, then up to 48 KB of data can be accessed directly. The next three pointers point to indirect blocks. The first points to a single indirect block, which is an index block containing not data but the addresses of blocks that do contain data. The second points to a double indirect block, which contains the address of a block that contains the addresses of blocks that contain pointers to the actual data blocks. The last pointer contains the address of a triple indirect block. (A UNIX inode is shown in Figure 11.9.)Under this method, the number of blocks that can be allocated to a file exceeds the amount of space addressable by the 4-byte file pointers used by many operating systems. A 32-bit file pointer reaches only 232 bytes, or 4 GB. Many UNIX and Linux implementations now support 64-bit file pointers, which allows files and file systems to be several exbibytes in size. The ZFS file system supports 128-bit file pointers.
Properties of communication link for direct communication ...
Links are established automatically A link is associated with exactly one pair of communicating processes Between each pair there exists exactly one link The link may be unidirectional, but is usually bi-directional
The data structures used in the Linux kernel are available in the kernel source code. The include file <linux/list.h> provides details of the linked-list data structure used throughout the kernel. A queue in Linux is known as a kfifo, and its implementation can be found in the kfifo.c file in the kernel directory of the source code.
Linux also provides a balanced binary search tree implementation using red-black trees. Details can be found in the include file <linux/rbtree.h>.
Linux threads
Linux refers to them as tasks rather than threads Thread creation is done through clone() system call clone() allows a child task to share the address space of the parent task (process)
Operating system scheduling examples
Linux scheduling Windows scheduling Solaris scheduling
Common message-digest functions include ____________, now considered insecure, which produces a 128-bit hash, and _____________, which outputs a 160-bit hash. Message digests are useful for detecting changed messages but are not useful as authenticators. For example, H(m) can be sent along with a message; but if H is known, then someone could modify m to m′ and recompute H(m′), and the message modification would not be detected. Therefore, we must authenticate H(m).
MD5 SHA-1
___________________ operating systems are designed primarily to maximize resource utilization a. PC b. Handheld computer c. Mainframe d. Network
Mainframe
Many-to-One multithreading model
Many user-level threads mapped to single kernel thread Examples: Solaris Green Threads GNU Portable Threads
multithreading models
Many-to-One One-to-One Many-to-Many
One important principle of designing an operating system is the separation of policy from mechanism. _____________________ determine how to do something; ___________________ determine what will be done.
Mechanisms policies For example, the timer construct is a mechanism for ensuring CPU protection, but deciding how long the timer is to be set for a particular user is a policy decision
______ allows a portion of a virtual address space to be logically associated with a file. Select one: a. Memory mapping b. Shared memory c. Slab allocation d. Locality of reference
Memory mapping
The SLOB allocator is designed for systems with a limited amount of memory, such as embedded systems. SLOB (which stands for Simple List of Blocks) works by maintaining three lists of objects: small (for objects less than 256 bytes), medium (for objects less than 1,024 bytes), and large (for objects less than 1,024 bytes).
Memory requests are allocated from an object on an appropriately sized list using a first-fit policy.
Standard swapping is not used in modern operating systems. It requires too much swapping time and provides too little execution time to be a reasonable memory-management solution.
Modified versions of swapping, however, are found on many systems, including UNIX, Linux, and Windows. In one common variation, swapping is normally disabled but will start if the amount of free memory (unused memory available for the operating system or processes to use) falls below a threshold amount.
Which of the following is a principle that can improve the efficiency of I/O? Select one: a. Increase the number of context switches. b. Use small data transfers. c. Move processing primitives into hardware. d. Decrease concurrency using DMA controllers.
Move processing primitives into hardware
Recently, many varieties of mobile computers, such as smartphones and tablets, have come into fashion.
Most mobile computers are standalone units for individual users. Quite often, they are connected to networks through cellular or other wireless technologies. Increasingly, these mobile devices are replacing desktop and laptop computers for people who are primarily interested in using computers for e-mail and web browsing. The user interface for mobile computers generally features a touch screen, where the user interacts with the system by pressing and swiping fingers across the screen rather than using a physical keyboard and mouse.
Execution time -- If the process can be moved during its execution from one memory segment to another, then binding must be delayed until run time. Special hardware must be available for this scheme to work, as will be discussed in Section 7.1.3.
Most general-purpose operating systems use this method
user identifiers (user IDs)
Most operating systems maintain a list of user names and associated user identifiers (user IDs)
The NFS specification distinguishes between the services provided by a mount mechanism and the actual remote-file-access services. Accordingly, two separate protocols are specified for these services: a mount protocol and a protocol for remote file accesses, the ____________________. The protocols are specified as sets of RPCs. These RPCs are the building blocks used to implement transparent remote file access.
NFS protocol
Flash memory is slower than DRAM but needs no power to retain its contents. Another form of nonvolatile storage is __________________, which is DRAM with battery backup power. This memory can be as fast as DRAM and (as long as the battery lasts) is nonvolatile
NVRAM
A file's attributes vary from one operating system to another but typically consist of these:
Name. The symbolic file name is the only information kept in human-readable form. Identifier. This unique tag, usually a number, identifies the file within the file system; it is the non-human-readable name for the file. Type. This information is needed for systems that support different types of files. Location. This information is a pointer to a device and to the location of the file on that device. Size. The current size of the file (in bytes, words, or blocks) and possibly the maximum allowed size are included in this attribute. Protection. Access-control information determines who can do reading, writing, executing, and so on. Time, date, and user identification. This information may be kept for creation, last modification, and last use. These data can be useful for protection, security, and usage monitoring.
____ layer security generally has been standardized on IPSec. Select one: a. Network b. Transport c. Data-link d. Application
Network
Memory protection in a paged environment is accomplished by protection bits associated with each frame.
Normally, these bits are kept in the page table.
example of shortest-remaining-time-first
Now we add the concepts of varying arrival times and preemption to the analysis Preemptive SJF Gantt Chart P1 (0 to 1) P2 (1 to 5) P4 (5 to 10) P1 (10 to 17) P3 (17 to 26) Average waiting time [(10-1) + (1-1) + (17-2) + 5 - 3)] / 4 = 26/4 = 6.5 ... essentially taking all of the burst times added together and dividing by the number of processes...
single-processor system
On a single-processor system, there is one main CPU capable of executing a general-purpose instruction set, including instructions from user processes. Almost all single-processor systems have other special-purpose processors as well. They may come in the form of device-specific processors, such as disk, keyboard, and graphics controllers; or, on mainframes, they may come in the form of more general-purpose processors, such as I/O processors that move data rapidly among the components of the system.
Program loading and execution system programs
Once a program is assembled or compiled, it must be loaded into memory to be executed. The system may provide absolute loaders, relocatable loaders, linkage editors, and overlay loaders. Debugging systems for either higher-level languages or machine language are needed as well.
The mean time to failure of a mirrored volume--where failure is the loss of data -- depends on two factors. What are they?
One is the mean time to failure of the individual disk The other is the mean time to repair, which is the time it takes (on average) to replace a failed disk and to restore data on it. Suppose that the failures of two disks are independent; that is, the failure of one disk is not connected to the failure of the other. Then, if the mean time to failure of a single disk is 100,000 hours and the mean time to repair is 10 hours, the mean time to data loss of a mirrored disk system is 100, 0002/(2 * 10) = 500 * 106 hours, or 57,000 years!
Which of the following statements is incorrect? Select one: a. An operating system provides an environment for the execution of programs. b. An operating system manages system resources. c. Operating systems provide both command line as well as graphical user interfaces. d. Operating systems must provide both protection and security.
Operating systems provide both command line as well as graphical user interfaces
Which of the following statements is true? Select one: a. Operations on atomic integers do not require locking. b. Operations on atomic integers do require additional locking. c. Linux only provides the atomic_inc() and atomic_sub() operations. d. Operations on atomic integers can be interrupted.
Operations on atomic integers do not require locking
In other cases, a user sits at a terminal connected to a mainframe or a minicomputer
Other users are accessing the same computer through other terminals. These users share resources and may exchange information. The operating system in such cases is designed to maximize resource utilization--to assure that all available CPU time, memory, and I/O are used efficiently and that no individual user takes more than her fair share
To condense the length of the access-control list, many systems recognize three classifications of users in connections with each file:
Owner -- the user who created the file is the owner Group -- the set of users who are sharing the file and need similar access is a group, or work group Universe -- All other users in the system constitute the universe
indirect communication and mailbox sharing
P1, P2, and P3 share mailbox A P1, sends; P2 and P3 receive Who gets the message? Solutions: Allow a link to be associated with at most two processes Allow only one process at a time to execute a receive operation Allow the system to select arbitrarily the receiver. Sender is notified who the receiver was
page replacement
Page replacement takes the following approach. If no frame is free, we find one that is not currently being used and free it. We can free a frame by writing its contents to swap space and changing the page table (and all other tables) to indicate that the page is no longer in memory (Figure 8.10). We can now use the freed frame to hold the page for which the process faulted.
The hardware to support demand paging is the same as the hardware for paging and swapping:
Page table Secondary memory
_______________________ in NFS involves the parsing of path name such as /usr/local/dir1/file.txt into separate directory entries, or components: (1) usr, (2) local, and (3) dir1
Path-name translation Path-name translation is done by breaking the path into component names and performing a separate NFS lookup call for every pair of component name and directory vnode. Once a mount point is crossed every component lookup causes a separate RPC to the server
_____ is/are not a technique for managing critical sections in operating systems. Select one: a. Peterson's solution b. Preemptive kernel c. Non-preemptive kernel d. Semaphores
Peterson's solution
It is the job of ________________ to defend a system from external and internal attacks. Such attacks spread across a huge range and include viruses and worms, denial-of-service attacks (which use all of a system's resources and so keep legitimate users out of the system), identity theft, and theft of service (unauthorized use of a system).
Prevention of some of these attacks is considered an operating-system function on some systems, while other systems leave it to policy or additional software. Due to the alarming rise in security incidents, operating-system security features represent a fast-growing area of research and implementation.
Linux scheduling through version 2.5
Prior to kernel version 2.5, ran variation of standard UNIX scheduling algorithm Version 2.5 moved to constant order O(1) scheduling time - Preemptive, priority based - Two priority ranges: time-sharing and real-time - Real-time range from 0 to 99 and nice value from 100 to 140 - Map info global priority with numerically lower values indicating higher priority - Higher priority gets larger q - Task run-able as long as time left in time slice (active) - If no time left (expired), not run-able until all other tasks use their slices - All run-able tasks tracked in per-CPU runqueue data structure (Two priority arrays (active, expired); tasks indexed by priority; when no more active, arrays are exchanged) * Worked well, but poor response times for interactive processes
The requirement that instructions must be in physical memory to be executed seems both necessary and reasonable; but it is also unfortunate, since it limits the size of a program to the size of physical memory. In fact, an examination of real programs shows us that, in many cases, the entire program is not needed. For instance, consider the following:
Programs often have code to handle unusual error conditions. Since these errors seldom, if ever, occur in practice, this code is almost never executed. Arrays, lists, and tables are often allocated more memory than they actually need. An array may be declared 100 by 100 elements, even though it is seldom larger than 10 by 10 elements. An assembler symbol table may have room for 3,000 symbols, although the average program has less than 200 symbols. Certain options and features of a program may be used rarely. For instance, the routines on U.S. government computers that balance the budget have not been used in many years.
There are actually many types of cloud computing, including the following:
Public cloud—a cloud available via the Internet to anyone willing to pay for the services Private cloud—a cloud run by a company for that company's own use Hybrid cloud—a cloud that includes both public and private cloud components Software as a service (SaaS)—one or more applications (such as word processors or spreadsheets) available via the Internet Platform as a service (PaaS)—a software stack ready for application use via the Internet (for example, a database server) Infrastructure as a service (IaaS)—servers or storage available over the Internet (for example, storage available for making backup copies of production data)
RAID level 1
RAID level 1 refers to disk mirroring
RAID levels 0 + 1 and 1 + 0
RAID level 0 + 1 refers to a combination of RAID levels 0 and 1. RAID 0 provides the performance, while RAID 1 provides the reliability. Generally, this level provides better performance than RAID 5. It is common in environments where both performance and reliability are important. Unfortunately, like RAID 1, it doubles the number of disks needed for storage, so it is also relatively expensive. In RAID 0 + 1, a set of disks are striped, and then the stripe is mirrored to another, equivalent stripe.
RAID level 0
RAID level 0 refers to disk arrays with striping at the level of blocks but without any redundancy (such as mirroring or parity bits)
RAID level 2
RAID level 2 is also known as memory-style error-correcting-code (ECC) organization. Memory systems have long detected certain errors by using parity bits. Each byte in a memory system may have a parity bit associated with it that records whether the number of bits in the byte set to 1 is even (parity = 0) or odd (parity = 1). If one of the bits in the byte is damaged (either a 1 becomes a 0, or a 0 becomes a 1), the parity of the byte changes and thus does not match the stored parity.
RAID level 3
RAID level 3, or bit-interleaved parity organization, improves on level 2 by taking into account the fact that, unlike memory systems, disk controllers can detect whether a sector has been read correctly, so a single parity bit can be used for error correction as well as for detection. The idea is as follows: If one of the sectors is damaged, we know exactly which sector it is, and we can figure out whether any bit in the sector is a 1 or a 0 by computing the parity of the corresponding bits from sectors in the other disks.
RAID level 4
RAID level 4, or block-interleaved parity organization, uses block-level striping, as in RAID 0, and in addition keeps a parity block on a separate disk for corresponding blocks from N other disks
RAID level 5
RAID level 5, or block-interleaved distributed parity, differs from level 4 in that it spreads data and parity among all N + 1 disks, rather than storing data in N disks and parity in one disk. For each block, one of the disks stores the parity and the others store data. For example, with an array of five disks, the parity for the nth block is stored in disk (n mod 5)+1. The nth blocks of the other four disks store actual data for that block
Mirroring provides high reliability, but it is expensive. Striping provides high data-transfer rates, but it does not improve reliability. Numerous schemes to provide redundancy at lower cost by using disk striping combined with "parity" bits (which we describe shortly) have been proposed. These schemes have different cost-performance trade-offs and are classified according to levels called ______________________.
RAID levels there are essentially 7 different RAID levels
__________ is perhaps the most common stream cipher.
RC4
____________________ is a symmetric stream cipher
RC4
As an example of how public-key encryption works, we describe an algorithm known as __________, after its inventors, Rivest, Shamir, and Adleman. RSA is the most widely used asymmetric encryption algorithm. (Asymmetric algorithms based on elliptic curves are gaining ground, however, because the key length of such an algorithm can be shorter for the same amount of cryptographic strength.)
RSA
____ I/O accesses a block device as a simple array of blocks. Select one: a. Raw b. Stream c. Indirect d. Cooked
Raw
_________________ is used where no file system is appropriate. UNIX swap space can use a raw partition, for example, since it uses its own format on disk and does not use a file system. Likewise, some databases use raw disk and format the data to suit their needs. Raw disk can also hold information needed by disk RAID systems, such as bit maps indicating which blocks are mirrored and which have changed and need to be mirrored. Similarly, raw disk can contain a miniature database holding RAID configuration information, such as which disks are members of each RAID set.
Raw data
Schemes that implement revocation for capabilities include the following:
Reacquisition Back-pointers Indirection Keys
Protection mechanisms provide controlled access by limiting the types of file access that can be made. Access is permitted or denied depending on several factors, one of which is the type of access requested. Several types of operations may be controlled:
Read Write Execute Append Delete List
Cooperating process can affect or be affected by other processes, including sharing data
Reasons for cooperating processes - information sharing - computation speedup - modularity - convenience
We can employ several principles to improve the efficiency of I/O:
Reduce the number of context switches. Reduce the number of times that data must be copied in memory while passing between device and application. Reduce the frequency of interrupts by using large transfers, smart controllers, and polling (if busy waiting can be minimized). Increase concurrency by using DMA-knowledgeable controllers or channels to offload simple data copying from the CPU. Move processing primitives into hardware, to allow their operation in device controllers to be concurrent with CPU and bus operation. Balance CPU, memory subsystem, bus, and I/O performance, because an overload in any one area will cause idleness in others.
remote method invocation
Remote Method Invocation (RMI) is a Java mechanism similar to RPCs RMI allows a Java program on one machine to invoke a method on a remote object java program <-remote method invocation->remote object
In the ________________________________, the disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues. The head continuously scans back and forth across the disk. The SCAN algorithm is sometimes called the _________________ algorithm, since the disk arm behaves just like an elevator in a building, first servicing all the requests going up and then reversing to service requests the other way.
SCAN algorithm elevator
Because SSDs can be much faster than hard disk drives, standard bus interfaces can cause a major limit on throughput. Some SSDs are designed to connect directly to the system bus (PCI, for example). SSDs are changing other traditional aspects of computer design as well. Some systems use them as a direct replacement for disk drives, while others use them as a new cache tier, moving data between hard disks, SSDs, and memory to optimize performance.
SSDs have the same characteristics as traditional hard disks but can be more reliable because they have no moving parts and faster because they have no seek time or latency. In addition, they consume less power. However, they are more expensive per megabyte than traditional hard disks, have less capacity than the larger hard disks, and may have shorter life spans than hard disks, so their uses are somewhat limited.
UNIX System V has an interesting mechanism, called _____________________, that enables an application to assemble pipelines of driver code dynamically. A stream is a full-duplex connection between a device driver and a user-level process.
STREAMS
To illustrate, consider a person, Sara, who is writing a new book. She has hired three graduate students (Jim, Dawn, and Jill) to help with the project. The text of the book is kept in a file named book.tex. The protection associated with this file is as follows:
Sara should be able to invoke all operations on the file. Jim, Dawn, and Jill should be able only to read and write the file; they should not be allowed to delete the file. All other users should be able to read, but not write, the file. (Sara is interested in letting as many people as possible read the text so that she can obtain feedback.)
The Solaris operating system structure is organized around a core kernel with seven types of loadable kernel modules:
Scheduling classes File systems Loadable system calls Executable formats STREAMS modules Miscellaneous Device and bus drivers
The operating system is responsible for the following activities in connection with process management:
Scheduling processes and threads on the CPUs Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication
When considering a particular directory structure, we need to keep in mind the operations that are to be performed in a directory
Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
_____ is not one of the major categories of system calls. Select one: a. Process control b. Communications c. Protection d. Security
Security
What are the relative merits of enforcement based solely on a kernel, as opposed to enforcement provided largely by a compiler?
Security Flexibility Efficiency
NFS views a set of interconnected workstations as a set of independent machines with independent file systems. The goal is to allow some degree of sharing among these file systems (on explicit request) in a transparent manner.
Sharing is based on a client-server relationship. A machine may be, and often is, both a client and a server. Sharing is allowed between any pair of machines. To ensure machine independence, sharing of a remote file system affects only the client machine and no other machine.
Two-level multithreading model
Similar to M:M, except it allows a user thread to be bound to kernel thread examples: IRIX HU-UX Tru64 UNIX Solaris 8 and earlier
job pool
Since, in general, main memory is too small to accommodate all jobs, the jobs are kept initially on the disk in the __________________. This pool consists of all processing residing on disk awaiting allocation of main memory.
In the upper-right portion of the figure, four disks are connected together on a _________________________________ bus plugged into a SCSI controller. Other common buses used to interconnect main parts of a computer include _____________________, with throughput of up to 16 GB per second, and __________________, and throughput of up to 25 GB per second
Small Computer System Interface (SCSI) PCI Express (PCIe) HyperTransport
On most computer systems, a small piece of code known as the BOOTSTRAP PROGRAM or BOOTSTRAP LOADER locates the kernel loads it into main memory, and starts its execution
Some computer systems, such as PCs, use a two-step process in which a simple bootstrap loader fetches a more complex boot program from disk, which in turn loads the kernel
utility storage
Some file systems do not expand or shrink. On these systems, the original size is the only size, and any change requires copying data. An administrator can configure InServ to provide a host with a large amount of logical storage that initially occupies only a small amount of physical storage. As the host starts using the storage, unused disks are allocated to the host, up to the original logical level. The host thus can believe that it has a large fixed storage space, create its file systems there, and so on. Disks can be added or removed from the file system by InServ without the file system's noticing the change. This feature can reduce the number of drives needed by hosts, or at least delay the purchase of disks until they are really needed.
command interpreter
Some operating systems include the command interpreter in the kernel. Others, such as Windows and UNIX, treat the command interpreter as a special program that is running when a job is initiated or when a user first logs on (on interactive systems). On systems with multiple command interpreters to choose from, the interpreters are known as shells. For example, on UNIX and Linux systems, a user may choose among several different shells, including the Bourne shell, C shell, Bourne-Again shell, Korn shell, and others. Third-party shells and free user-written shells are also available. Most shells provide similar functionality, and a user's choice of which shell to use is generally based on personal preference. The main function of the command interpreter is to get and execute the next user-specified command. Many of the commands given at this level manipulate files: create, delete, list, print, copy, execute, and so on
Status information system programs
Some programs simply ask the system for the date, time, amount of available memory or disk space, number of users, or similar status information. Others are more complex, providing detailed performance, logging, and debugging information. Typically, these programs format and print the output to the terminal or other output devices or files or display it in a window of the GUI. Some systems also support a registry, which is used to store and retrieve configuration information.
The use of relative block numbers allows the operating system to decide where the file should be placed (called the allocation problem) and helps to prevent the user from accessing portions of the file system that may not be part of her file
Some systems start their relative block numbers at 0, others start at 1
Which of the following statements concerning open source operating systems is true? Select one: a. Solaris is open source. b. Source code is freely available. c. They are always more secure than commercial, closed systems. d. All open source operating systems share the same set of goals.
Source code is freely available
The difference between symmetric and asymmetric multiprocessing may result from either hardware or software
Special hardware can differentiate the multiple processors, or the software can be written to allow only one boss and multiple workers. For instance, Sun Microsystems' operating system SunOS Version 4 provided asymmetric multiprocessing, whereas Version 5 (Solaris) is symmetric on the same hardware
The ________ provides a portion of the system call interface for UNIX and Linux. Select one: a. POSIX b. Java c. Standard C library d. Standard API
Standard C library
__________________________________ is another low-level task of the operating system. Virtual memory uses disk space as an extension of main memory. Since disk access is much slower than memory access, using swap space significantly decreases system performance. The main goal for the design and implementation of swap space is to provide the best throughput for the virtual memory system. In this section, we discuss how swap space is used, where swap space is located on disk, and how swap space is managed.
Swap-space management
In addition to separating logical memory from physical memory, virtual memory allows files and memory to be shared by two or more processes by page sharing. This leads to the following benefits:
System libraries can be shared by several processes through mapping of the shared object into a virtual address space. Although each process considers the libraries to be part of its virtual address space, the actual pages where the libraries reside in physical memory are shared by all the processes (Figure 8.3). Typically, a library is mapped read-only into the space of each process that is linked with it. Similarly, processes can share memory. Recall from Chapter 3 that two or more processes can communicate through the use of shared memory. Virtual memory allows one process to create a region of memory that it can share with another process. Processes sharing this region consider it part of their virtual address space, yet the actual physical pages of memory are shared, much as is illustrated in Figure 8.3. Pages can be shared during process creation with the fork() system call, thus speeding up process creation.
If the page number is not in the TLB (known as a ___________________), a memory reference to the page table must be made
TLB miss
The ____ is the number of entries in the TLB multiplied by the page size. Select one: a. TLB cache b. page resolution c. TLB reach d. hit ratio
TLB reach
Related to the hit ratio is a similar metric: the _________________.
TLB reach The TLB reach refers to the amount of memory accessible from the TLB and is simply the number of entries multiplied by the page size. Ideally, the working set for a process is stored in the TLB. If it is not, the process will spend a considerable amount of time resolving memory references in the page table rather than the TLB. If we double the number of entries in the TLB, we double the TLB reach. However, for some memory-intensive applications, this may still prove insufficient for storing the working set.
Virtual-to-physical translation would take too long if each address required searching through a hash table, so the CPU implements a TLB that holds translation table entries (TTEs) for fast hardware lookups. A cache of these TTEs reside in a translation storage buffer (TSB), which includes an entry per recently accessed page. When a virtual address reference occurs, the hardware searches the TLB for a translation. If none is found, the hardware walks through the in-memory TSB looking for the TTE that corresponds to the virtual address that caused the lookup. This __________________ functionality is found on many modern CPUs.
TLB walk
Android
The Android operating system was designed by the Open Handset Alliance (led primarily by Google) and was developed for Android smartphones and tablet computers. Whereas iOS is designed to run on Apple mobile devices and is close-sourced, Android runs on a variety of mobile platforms and is open-sourced, partly explaining its rapid rise in popularity.
The TLB is used with page tables in the following way:
The TLB contains only a few of the page-table entries. When a logical address is generated by the CPU, its page number is presented to the TLB. If the page number is found, its frame number is immediately available and is used to access memory. As just mentioned, these steps are executed as part of the instruction pipeline within the CPU, adding no performance penalty compared with a system that does not implement paging.
How does the hash page tables algorithm work?
The algorithm works as follows: The virtual page number in the virtual address is hashed into the hash table. The virtual page number is compared with field 1 in the first element in the linked list. If there is a match, the corresponding page frame (field 2) is used to form the desired physical address. If there is no match, subsequent entries in the linked list are searched for a matching virtual page number
Server systems can be broadly categorized as compute servers and file servers:
The compute-server system ---- provides an interface to which a client can send a request to perform an action (for example, read data). In response, the server executes the action and sends the results to the client. A server running a database that responds to client requests for data is an example of such a system. The file-server system ---- provides a file-system interface where clients can create, update, read, and delete files. An example of such a system is a web server that delivers files to clients running web browsers.
An I/O port typically consists of four registers, called the status, control, data-in, and data-out registers
The data-in register is ready by the host to get input The data-out register is written by the host to send output The status register contains bits that can be read by the host. These bits indicate states, such as whether the current command has completed, whether a byte is available to be read from the data-in register, and whether a device error has occurred The control register can be written by the host to start a command or to change the mode of a device. For instance, a certain bit in the control register of a serial port chooses between full-duplex and half-duplex communication, another bit enables parity checking, a third bit sets the word length to 7 or 8 bits, and other bits select one of the speeds supported by the serial port.
Which of the following statements is false? Select one: a. Mobile devices must be concerned with power consumption. b. Mobile devices can provide features that are unavailable on desktop or laptop computers. c. The difference in storage capacity between a mobile device and laptop is shrinking. d. Mobile devices usually have fewer processing cores than a standard desktop computer.
The difference in storage capacity between a mobile device and laptop is shrinking
What are dump files used for?
The dump is written to disk and may be examined by a debugger—a system program designed to aid the programmer in finding and correcting errors, or bugs—to determine the cause of the problem.
Which of the following is true of a blocking system call? Select one: a. The application continues to execute its code when the call is issued. b. The call returns immediately without waiting for the I/O to complete. c. The execution of the application is suspended when the call is issued. d. Blocking application code is harder to understand than non-blocking application code.
The execution of the application is suspended when the call is issued
Which of the following is a key property of an immutable file? Select one: a. The file name may not be reused. b. The contents of the file may be altered. c. It is difficult to implement in a distributed system. d. The file name may be reused.
The file name may not be reused
File-system manipulation
The file system is of particular interest. Obviously, programs need to read and write files and directories. They also need to create and delete them by name, search for a given file, and list file information. Finally, some operating systems include permissions management to allow or deny access to files or directories based on file ownership. Many operating systems provide a variety of file systems, sometimes to allow personal choice and sometimes to provide specific features or performance characteristics.
Main memory can be viewed as a fast cache for secondary storage, since data in secondary storage must be copied into main memory for use and data must be in main memory before being moved to secondary storage for safekeeping.
The file-system data, which resides permanently on secondary storage, may appear on several levels in the storage hierarchy.
When a CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location.
The fixed location usually contains the starting address where the service routine for the interrupt is located
One solution to the the problem of external fragmentation is compaction. How does compaction work?
The goal is to shuffle the memory contents so as to place all free memory together in one large block. Compaction is not always possible, however. If relocation is static and is done at assembly or load time, compaction cannot be done. It is possible only if relocation is dynamic and is done at execution time.
Another data structure used for a file directory is a hash table. Here, a linear list stores the directory entries, but a hash data structure is also used
The hash tables takes a value computed from the file name and returns a pointer to the file name in the linear list Therefore, it can greatly decrease the directory search time. Insertion and deletion are also fairly straightforward, although some provision must be made for collisions -- situations in which two file names hash to the same location
To perform a disk I/O operation, the computer places a command into the host controller, typically using memory-mapped I/O ports.
The host controller then sends the command via messages to the disk controller, and the disk controller operates the disk-drive hardware to carry out the command. Disk controllers usually have a built-in cache. Data transfer at the disk drive happens between the cache and the disk surface, and data transfer to the host, at fast electronic speeds, occurs between the cache and the host controller.
Let's briefly review the VFS architecture in Linux. The four main object types defined by the Linux VFS are:
The inode object, which represents an individual file The file object, which represents an open file The superblock object, which represents an entire file system The dentry object, which represents an individual directory entry
Magnetic tape drives and their tapes and CD and DVD drives and platters are typical tertiary storage devices
The media (tapes and optical platters) vary between WORM (write-once, read-many-times) and RW (read-write) formats.
The Linux operating system is written mostly in C and is available natively on a number of different CPUs, including Intel x86, Oracle SPARC, and IBM PowerPC.
The only possible disadvantages of implementing an operating system in a higher-level language are reduced speed and increased storage requirements
To make the computer system convenient for users, the operating system provides a uniform, logical view of information storage. The operating system abstracts from the physical properties of its storage devices to define a logical storage unit, the file.
The operating system maps file onto physical media and accesses these files via the storage device
A typical bad-sector transaction might be as follows:
The operating system tries to read logical block 87 The controller calculates the ECC and finds that the sector is bad. It reports this finding to the operating system. The next time the system is rebooted, a special command is run to tell the controller to replace the bad sector with a spare After that, whenever the system requests logical block 87, the request is translated into the replacement sector's address by the controller.
Protection and security
The owners of information stored in a multiuser or networked computer system may want to control use of that information. When several separate processes execute concurrently, it should not be possible for one process to interfere with the others or with the operating system itself. Protection involves ensuring that all access to system resources is controlled. Security of the system from outsiders is also important. Such security starts with requiring each user to authenticate himself or herself to the system, usually by means of a password, to gain access to system resources. It extends to defending external I/O devices, including network adapters, from invalid access attempts and to recording all such connections for detection of break-ins. If a system is to be protected and secure, precautions must be instituted throughout it. A chain is only as strong as its weakest link.
Some systems maintain a separate section of main memory for a buffer cache, where blocks are kept under the assumption that they will be used again shortly. Other systems cache file data using a page cache.
The page cache uses virtual memory techniques to cache file data as pages rather than as file-system-oriented blocks. Caching file data using virtual addresses is far more efficient than caching through physical disk blocks, as accesses interface with virtual memory rather than the file system.
One benefit of the microkernel approach is that it makes extending the operating system easier. All new services are added to user space and consequently do not require modification of the kernel. When the kernel does have to be modified, the changes tend to be fewer, because the microkernel is a smaller kernel.
The resulting operating system is easier to port from one hardware design to another. The microkernel also provides more security and reliability, since most services are running as user—rather than kernel—processes. If a service fails, the rest of the operating system remains untouched.
file session
The series of accesses between the open() and close() operations makes up a file sessions
Which of the following statements is false with regard to Solaris memory management? Select one: a. The speed at which pages are examined (the scan rate) is constant. b. The page out process only runs if the number of free pages is less than lotsfree. c. An LRU approximation algorithm is employed. d. Pages selected for replacement may be reclaimed before being placed on the free list.
The speed at which pages are examined (the scan rate) is constant
Program execution
The system must be able to load a program into memory and to run that program. The program must be able to end its execution, either normally or abnormally (indicating error).
Intrusion detection encompasses a wide array of techniques that vary on a number of axes, including the following:
The time at which detection occurs. Detection can occur in real time (while the intrusion is occurring) or after the fact. The types of inputs examined to detect intrusive activity. These may include user-shell commands, process system calls, and network packet headers or contents. Some forms of intrusion might be detected only by correlating information from several such sources. The range of response capabilities. Simple forms of response include alerting an administrator to the potential intrusion or somehow halting the potentially intrusive activity—for example, killing a process engaged in such activity. In a sophisticated form of response, a system might transparently divert an intruder's activity to a honeypot—a false resource exposed to the attacker. The resource appears real to the attacker and enables the system to monitor and gain information about the attack.
The Apple Mac OS X operating system uses a hybrid structure
The top layers include the Aqua user interface (Figure 2.4) and a set of application environments and services. Notably, the Cocoa environment specifies an API for the Objective-C programming language, which is used for writing Mac OS X applications. Below these layers is the kernel environment, which consists primarily of the Mach microkernel and the BSD UNIX kernel. Mach provides memory management; support for remote procedure calls (RPCs) and interprocess communication (IPC) facilities, including message passing; and thread scheduling. The BSD component provides a BSD command-line interface, support for networking and file systems, and an implementation of POSIX APIs, including Pthreads. In addition to Mach and BSD, the kernel environment provides an I/O kit for development of device drivers and dynamically loadable modules (which Mac OS X refers to as kernel extensions).
truncating a file
The user may want to erase the contents of a file but keep its attributes. Rather than forcing the user to delete the file and then recreate it, this function allows all attributes to remain unchanged—except for file length—but lets the file be reset to length zero and its file space released.
Communications
There are many circumstances in which one process needs to exchange information with another process. Such communication may occur between processes that are executing on the same computer or between processes that are executing on different computer systems tied together by a computer network. Communications may be implemented via shared memory, in which two or more processes read and write to a shared section of memory, or message passing, in which packets of information in predefined formats are moved between processes by the operating system.
Which of the following is considered a benefit when using the slab allocator? Select one: a. Memory is allocated using a simple power-of-2 allocator. b. It allows kernel code and data to be efficiently paged. c. It allows larger segments to be combined using coalescing. d. There is no memory fragmentation.
There is no memory in fragmentation
Embedded computers are the most prevalent form of computers in existence.
These devices are found everywhere, from car engines and manufacturing robots to DVDs and microwave ovens. They tend to have very specific tasks.
The CPU fetches instructions from memory according to the value of the program counter.
These instructions may cause additional loading from and storing to specific memory addresses
File management system programs
These programs create, delete, copy, rename, print, dump, list, and generally manipulate files and directories.
Communications system programs
These programs provide the mechanism for creating virtual connections among processes, users, and computer systems. They allow users to send messages to one another's screens, to browse Web pages, to send e-mail messages, to log in remotely, or to transfer files from one machine to another.
In other cases, users sit at workstations connected to networks of other workstations and servers.
These users have dedicated resources at their disposal, but they also share resources such as networking and servers, including file, compute, and print servers. Therefore, their operating system is designed to comprise between individual usability and resource utilization
Which of the following statements is true with respect to hashed page tables? Select one: a. They only work for sparse address spaces. b. The virtual address is used to hash into the hash table. c. They are a common approach for handling address spaces larger than 32 bits. d. Hash table collisions do not occur because of the importance of paging.
They are a common approach for handling address spaces larger than 32 bits
It would be useful to know exactly how much memory a user process is using, not simply how much it might be using. Then we would need to swap only what is actually used, reducing swap time. For this method to be effective, the user must keep the system informed of any changes in memory requirements.
Thus, a process with dynamic memory requirements will need to issue system calls (request_memory() and release_memory()) to inform the operating system of its changing memory needs
reading a file
To read from a file, we use a system call that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated entry, and the system needs to keep a read pointer to the location in the file where the next read is to take place. Once the read has taken place, the read pointer is updated. Because a process is usually either reading from or writing to a file, the current operation location can be kept as a per-process current-file-position pointer. Both the read and write operations use this same pointer, saving space and reducing system complexity.
We first need to make sure that each process has a separate memory space. Separate per-process memory space protects the processes from each other and is fundamental to having multiple processes loaded in memory for concurrent execution.
To separate memory spaces, we need the ability to determine the range of legal addresses that the process may access and to ensure that the process can access only these legal addresses. We can provide protection by using two registers, usually a base and a limit
The SSL protocol is initiated by a client c to communicate securely with a server. Prior to the protocol's use, the server s is assumed to have obtained a certificate, denoted cert_s, from certification authority CA. This certificate is a structure containing the following:
Various attributes (attrs) of the server, such as its unique distinguished name and its common (DNS) name The identity of a asymmetric encryption algorithm E() for the server The public key k_e of this server A validity interval (interval) during which the certificate should be considered valid A digital signature a on the above information made by the CA--that is, a = S_kCA(<atts, E_ke, interval>)
Quite often, shared memory is in fact implemented by memory mapping files. Under this scenario, processes can communicate using shared memory by having the communicating processes memory-map the same file into their virtual address spaces.
We have already seen this in Section 3.4.1, where a POSIX shared memory object is created and each communicating process memory-maps the object into its address space. In the following section, we illustrate support in the Windows API for shared memory using memory-mapped files.
If we create a new job or process, or perhaps even a set of jobs or processes, we should be able to control its execution. This control requires the ability to determine and reset the attributes of a job or process, including the job's priority, its maximum allowable execution time, and so on (get_process_attributes() and set_process_attributes()).
We may also want to terminate a job or process that we created (terminate_process()) if we find that it is incorrect or is no longer needed.
Accounting
We want to keep track of which users use how much and what kinds of computer resources. This record keeping may be used for accounting (so that users can be billed) or simply for accumulating usage statistics. Usage statistics may be a valuable tool for researchers who wish to reconfigure the system to improve computing services.
Each inverted page-table entry is a pair <process-id, page-number> where the process-id assumes the role of the address-space identifier.
When a memory reference occurs, part of the virtual address, consisting of <process-id, pagenumber>, is presented to the memory subsystem. The inverted page table is then searched for a match. If a match is found—say, at entry i—then the physical address <i, offset> is generated. If no match is found, then an illegal address access has been attempted.
The operating system is normally distributed on disk, on CD-ROM or DVD-ROM, or as an "ISO" image, which is a file in the format of a CD-ROM or DVD-ROM. To generate a system, we use a special program. This SYSGEN program reads from a given file, or asks the operator of the system for information concerning the specific configuration of the hardware system, or probes the hardware directly to determine what components are there. The following kinds of information must be determined:
What CPU is to be used? What options (extended instruction sets, floating-point arithmetic, and so on) are installed? For multiple CPU systems, each CPU may be described. How will the boot disk be formatted? How many sections, or "partitions," will it be separated into, and what will go into each partition? How much memory is available? Some systems will determine this value themselves by referencing memory location after memory location until an "illegal address" fault is generated. This procedure defines the final legal address and hence the amount of available memory. What devices are available? The system will need to know how to address each device (the device number), the device interrupt number, the device's type and model, and any special device characteristics. What operating-system options are desired, or what parameter values are to be used? These options or values might include how many buffers of which sizes should be used, what type of CPU-scheduling algorithm is desired, what the maximum number of processes to be supported is, and so on.
Typically RPC servers are multithreaded
When a server receives a message, it services the message using a separate thread. This allows the server to service several concurrent requests.
The Linux CPS scheduler provides an efficient algorithm for selecting which task to run next. Each runnable task is placed in a red-black tree -- a balanced binary search tree whose key is based on the value of vruntime.
When a task becomes runnable, it is added to the tree. If a task on the tree is not runnable (for example, if it is blocked while waiting for I/O), it is removed. Generally speaking, tasks that have been given less processing time (smaller values of vruntime) are toward the left side of the tree, and tasks that have been given more processing time are on the right side.
Resource allocation
When there are multiple users or multiple jobs running at the same time, resources must be allocated to each of them. The operating system manages many different types of resources. Some (such as CPU cycles, main memory, and file storage) may have special allocation code, whereas others (such as I/O devices) may have much more general request and release code. For instance, in determining how best to use the CPU, operating systems have CPU-scheduling routines that take into account the speed of the CPU, the jobs that must be executed, the number of registers available, and other factors. There may also be routines to allocate printers, USB storage drives, and other peripheral devices.
Whenever a process needs I/O to or from the disk, it issues a system call to the operating system. The request specifies several pieces of information
Whether this operation is input or output What the disk address for the transfer is What the memory address for the transfer is What the number of sectors to be transferred is
The UNIX file system uses the following consistency semantics:
Writes to an open file by a user are visible immediately to other users who have this file open. One mode of sharing allows users to share the pointer of current location into the file. Thus, the advancing of the pointer by one user affects all sharing users. Here, a file has a single image that interleaves all accesses, regardless of their origin.
Most systems allow a user process to reside in any part of the physical memory. Thus, although the address for the computer may start at 00000, the first address of the user process need not be 00000.
You will see later how a user program actually places a process in physical memory
Oracle's _____________________ (found in Solaris and other operating systems) was designed to encompass huge numbers of files, directories, and even file systems (in ZFS, we can create file-system hierarchies). On these scales, metadata I/O can have a large performance impact. Consider, for example, that if the free-space list is implemented as a bit map, bit maps must be modified both when blocks are allocated and when they are freed. Freeing 1 GB of data on a 1-TB disk could cause thousands of blocks of bit maps to be updated, because those data blocks could be scattered over the entire disk. Clearly, the data structures for such a system could be large and inefficient.
ZFS file system
examples of exponential averaging
a = 0 - t_(n+1) = t_n - recent history does not count a = 1 - t_(n+1) = a * t_n - only the actual last CPU burst counts If we expand the formula, we get: t_(n+1) = a*t_n + (1 - a) * t_(n-1) + ... + (1 - a)^j * a * t_(n-j) + ... + (1 - a)^(n+1) * t_0 Since both a and (1 - a) are less than or equal to 1, each successive term has less weight than its predecessor
A code segment that misuses its environment is called ____. Select one: a. a backdoor b. a trap door c. a worm d. a Trojan horse
a Trojan horse
dynamic random-access memory (DRAM)
a semiconductor technology that implements main memory
A failure of a SCSI device is reported by the SCSI protocol in three levels of detail:
a sense key that identifies this general nature of the failure, such as a hardware error or an illegal request an additional sense code that states the category of failure, such as a bad command parameter or a self-test failure and an additional sense-code qualifier that gives even more detail, such as which command parameter was in error or which hardware subsystem failed its self-test
Mobile operating systems often include not only a core kernel but also middleware. What is middleware?
a set of software frameworks that provide additional services to application developers. For example, each of the two most prominent mobile operating systems-- Apple's iOS and Google's Android-- features a core kernel along with middleware that supports databases, multimedia, and graphics (to name only a few)
sockets
a socket is defined as an endpoint for communication concatenation of IP address and port The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8 Communication consists between a pair of sockets (for example, a host socket and a web server socket)
Pthreads refers to ____. Select one: a. the POSIX standard b. an implementation for thread behavior c. a specification for thread behavior d. an API for process creation and synchronization
a specification for thread behavior
hash map
a use of a hash function which associates (or maps) [key:value] pairs using a hash function. For example, we can map the key "operating" to the value "system". Once the mapping is established, we can apply the hash function to the key to obtain the value from the hash map (Figure 1.17). For example, suppose that a user name is mapped to a password. Password authentication then proceeds as follows: a user enters his user name and password. The hash function is applied to the user name, which is then used to retrieve the password. The retrieved password is then compared with the password entered by the user for authentication.
Compile time -- If you know at compile time where the process will reside in memory, then ____________________ can be generated. For example, if you know that a user process will reside starting at location R, then the generated compiler code will start at that location and extend up from there. If, at some later time, the starting location changes, then it will be necessary to recompile this code. The MS-DOS .COM-format programs are bound at compile time.
absolute code
Our general model of protection can be viewed abstractly as a matrix, called an __________________________. The rows of the access matrix represent domains, and the columns represent objects. Each entry in the matrix consists of a set of access rights. Because the column defines objects explicitly, we can omit the object name from the access right
access matrix
Host-attached storage is ____. Select one: a. a special purpose storage system that is accessed remotely over a data network b. not suitable for hard disks c. accessed via local I/O ports d. not suitable for use in raid arrays
accessed via local I/O ports
What is the correct order of operations for protecting a critical section using mutex locks? Select one: a. release() followed by acquire() b. acquire() followed by release() c. wait() followed by signal() d. signal() followed by wait()
acquire() followed by release()
Microsoft uses ___________________ as a distributed naming structure to provide a single name space for users. Once established, the distributed naming facility is used by all clients and servers to authenticate users.
active directory
binary search tree
additionally requires an ordering between the parent's two children in which left_child <= right_child the left child has to be less than or equal to the right child
The interrupt mechanism accepts an ________________—a number that selects a specific interrupt-handling routine from a small set. In most architectures, this address is an offset in a table called the _____________________. This vector contains the memory addresses of specialized interrupt handlers. The purpose of a vectored interrupt mechanism is to reduce the need for a single interrupt handler to search all possible sources of interrupts to determine which one needs service
address interrupt vector
A(n) ______ matches the process with each entry in the TLB. Select one: a. address space identifier b. process id c. stack d. page number
address space identifier
In 2001, NIST adopted a new block cipher, called the ____________________________, to replace DES. AES is another block cipher. It can use key lengths of 128, 192, or 256 bits and works on 128-bit blocks. Generally, the algorithm is compact and efficient.
advanced encryption standard (AES)
Several kinds of I/O buses are available, including:
advanced technology attachment (ATA) serial ATA (SATA) eSATA universal serial bus (USB) fibre channel (FC)
A denial of service attack is ____. Select one: a. aimed at gaining information b. aimed at stealing resources c. aimed at disrupting legitimate use of a system d. generally not network based
aimed at disrupting legitimate use of a system
An interrupt priority scheme can be used to ____. Select one: a. allow the most urgent work to be finished first b. make it possible for high-priority interrupts to preempt the execution of a low priority interrupt c. defer the handling of a low-priority interrupt without masking off all interrupts d. all of the above
all of the above
Which of the following data structures is appropriate for placing into its own segment? Select one: a. heap b. kernel code and data c. user code and data d. all of the above
all of the above
Worms ____. Select one: a. use the spawn mechanism to ravage system performance b. can shut down an entire network c. continue to grow as the Internet expands d. all of the above
all of the above
storage-area networks (SANs)
allow many systems to attach to a pool of storage. If the applications and their data are stored on the SAN, then the cluster software can assign the application to run on any host that is attached to the SAN. If the host fails, then any other host can take over. In a database cluster, dozens of hosts can share the same database, greatly increasing performance and reliability.
global replacement
allows a process to select a replacement frame from the set of all frames, even if that frame is currently allocated to some other process; that is, one process can take a frame from another.
Vectored I/O
allows one system call to perform multiple I/O operations involving multiple locations. For example, the UNIX readv system call accepts a vector of multiple buffers and either reads them from a source to that vector or writes from that vector to a destination.
kernel
allows the operating system to be the one program that is running at all times on a computer.
boot disk
also called a "system disk", is a disk that has a boot partition
General purpose computers run most of their programs from rewritable memory, called main memory
also called random-access memory, or RAM
System programs
also known as system utilities, provide a convenient environment for program development and execution. Some of them are simply user interfaces to system calls. Others are considerably more complex.
solid-state disks (SSDs)
an SSD is nonvolatile memory that is used like a hard drive. There are many variations of this technology, from DRAM with a battery to allow it to maintain its state in a power failure through flash-memory technologies like single-level cell (SLC) and multilevel cell (MLC) chips.
block-level striping
blocks of a file are striped across multiple disks; with n disks, block i of a file goes to disk (i mod n) + 1. Other levels of striping, such as bytes of a sector or sectors of a block, also are possibly. Block-level striping is most common.
The second approach, typically called _____________________________, attempts through various techniques to detect anomalous behavior within computer systems. Of course, not all anomalous system activity indicates an intrusion, but the presumption is that intrusions often induce anomalous behavior.
anomaly detection
system, accessed in main memory, and thrown away if selected for pageout. It is more efficient to reread a page from the file system than to write it to swap space and then reread it from there. Swap space is only used as a backing store for pages of _______________ memory, which includes memory allocated for the stack, heap, and uninitialized data of a process.
anonymous
swap spaces must still be used for pages not associated with a file (known as ______________________) ; these pages include the stack and heap for a process. This method appears to be a good compromise and is used in several systems
anonymous memory
When we use a paging scheme, we have no external fragmentation:
any free frame can be allocated to a process that needs it. However, we may have some internal fragmentation.
MS-DOS layer structure
application program->resident system program->MS-DOS device drivers->ROM BIOS device drivers In Combination With.... application program -> ROM BIOS device drivers resident system program -> ROM BIOS device drivers MS-DOS device drivers -> ROM BIOS device drivers
layered file system
application programs -> logical file system -> file-organization model -> basic file system -> I/O control -> devices
Android does not support swapping and adopts a strategy similar to that used by iOS. It may terminate a process if insufficient free memory is available. However, before terminating a process, Android writes its ____________________________ to flash memory so that it can be quickly restarted
application state
Some embedded systems are hardware devices with ___________________________________ that perform their tasks without an operating system
application-specific integrated circuits (ASICs)
The major difficulty in designing a layered operating system approach is ____. Select one: a. appropriately defining the various layers b. making sure that each layer hides certain data structures, hardware, and operations from higher-level layers c. debugging a particular layer d. making sure each layer is easily converted to modules
appropriately defining the various layers
blade servers
are a relatively recent development in which multiple processor boards, I/O boards, and networking boards are placed in the same chassis.
Mainframe operating systems
are designed primarily to optimize utilization of hardware.
Network computers (or thin clients) --
are essentially terminals that understand web-based computing-- are used in place of traditional workstations where more security or easier maintenance is desired. these are the little boxes that sit next to the monitor like at NCSU libraries -- essentially are cheaper than regular computers and have a lottt of security and all of the little boxes are based on one server that has all of these restrictions in place. They can't install or download regular software
Dynamically linked libraries
are system libraries that are linked to user programs when the programs are run.
Open-source operating systems
are those available in source-code format rather than as compiled binary code. Linux is the most famous open-source operating system
bounded-buffer
assures that there is a fixed buffer size
In an _________________________________, there are different encryption and decryption keys. An entity preparing to receive encrypted communication creates two keys and makes one of them (called the public key) available to anyone who wants it.
asymmetric encryption algorithm
Non-blocking is considered ________________
asynchronous Non-blocking send has the sender send the message and continue Non-blocking receive has the receiver receive a valid message or null
Signals can be emulated in windows through ____. Select one: a. asynchronous procedure calls b. local procedure calls c. remote procedure calls d. none of the above
asynchronous procedure calls
In an ________________________________, the data are stored in the cache, and control returns to the caller. Most writes are asynchronous. However, metadata writes, among others, can be synchronous. Operating systems frequently include a flag in the open system call to allow a process to request that writes be performed synchronously. For example, databases use this feature for atomic transactions, to assure that data reach stable storage in the required order.
asynchronous write
We have seen that encryption offers a way of constraining the set of possible receivers of a message. Constraining the set of potential senders of a message is called ______________________. Authentication is thus complementary to encryption. Authentication is also useful for proving that a message has not been modified.
authentication
When a function is invoked in a typical computer architecture, the variables defined locally to the function (sometimes known as ______________________), the parameters passed to the function, and the address to which control returns once the function exits are stored in a stack frame. Examining the stack frame from top to bottom, we first see the parameters passed to the function, followed by any automatic variables declared in the function. We next see the ____________________, which is the address of the beginning of the stack frame. Finally, we have the return address, which specifies where to return control once the function exits. The frame pointer must be saved on the stack, as the value of the stack pointer can vary during the function call. The saved frame pointer allows relative access to parameters and automatic variables.
automatic variables frame pointer
When the amount of free memory falls below the threshold, the virtual memory manager uses a tactic known as __________________________ to restore the value above the threshold
automatic working-set trimming Automatic working-set trimming works by evaluating the number of pages allocated to processes. If a process has been allocated more pages than its working-set minimum, the virtual memory manager removes pages until the process reaches its working-set minimum. A process that is at its working-set minimum may be allocated pages from the free-page-frame list once sufficient free memory is available. Windows performs working-set trimming on both user mode and system processes
Operations on objects are defined procedurally. The procedures that implement such operations are themselves a form of object, and they are accessed indirectly by capabilities. The names of user-defined procedures must be identified to the protection system if it is to deal with objects of the user-defined type. When the definition of an object is made known to Hydra, the names of operations on the type become ___________________________. Auxiliary rights can be described in a capability for an instance of the type. For a process to perform an operation on a typed object, the capability it holds for that object must contain the name of the operation being invoked among its auxiliary rights. This restriction enables discrimination of access rights to be made on an instance-by-instance and process-by-process basis.
auxiliary rights
The security descriptor of the file foo.bar might have owner avi and this discretionary access-control list:
avi -- all access group cs -- read-write access user cliff -- no access
Magnetic disks sometimes fail, and care must be taken to ensure that the data lost in such a failure are not lost forever. To this end, system programs can be used to ______________ data from disk to another storage device, such as a magnetic tape or other hard disk. Recovery from the loss of an individual file, or of an entire disk, may then be a matter of ____________________ the data from backup.
back up restoring
While it is useful to log in to a system without authorization, it is quite a lot more useful to leave behind a ___________________ daemon that provides information or allows easy access even if the original exploit is blocked. In this section, we describe common methods by which programs cause security breaches. Note that there is considerable variation in the naming conventions for security holes and that we use the most common or descriptive terms.
back-door
Most disks even come from the factory with __________________________. Depending on the disk and controller in use, these blocks are handled in a variety of ways
bad blocks
The ______________________ needs only to issue generic commands to the appropriate device driver to read and write physical blocks on the disk. Each physical block is identified by its numeric disk address (for example, drive 1, cylinder 73, track 2, sector 10)
basic file system
The first problem in designing a system is to define goals and specifications. At the highest level, the design of the system will be affected by the choice of hardware and type of system:
batch, time sharing, single user, multiuser, distributed, real time, or general purpose
absolute path name
begins at the root and follows a path down to the specified file, giving the directory names on the path
The OpenMP #pragma omp critical directive ___________. Select one: a. behaves much like a mutex lock b. does not require programmers to identify critical sections c. does not guarantee prevention of race conditions d. is similar to functional languages
behaves like a mutex lock
exclusive lock
behaves like a writer lock; only one process at a time can acquire such a lock. It is important to note that not all operating systems provide both types of locks: some systems only provide exclusive file locking
Of course, this privilege is still subject to type verification to ensure that only software capabilities for a specified abstract type are passed to any such procedure. Universal trust is not placed in any code other than the CAP machine's microcode. (See the ____________________________ at the end of the chapter for references.)
bibliographical notes
In most cases, a user program goes through several steps—some of which may be optional—before being executed (Figure 7.3). Addresses may be represented in different ways during these steps. Addresses in the source program are generally symbolic (such as the variable count). A compiler typically binds these symbolic addresses to relocatable addresses (such as "14 bytes from the beginning of this module"). The linkage editor or loader in turn _____________ the relocatable addresses to absolute addresses (such as 74014). Each binding is a mapping from one address space to another.
binds
The _______________________ captures all the aspects necessary for accessing disk drives and other block-oriented devices. The device is expected to understand commands such as read() and write(). If it is a random-access device, it is also expected to have a seek() command to specify which block to transfer next. Applications normally access such a device through a file-system interface. We can see that read(), write(), and seek() capture the essential behaviors of block-storage devices, so that applications are insulated from the low-level differences among those devices.
block-device interface
When an application issues a _________________ system call, the execution of the application is suspended. The application is moved from the operating system's run queue to a wait queue. After the system call completes, the application is moved back to the run queue, where it is eligible to resume execution
blocking
Message passing may be either ______________ or ___________________
blocking non-blocking
To improve I/O efficiency, I/O transfers between memory and disk are performed in units of ______________. Each block has one or two sectors. Depending on the disk drive, sector size varies from 32 bytes to 4,096 bytes; the usual size is 512 bytes
blocks
For large operating systems (including most general-purpose operating systems like Windows, Mac OS X, and UNIX) or for systems that change frequently, the bootstrap loader is stored in firmware, and the operating system is on disk. In this case, the bootstrap runs diagnostics and has a bit of code that can read a single block at a fixed location (say block zero) from disk into memory and execute the code from that _______________________.
boot block
This ____________________ in turn knows enough about the file-system structure to be able to load the kernel and start it executing. It can contain more than the instructions for how to boot a specific operating system.
boot loader
Let's consider as an example the boot process in Windows. First, note that Windows allows a hard disk to be divided into partitions, and one partition—identified as the _____________________—contains the operating system and device drivers. The Windows system places its boot code in the first sector on the hard disk, which it terms the _________________________, or MBR. Booting begins by running code that is resident in the system's ROM memory. This code directs the system to read the boot code from the MBR.
boot partition master boot record
After an operating system is generated, it must be made available for use by the hardware. But how does the hardware know where the kernel is or how to load that kernel? The procedure of starting a computer by loading the kernel is known as ________________ the system.
booting
For a computer to start running—for instance, when it is powered up or rebooted—it must have an initial program to run. This initial ____________________ program tends to be simple. It initializes all aspects of the system, from CPU registers to device controllers and the contents of main memory, and then starts the operating system. To do its job, the bootstrap program finds the operating-system kernel on disk, loads that kernel into memory, and jumps to an initial address to begin the operating-system execution.
bootstrap
For a computer to start running-- for instance, when it is powered up or rebooted--it needs to have an initial program to run. This initial program, or ___________________________ tends to be simple.
bootstrap program Typically, it is stored within the computer hardware in read-only memory (ROM) or electrically erasable programmable read-only memory (EEPROM), known by the general term firmware.
Let's consider a simple example. Assume the size of a memory segment is initially 256 KB and the kernel requests 21 KB of memory. The segment is initially divided into two _____________--which we will call AL and AR—each 128 KB in size. One of these buddies is further divided into two 64-KB buddies—BL and BR. However, the next-highest power of 2 from 21 KB is 32 KB so either BL or BR is again divided into two 32-KB buddies, CL and CR. One of these buddies is used to satisfy the 21-KB request.
buddies
In step 1, the host is __________________ or _____________: it is in a loop, reading the status register over and over until the busy bit becomes clear. If the controller and device are fast, this method is a reasonable one. But if the wait may be long, the host should probably switch to another task. How, then, does the host know when the controller has become idle?
busy-waiting polling
The more open an operating system is—the more services it has enabled and the more functions it allows—the more likely it is that a bug is available to exploit. Increasingly, operating systems strive to be __________________. For example, Solaris 10 moved from a model in which many services (FTP, telnet, and others) were enabled by default when the system was installed to a model in which almost all services are disabled at installation time and must specifically be enabled by system administrators. Such changes reduce the system's ________________________—the set of ways in which an attacker can try to break into the system.
by default attack surface
timer
can be set to interrupt the computer after a specified period. The period may be fixed or variable. fixed (for example, 1/60 second) or variable (for example, from 1 millisecond to 1 second)
DMA controllers ____. Select one: a. do not utilize an additional, special purpose, processor b. are a nonstandard component in PCs of today c. can steal memory access cycles from the main CPU d. can access main memory at the same time as the main CPU
can steal memory access cycles from the main CPU
In the reacquisition scheme for implementing the revocation of capabilities, ____. Select one: a. a key is defined when the capability is created b. the capabilities point indirectly, not directly, to the objects c. a list of pointers is maintained with each object that points to all capabilities associated with that object d. capabilities are periodically deleted from each domain
capabilities are periodically deleted from each domain
Rather than associating the columns of the access matrix with the objects as access lists, we can associate each row with its domain. A ___________________________ for a domain is a list of objects together with the operations allowed on those objects. An object is often represented by its physical name or address, called a __________________. To execute operation M on object Oj, the process executes the operation M, specifying the capability (or pointer) for object Oj as a parameter. Simple ___________________ of the capability means that access is allowed.
capability list capability possession
Typically, a given computing environment develops a security policy for ___________________________ and has the plan ______________________ by a security agency, such as the National Computer Security Center. Certain computing environments may require other certification, such as that supplied by TEMPEST, which guards against electronic eavesdropping.
certification accredited
This approach can be generalized to the use of an algorithm as a password. Such algorithmic passwords are not susceptible to reuse. That is, a user can type in a password, and no entity intercepting that password will be able to reuse it. In this scheme, the system and the user share a symmetric password. The password pw is never transmitted over a medium that allows exposure. Rather, the password is used as input to the function, along with a _______________________ ch presented by the system. The user then computes the function H(pw, ch). The result of this function is transmitted as the authenticator to the computer. Because the computer also knows pw and ch, it can perform the same computation. If the results match, the user is authenticated. The next time the user needs to be authenticated, another ch is generated, and the same steps ensue. This time, the authenticator is different. This __________________________ system is one of only a few ways to prevent improper authentication due to password exposure.
challenge one-time password
A keyboard is an example of a device that is accessed through a ______________________. The basic system calls in this interface enable an application to get() or put() one character. On top of this interface, libraries can be built that offer line-at-a-time access, with buffering and editing services (for example, when a user types a backspace, the preceding character is removed from the input stream).
character-stream interface
Because Java was designed to run in a distributed environment, the Java virtual machine—or JVM—has many built-in protection mechanisms. Java programs are composed of ________________, each of which is a collection of data fields and functions (called ________________) that operate on those fields. The JVM loads a class in response to a request to create instances (or objects) of that class. One of the most novel and useful features of Java is its support for dynamically loading untrusted classes over a network and for executing mutually distrusting classes within the same JVM.
classes methods
multithreaded server architecture
client (1) request --> server server (2) create new thread to service the request -> thread OR server (3) resume listening for additional client requests -> server
One way to implement the second-chance algorithm (sometimes referred to as the __________ algorithm) is a circular queue. A pointer (that is, a hand on the clock) indicates which page is to be replaced next. When a frame is needed, the pointer advances until it finds a page with 0 reference bit. As it advances, it clears the reference bits. Once a victim page is found, the page is replaced, and the new page is inserted in the circular queue in that position
clock
Newer versions of WAFL actually allow read-write snapshots, known as __________________. Clones are also efficient, using the same techniques as shapshots. In this case, a read-only snapshot captures the state of the file system, and a clone refers back to that read-only snapshot. Any writes to the clone are stored in new blocks, and the clone's pointers are updated to refer to the new blocks.
clones
A variation of the hash page tables algorithm that is useful for 64-bit address spaces has been proposed. This variation uses ___________________, which are similar to hashed page tables except that each entry in the hash table refers to several pages (such as 16) rather than a single page.
clustered page tables
Windows implements virtual memory using demand paging with ________________.
clustering Clustering handles page faults by bringing in not only the faulting page but also several pages following the faulting page. When a process is first created, it is assigned a working-set minimum and maximum.
To increase efficiency, most file systems group blocks together into larger chunks, frequently called ____________________. Disk I/O is done via blocks, but file system I/O is done via clusters, effectively assuring that I/O has more sequential-access and fewer random-access characteristics.
clusters
An advantage of the buddy system is how quickly adjacent buddies can be combined to form larger segments using a technique known as _________________.
coalescing
Another variation on one-time passwords uses a ______________, or ______________________, which is a list of single-use passwords. Each password on the list is used once and then is crossed out or erased. The commonly used S/Key system uses either a software calculator or a code book based on these calculations as a source of one-time passwords. Of course, the user must protect his code book, and it is helpful if the code book does not identify the system to which the codes are authenticators.
code book one-time pad
GNU General Public License (GPL)
codifies copylefting and is a common license under which free software is released. Fundamentally, GPL requires that the source code be distributed with any binaries and that any changes made to the source code be released under the same GPL license.
System administrators who manage computers and power users who have deep knowledge of a system frequently use the ______________________. For them, it is more efficient and faster.
command-line interface
One strategy for preventing loss of significant amounts of disk space to external fragmentation is to copy an entire file system onto another disk. The original disk is then freed completely, creating one large contiguous free space. We then copy the files back onto the original disk by allocating contiguous space from this one large hole. This scheme effectively ______________ all free space into one contiguous space, solving the fragmentation problem. The cost of this compaction is time, however, and the cost can be particularly high for large hard disks.
compacts Some systems require that this function be done off-line, with the file system unmounted. During this down time, normal system operation generally cannot be permitted, so such compaction is avoided at all costs on production machines. Most modern systems that need defragmentation can perform it on-line during normal system operations, but the performance penalty can be substantial.
The copy and owner rights provide us with a mechanism to limit the propagation of access rights. However, they do not give us the appropriate tools for preventing the propagation (or disclosure) of information. The problem of guaranteeing that no information initially held in an object can migrate outside of its execution environment is called the __________________________. This problem is in general unsolvable (see the ____________________ at the end of the chapter).
confinement problem bibliographic notes
local-area network (LAN)
connects computers within a room, a building, or a campus.
The __________________ -- a systems program such as fsck in UNIX—compares the data in the directory structure with the data blocks on disk and tries to fix any inconsistencies it finds. The allocation and free-space-management algorithms dictate what types of problems the checker can find and how successful it will be in fixing them.
consistency checker
data striping
consists of splitting the bits of each byte across multiple disks; such striping is called bit-level striping
This method is used in CD-ROM and DVD-ROM drives. Alternatively, the disk rotation speed can stay constant; in this case, the density of bits decreases from inner tracks to outer tracks to keep the data rate constant. This method is used in hard disks and is known as _____________________________.
constant angular velocity (CAV)
Let's look more closely at the second reason. On media that use ______________________________________, the density of bits per track is uniform. The farther a track is from the center of the disk, the greater its length, so the more sectors it can hold. As we move from outer zones to inner zones, the number of sectors per track decreases.
constant linear velocity (CLV)
A _________________ saves the state of the currently running process and restores the state of the next process to run. Select one: a. save-and-restore b. state switch c. context switch d. none of the above
context switch
Which of the following allocation methods ensures that only one access is needed to get a disk block using direct access? Select one: a. linked allocation b. indexed allocation c. hashed allocation d. contiguous allocation
contiguous allocation
We usually want several user processes to reside in memory at the same time. We therefore need to consider how to allocate available memory to the processes that are in the input queue waiting to be brought into memory. In _____________________________, each process is contained in a single section of memory that is contagious to the section containing the next process
contiguous memory allocation
In an access matrix, the ____ right allows a process to change the entries in a row. Select one: a. owner b. copy c. control d. switch
control
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. Select one: a. status b. control c. data-in d. transfer
control
A __________________ is a collection of electronics that can operate a port, a bus, or a device. A serial-port controller is a simple device controller. It is a single chip (or portion of a chip) in the computer that controls the signals on the wires of a serial port. By contrast, a SCSI bus controller is not simple.
controller
The data transfers on a bus are carried out by special electronic processors called _____________________.
controllers
Some operating systems are designed to be _________________, others to be _________________, and others to be some combination of the two
convenient efficient
Recall that the fork() system call creates a child process that is a duplicate of its parent. Traditionally, fork() worked by creating a copy of the parent's address space for the child, duplicating the pages belonging to the parent. However, considering that many child processes invoke the exec() system call immediately after creation, the copying of the parent's address space may be unnecessary. Instead, we can use a technique known as ______________________, which works by allowing the parent and child processes initially to share the same pages.
copy-on-write These shared pages are marked as copy-on-write pages, meaning that if either process writes to a shared page, a copy of the shared page is created.
The LRU policy is often used as a page-replacement algorithm and is considered to be good. The major problem is how to implement LRU replacement. An LRU page-replacement algorithm may require substantial hardware assistance. The problem is to determine an order for the frames defined by the time of last use. Two implementations are feasible:
counters stack
When a crash occurs, error information is saved to a log file, and the memory state is saved to a __________________________.
crash dump
indirect communication operations
create a new mailbox send and receive messages through mailbox destroy a mailbox
Types of system calls for file management
create file, delete file open, close read, write, reposition get file attributes, set file attributes
Common system calls used within File Management
create() and delete() open() -- opens the file and allows us to use it read(), write(), or reposition() -- rewind or skip to the end of the file, for example close() -- indicates that we are no longer using it get_file_attributes() and set_file_attributes() -- enable us to determine and set the values of various attributes for files move() and copy()
Common system calls for Process Control
create_process() or submit_job() -- creating a new job or process to be multiprogrammed get_process_attributes() and set_process_attributes() -- determines and resets the attributes of a job or process, including the job's priority, its maximum allowable execution time, and so on terminate_process -- terminates a job or process that we created if we find that it is incorrect or no longer needed wait_time() -- wait for a certain amount of time to pass wait_event() -- wait for a specific event to occur signal_event() -- signals when that event has occurred acquire_lock() and release_lock() -- locks or unlocks shared data for security to ensure the integrity of the data. Then, no other process can access the data until the lock is released
file operations
creating a file writing a file reading a file repositioning within a file deleting a file truncating a file
Abstractly, ______________________ is used to constrain the potential senders and/or receivers of a message. Modern cryptography is based on secrets called ______________ that are selectively distributed to computers in a network and used to process messages.
cryptography keys
In normal use, each process has a ___________________. The current directory should contain most of the files that are of current interest to the process. When reference is made to a file, the current directory is searched. If a file is needed that is not in the current directory, then the user usually must either specify a path name or change the current directory to be the directory holding that file.
current directory
When the DMA controller seizes the memory bus, the CPU is momentarily prevented from accessing main memory, although it can still access data items in its primary and secondary caches. Although this ___________________________ can slow down the CPU computation, offloading the data-transfer work to a DMA controller generally improves the total system performance. Some computer architectures use physical memory addresses for DMA, but others perform _________________________________, using virtual addresses that undergo translation to physical addresses. DVMA can perform a transfer between two memory-mapped devices without the intervention of the CPU or the use of main memory.
cycle stealing direct virtual memory access (DVMA)
Even more restrictive, and thus more protective, are systems that simply do not allow a change of userID. In these instances, special techniques must be used to allow users access to privileged facilities. For instance, a ________________________ may be started at boot time and run as a special userID. Users then run a separate program, which sends requests to this process whenever they need to use the facility. This method is used by the TOPS-20 operating system.
daemon process
When device A has a cable that plugs into device B, and device B has a cable that plugs into device C, and device C plugs into a port on the computer, this arrangement is called a ____________________. A daisy chain usually operates as a bus.
daisy chain
A different approach to capability-based protection has been taken in the design of the Cambridge CAP system. CAP's capability system is simpler and superficially less powerful than that of Hydra. However, closer examination shows that it, too, can be used to provide secure protection of user-defined objects. CAP has two kinds of capabilities. The ordinary kind is called a ________________________. It can be used to provide access to objects, but the only rights provided are the standard read, write, and execute of the individual storage segments associated with the object.
data capability
For the past several decades, the most commonly used symmetric encryption algorithm in the United States for civilian applications has been the ___________________________________ cipher adopted by the National Institute of Standards and Technology (NIST). DES works by taking a 64-bit value and a 56-bit key and performing a series of transformations that are based on substitution and permutation operations. Because DES works on a block of bits at a time, is known as a ____________________, and its transformations are typical of block ciphers. With block ciphers, if the same key is used for encrypting an extended amount of data, it becomes vulnerable to attack.
data-encryption standard (DES) block cipher
If a program terminates abnormally, a dump of memory may be examined by a ________________ to determine the cause of the problem a. module b. debugger c. shell d. control card
debugger
double buffering
decouples the producer of data from the consumer, thus relaxing timing requirements between them.
Just as there are myriad threats to system and network security, there are many security solutions. The solutions range from improved user education, through technology, to writing bug-free software. Most security professionals subscribe to the theory of _______________________, which states that more layers of defense are better than fewer layers.
defense in depth
Cancellation points are associated with ____ cancellation. Select one: a. asynchronous b. deferred c. synchronous d. non-deferred
deferred
relative path name
defines a path from the current directory For example, in a tree-structured file system, if the current directory is root/spell/mail, then the relative path name prt/first refers to the same file as does the absolute path name root/spell/mail/prt/first
Loading the entire program into memory results in loading the executable code for all options, regardless of whether or not an option is ultimately selected by the user. An alternative strategy is to load pages only as they are needed. This technique is known as ________________________ and is commonly used in virtual memory systems. With demand-paged virtual memory, pages are loaded only when they are demanded during program execution. Pages that are never accessed are thus never loaded into physical memory.
demand paging
A common implementation has the Internet as the untrusted domain; a semitrusted and semisecure network, called the _____________________________________, as another domain; and a company's computers as a third domain
demilitarized zone (DMZ)
On media that uses constant linear velocity, the ____. Select one: a. disk's rotation speed increases as the head moves towards the middle of the disk from either side b. disk's rotation speed remains constant c. density of bits decreases from the inner tracks to the outer tracks d. density of bits per track is uniform
density of bits per track is uniform
Policy ____. Select one: a. determines how to do something b. determines what will be done c. is not likely to change across places d. is not likely to change over time
determines what will be done
Each volume that contains a file system must also contain information about the files in the system. This information is kept in entries in a ________________ or _______________________. The device directory (more commonly known simply as the directory) records information—such as name, location, size, and type—for all files on that volume.
device directory volume table of contents
Typically, operating systems have a ___________________ for each device controller.
device driver The device driver understands the device controller and provides the rest of the operating system with a uniform interface to the device
To encapsulate the details and oddities of different devices, the kernel of an operating system is structured to use device-driver modules. The _____________________ present a uniform device-access interface to the I/O subsystem, much as system calls provide a standard interface between the application and the operating system.
device drivers
When a kernel supports asynchronous I/O, it must be able to keep track of many I/O requests at the same time. For this purpose, the operating system might attach the wait queue to a __________________. The kernel manages this table, which contains an entry for each I/O device
device-status table
A ____ is a public key digitally signed by a trusted party. Select one: a. key ring b. digital certificate c. message digest d. digital key
digital certificate
The problem is one of authentication—what we need is proof of who (or what) owns a public key. One way to solve that problem involves the use of digital certificates. A ________________________ is a public key digitally signed by a trusted party. The trusted party receives proof of identification from some entity and certifies that the public key belongs to that entity. But how do we know we can trust the certifier? These _________________________ have their public keys included within web browsers (and other consumers of certificates) before they are distributed.
digital certificate certificate authorities
The second main type of authentication algorithm is a _______________________, and the authenticators thus produced are called __________________________. Digital signatures are very useful in that they enable anyone to verify the authenticity of the message. In a digital-signature algorithm, it is computationally infeasible to derive k_s from k_v. Thus, k_v is the public key, and k_s is the private key
digital-signature algorithm digital signatures
This form of interrupt-driven I/O is fine for moving small amounts of data but can produce high overhead when used for bulk data movement such as disk I/O. To solve this problem, __________________________ is used.
direct memory access (DMA)
Antivirus programs are often used to provide this protection. Some of these programs are effective against only particular known viruses. They work by searching all the programs on a system for the specific pattern of instructions known to make up the virus. When they find a known pattern, they remove the instructions, _________________ the program. Antivirus programs may have catalogs of thousands of viruses for which they search.
disinfecting
A read-write head "flies" just above each surface of every platter. The heads are attached to a ________________ that moves all the heads as a unit. The surface of a platter is logically divided into circular _______________, which are subdivided into sectors. The set of tracks that are at one arm position makes up a _____________. There may be thousands of concentric cylinders in a disk drive, and each track may contain hundreds of sectors. The storage capacity of common disk drives is measured in gigabytes.
disk arm tracks cylinder
Generally, it is impossible to prevent denial-of-service attacks. The attacks use the same mechanisms as normal operation. Even more difficult to prevent and resolve are _____________________________________________. These attacks are launched from multiple sites at once, toward a common target, typically by zombies. DDOS attacks have become more common and are sometimes associated with blackmail attempts. A site comes under attack, and the attackers offer to halt the attack in exchange for money.
distributed denial-of-service (DDOS) attacks
Through the evolution of network and file technology, remote file-sharing methods have changed. The first implemented method involves manually transferring files between machines via programs like ftp. The second major method uses a ________________________ in which remote directories are visible from a local machine
distributed file system (DFS)
To make client-server systems easier to manage, _________________________, also known as distributed naming services, provide unified access to the information needed for remote computing. The _______________________ provides host-name-to-network-address translations for the entire Internet. Before DNS became widespread, files containing the same information were sent via e-mail or ftp between all networked hosts. Obviously, this methodology was not scalable!
distributed information systems domain name system (DNS)
A(n) ____ is a custom build of the Linux operating system. Select one: a. LiveCD b. installation c. distribution d. VMWare Player
distribution
parallelization
divides a program into separate components that run in parallel on individual cores in a computer or computers in a cluster. Typically, these applications are designed so that once each computing node in the cluster has solved its portion of the problem, the results from all the nodes are combined into a final solution
If the association is dynamic, a mechanism is available to allow _________________________, enabling the process to switch from one domain to another. We may also want to allow the content of a domain to be changed. If we cannot change the content of a domain, we can provide the same effect by creating a new domain with the changed content and switching to that new domain when we want to change the domain content.
domain switching
Transfers between operating-system buffers and process memory then occur only when the process is swapped in. Note that this ________________________ itself adds overhead. We now need to copy the data again, from kernel memory to user memory, before the user process can access it
double buffering
The memory-mapping call, however, requires using two caches—the page cache and the buffer cache. A memory mapping proceeds by reading in disk blocks from the file system and storing them in the buffer cache. Because the virtual memory system does not interface with the buffer cache, the contents of the file in the buffer cache must be copied into the page cache. This situation, known as __________________________, requires caching file-system data twice
double caching
Many operating systems can be _________________, allowing us to install multiple operating systems on a single system. How does the system know which one to boot? A boot loader than understands multiple file systems and multiple operating systems can occupy the boot space.
dual-booted
Common system calls used for Information Maintenance
dump() -- is memory that is used for debugging trace -- a program that lists each system call as it is executed. get_process_attributes() and set_process_attributes() -- used to reset the process information and determine which information is normally kept
This procedure is a particular instance of the great ____________________________________, which concerns how to satisfy a request of size n from a list of free holes
dynamic storage-allocation problem There are many solutions to this problem. The first-fit, best-fit, and worst-fit strategies are the ones most commonly used to select a free hole from the set of available holes.
A message-passing model is ____. Select one: a. easier to implement than a shared memory model for intercomputer communication b. faster than the shared memory model c. a network protocol, and does not apply to operating systems d. only useful for small, simple operating systems
easier to implement than a shared memory model for intercomputer communication
Operating systems provide various methods to allow privilege escalation. On UNIX, for instance, the setuid attribute on a program causes that program to run with the user ID of the owner of the file, rather than the current user's ID. The process runs with this ______________________ until it turns off the extra privileges or terminates.
effective UID
With an average page-fault service time of 8 milliseconds and a memory-access time of 200 nanoseconds, the effective access time in nanoseconds is...
effective access time = ( 1 − p ) × ( 200 ) + p ( 8 milliseconds ) = ( 1 − p ) × 200 + p × 8,000,000 = 200 + 7,999,800 × p
To find the effective memory-access time, we weight the case by its probability:
effective access time = 0.80 * 100 + 0.20 * 200 = 120 nanoseconds For a 99-percent hit ratio, which is much more realistic, we have effective access time = 0.99 * 100 + 0.01 * 200 = 101 nanoseconds
Demand paging can significantly affect the performance of a computer system.
effective access time can help us see why
As with many other aspects of computing, published performance numbers for disks are not the same as real-world performance numbers. Stated transfer rates are always lower than ______________________, for example. The transfer rate may be the rate at which bits can be read from the magnetic media by the disk head, but that is different from the rate at which blocks are delivered to the operating system.
effective transfer rates
Moore's Law
emerged in the 1960s predicted that the number of transistors on an integrated circuit would double every eighteen months, and that prediction has held true. Computers gained in functionality and shrunk in size, leading to a vast number of uses and a vast number and variety of operating systems
This is the foundation of Java protection, since it enables a class to effectively ____________________ and protect its data and methods from other classes loaded in the same JVM. For example, a variable can be defined as private so that only the class that contains it can access it or protected so that it can be accessed only by the class that contains it, subclasses of that class, or classes in the same package.
encapsulate
Because it solves a wide variety of communication security problems, _______________________________ is used frequently in many aspects of modern computing. It is used to send messages securely across across a network, as well as to protect database data, files, and even entire disks from having their contents read by unauthorized entities. An encryption algorithm enables the sender of a message to ensure that only a computer possessing a certain key can read the message, or ensure that the writer of data is the only reader of that data. Encryption of messages is an ancient practice, of course, and there have been many encryption algorithms, dating back to ancient times. In this section, we describe important modern encryption principles and algorithms.
encryption
Types of system calls made with process control
end, abort load, execute create process, terminate process get process attributes, set process attributes wait for time wait event, signal event allocate and free memory
An operating system provides an ______________________ within which other programs can do useful work
environment
The easiest way to split m frames among n processes is to give everyone an equal share, m/n frames (ignoring frames needed by the operating system for the moment). For instance, if there are 93 frames and five processes, each process will get 18 frames. The three leftover frames can be used as a free-frame buffer pool. This scheme is called __________________________.
equal allocation
In the course of normal system use, the user ID and group ID for a user are sufficient. However, a user sometimes needs to _______________________ to gain extra permissions for an activity.
escalate privileges
Most operating systems also have an ________________ (or _____________) that transparently passes arbitrary commands from an application to a device driver. In UNIX, this system call is ioctl() (for "I/O control"). The ioctl() system call enables an application to access any functionality that can be implemented by any device driver, without the need to invent a new system call. The ioctl() system call has three arguments
escape back door
loadable kernel modules
essentially looks like a star network, with "core Solaris kernel" in the center and then connected to each independent section: file systems loadable system calls executable formats STREAMS modules miscellaneous modules device and bus drivers scheduling classes
If P and Q with to communicate, they need to:
establish a communication link between them exchange messages via send/receive
The interrupt mechanism is also used to handle a wide variety of ______________________, such as dividing by 0, accessing a protected or nonexistent memory address, or attempting to execute a privileged instruction from user mode. The events that trigger interrupts have a common property: they are occurrences that induce the operating system to execute an urgent, self-contained routine.
exceptions
An instruction that executes atomically ____. Select one: a. must consist of only one machine instruction b. executes as a single, uninterruptible unit c. cannot be used to solve the critical section problem d. all of the above
executes as a single, uninterruptible unit
_____ is the method of binding instructions and data to memory performed by most general-purpose operating systems. Select one: a. Interrupt binding b. Compile time binding c. Execution time binding d. Load time binding
execution time binding
A mount operation includes the name of the remote directory to be mounted and the name of the server machine storing it. The mount request is mapped to the corresponding RPC and is forwarded to the mount server running on the specific server machine. The server maintains an __________________ that specifies local file systems that it exports for mounting, along with names of machines that are permitted to mount them.
export list
Some newer file systems also support _________________________, including character encoding of the file and security features such as a file checksum.
extended file attributes
Although Linux supports over forty different file systems, the standard Linux file system is known as the _____________________, with the most common versions being ext3 and ext4. There are also distributed file systems in which a file system on a server is mounted by one or more client computers across a network.
extended file system
To minimize drawbacks, some operating systems use a modified contiguous-allocation scheme. Here, a contiguous chunk of space is allocated initially. Then, if that amount proves not to be large enough, another chunk of contiguous space, known as an ______________, is added. The location of a file's blocks is then recorded as a location and a block count, plus a link to the first block of the next extent.
extent
Both the first-fit and best-fit strategies for memory allocation suffer from ___________________________________. As processes are loaded and removed from memory, the free memory space is broken into little pieces.
external fragmentation External fragmentation exists when there is enough total memory space to satisfy a request but the available spaces are not contiguous: storage is fragmented into a large number of small holes. This fragmentation problem can be severe. In the worst case, we could have a block of free (or wasted) memory between every two processes. If all these small pieces of memory were in one big free block instead, we might be able to run several more processes.
A lot of algorithms suffer from the problem of _______________________. As files are allocated and deleted, the free disk space is broken into little pieces.
external fragmentation External fragmentation exists whenever free space is broken into chunks. It becomes a problem when the largest contiguous chunk is insufficient for a request; storage is fragmented into a number of holes, none of which is large enough to store the data. Depending on the total amount of disk storage and the average file size, external fragmentation may be a minor or a major problem.
Otherwise, the number of ______________________ (false alarms) or, worse, ______________________ (missed intrusions) will be excessive.
false positives false negatives
Some systems go beyond graceful degradation and are called _______________________, because they can suffer a failure of any single component and still continue operation
fault tolerant Fault tolerance requires a mechanism to allow the failure to be detected, diagnosed, and, if possible, corrected.
The operating system abstracts from the physical properties of its storage devices to define a logical storage unit, the ___________. Files are mapped by the operating system onto physical devices.
file
Next, an entry is made in the per-process open-file table, with a pointer to the entry in the system-wide open-file table and some other fields. These other fields may include a pointer to the current location in the file (for the next read() or write() operation) and the access mode in which the file is open. The open() call returns a pointer to the appropriate entry in the per-process file-system table. All file operations are then performed via this pointer. The file name may not be part of the open-file table, as the system has no use for it once the appropriate FCB is located on disk. It could be cached, though, to save time on subsequent opens of the same file. The name given to the entry varies. UNIX systems refer to it as a _____________________; Windows refers to it as a ___________________.
file descriptor file handle
The general outline for creating a region of shared memory using memory-mapped files in the Windows API involves first creating a __________________ for the file to be mapped and then establishing a __________ of the mapped file in a process's virtual address space. A second process can then open and create a view of the mapped file in its virtual address space. The mapped file represents the shared-memory object that will enable communication to take place between the processes.
file mapping view
The ____________________________ knows about files and their logical blocks, as well as physical blocks. By knowing the type of file allocation used and location of the file, the file-organization module can translate logical block addresses to physical block addresses for the basic file system to transfer
file-organization model
low-level formatting
fills the disk with a special data structure for each sector. The data structure for a sector typically consists of a header, a data area, (usually 512 bytes in size), and a trailer. The header and trailer contain information used by the disk controller, such as a sector number or an error-correcting code (ECC).
Many homes use ______________________ to protect their networks from security breaches
firewalls
The simplest form of disk scheduling is, of course, the _____________________________ algorithm. This algorithm is intrinsically fair, but it generally does not provide the fastest service.
first-come, first-served (FCFS)
A simplest page-replacement algorithm is a ________________________ algorithm. A FIFO replacement algorithm associates with each page the time when that page was brought into memory. When a page must be replaced, the oldest page is chosen. Notice that it is not strictly necessary to record the time when a page is brought in. We can create a FIFO queue to hold all pages in memory. We replace the page at the head of the queue. When a page is brought into memory, we insert it at the tail of the queue.
first-in, first-out (FIFO)
Linux threads
flag CLONE_FS meaning File-system information is shared flag CLONE_VM meaning The same memory space is shared flag CLONE_SIGHAND meaning Signal handlers are shared flag CLONE_FILES meaning The set of open files is shared
In Peterson's solution, the ____ variable indicates if a process is ready to enter its critical section. Select one: a. turn b. lock c. flag[i] d. turn[i]
flag[i]
Modules provide the functionality of STREAMS processing; they are pushed onto a stream by use of the ioctl() system call. For example, a process can open a serial-port device via a stream and can push on a module to handle input editing. Because messages are exchanged between queues in adjacent modules, a queue in one module may overflow an adjacent queue. To prevent this from occurring, a queue may support ______________________. Without flow control, a queue accepts all messages and immediately sends them on to the queue in the adjacent module without buffering them.
flow control
If the TLB does not support separate ASIDs, then every time a new page table is selected (for instance, with each context switch), the TLB must be ________________ (or erased) to ensure that the next executing process does not use the wrong translation information.
flushed Otherwise, the TLB could include old entries that contain valid virtual addresses but have incorrect or invalid physical addresses left over from the previous process
priority-based scheduling
for real-time scheduling, scheduler must support preemptive, priority based scheduling (but only guarantees soft real-time) For hard real-time must also provide ability to meet deadlines Processes have new characteristics: periodic ones require CPU at constant intervals - has processing time t, deadline d, period p - 0 <= t <= d <= p - rate of periodic task is 1/p
Belady's anomaly states that ____. Select one: a. giving more memory to a process will improve its performance b. as the number of allocated frames increases, the page fault rate may decrease for all page replacement algorithms c. for some page replacement algorithms, the page fault rate may decrease as the number of allocated frames increases d. for some page replacement algorithms, the page fault rate may increase as the number of allocated frames increases
for some page replacement algorithms, the page fault rate may increase as the number of allocated frames increases
Belady's anomoly
for some page-replacement algorithms, the page-fault rate may increase as the number of allocated frames increases. We would expect that giving more memory to a process would improve its performance. In some early research, investigators noticed this assumption was not always true. Belady's anomaly was discovered as a result
A clustered system ____. Select one: a. gathers together multiple CPUs to accomplish computational work b. is an operating system that provides file sharing across a network c. is used when rigid time requirements are present d. can only operate one application at a time
gathers together multiple CPUs to accomplish computational work
types of system calls used with information maintenance
get time or date, set time or date get system data, set system data get process, file, or device attributes set process, file, or device attributes
UNIX examples
fork system call creates new process exec system call used after a fork to replace the process' memory space with a new program
The Windows CreateProcess() system call creates a new process. What is the equivalent system call in UNIX? a. NTCreateProcess() b. process() c. fork() d. getpid()
fork()
One way is to use a two-level paging algorithm, in which the page table itself is also paged (Figure 7.17). For example, consider again the system with a 32-bit logical address space and a page size of 4 KB. A logical address is divided into a page number consisting of 20 bits and a page offset consisting of 12 bits. Because we page the page table, the page number is further divided into a 10-bit page number and a 10-bit page offset. Thus, a logical address is as follows: where p1 is an index into the outer page table and p2 is the displacement within the page of the inner page table. Because address translation works from the outer page table inward, this scheme is also known as a ____________________________.
forward-mapped page table
Since the operating system is managing physical memory, it must be aware of the allocation details of physical memory -- which frames are allocated, which frames are available, how many total frames there are and so on. This information is generally kept in a data structure called a _________________________.
frame table The frame table has one entry for each physical page frame, indicating whether the latter is free or allocated and, if it is allocated, to which page of which process or processes
We must solve two major problems to implement demand paging: we must develop a _____________________________ and a ______________________________. That is, if we have multiple processes in memory, we must decide how many frames to allocate to each process; and when page replacement is required, we must select the frames that are to be replaced.
frame-allocation algorithm page-replacement algorithm
The basic method for implementing paging involves breaking physical memory into fixed-sized blocks called ________________ and breaking logical memory into blocks of the same size called _____________.
frames pages
Since disk space is limited, we need to reuse the space from deleted files for new files, if possible. (Write-once optical disks allow only one write to any given sector, and thus reuse is not physically possible.) To keep track of free disk space, the system maintains a ______________________. The free-space list records all free disk blocks—those not allocated to some file or directory.
free-space list
Other systems use separate __________________________ for terminal I/O to reduce the interrupt burden on the main CPU. For instance, a terminal concentrator can multiplex the traffic from hundreds of remote terminals into one port on a large computer.
front-end processors
Common system calls used in Communication
get_hostid() and get_processid() -- translates the host name or process name into an identifier by which the operating system can refer to the process open() and close() (could also be open_connection() and close_connection() in this context) accept_connection() -- gives the recipient process permission for communication to take place wait_for_connection() -- allows for a process to awaken when a connection is made read_message() and write_message() -- The source of the communication, known as the client, and the receiving daemon, known as a server, then exchange messages by using these system calls close_connection() -- terminates the communication shared_memory_create() and shared_memory_attach() -- create and gain access to regions of memory owned by other processes
Another important factor in the way frames are allocated to the various processes is page replacement. With multiple processes competing for frames, we can classify page-replacement algorithms into two broad categories:
global replacement local replacement
The ____ implementation of an access table consists of sets of ordered triples. Select one: a. global table b. access list for objects c. lock-key mechanism d. capability list
global table
Increased reliability of a computer system is crucial in many applications. The ability to continue providing service proportional to the level of surviving hardware is called _____________________________.
graceful degradation
The worm was made up of two programs, a __________________ (also called a bootstrap or vector) program and the main program
grappling hook Once established on the computer system under attack, the grappling hook connects to the machine where it originated and uploads a copy of the main word onto the hooked system
The most common secondary-storage device is __________________________, which provides storage for both programs and data.
hard disk drive (HDD) most programs (system and application) are stored on a disk until they are loaded into memory. Many programs then use the disk as the source and the destination of their processing
The replacement of a bad block generally is not totally automatic, because the data in the bad block are usually lost. Soft errors may trigger a process in which a copy of the block data is made and the block is spared or slipped. An unrecoverable ________________, however, results in lost data. Whatever file was using that block must be repaired (for instance, by restoration from a backup tape), and that requires manual intervention.
hard error
When the count is 0, the file can be deleted; there are no remaining references to it. The UNIX operating system uses this approach for nonsymbolic links (or _________________), keeping a reference count in the file information block (or inode; see Section A.7.2). By effectively prohibiting multiple references to directories, we maintain an acyclic-graph structure.
hard links
A computer system can be divided roughly into four components:
hardware operating system application programs users
A computer system is a collection of processes and objects. By objects, we mean both __________________________ (such as the CPU, memory segments, printers, disks, and tape drives) and _______________________ (such as files, programs, and semaphores). Each object has a unique name that differentiates it from all other objects in the system, and each can be accessed only through well-defined and meaningful operations. Objects are essentially abstract data types.
hardware objects software objects
In comparing the different memory-management strategies, we use the following considerations:
hardware support performance fragmentation relocation swapping sharing protection
XML firewall
has the specific purpose of analyzing XML traffic and blocking disallowed or malformed XML
A __________________ H(m) creates a small, fixed-sized block of data, known as a message digest or hash value, from a message m. Hash functions work by taking a message, splitting it into blocks, and processing the blocks to produce an n-bit hash. H must be collision resistant—that is, it must be infeasible to find an m′ ≠ m such that H(m) = H(m′). Now, if H(m) = H(m′), we know that m = m′—that is, we know that the message has not been modified.
hash function
A common approach for handling address spaces larger than 32 bits is to use a ________________________, with the hash value being the virtual page number. Each entry in the hash table contains a linked list of elements that hash to the same location (to handle collisions)
hashed page table
solid-state disks
have several variants but in general are faster than hard disks and are nonvolatile. One type of solid-state disk stores data in a large DRAM array during normal operation but also contains a hidden hard disk and battery for backup power. If the external power is interrupted, the solid-state disk's controller copies the data from RAM to the hard disk. When external power is restored, the controller copies the data back into RAM (like when the computer is off but you still get all of your windows back when you turn it back on)
Windows Task Manager
includes information for current applications as well as processes, CPU and memory usage, and networking statistics
Because the disk head flies on an extremely thin cushion of air (measured in microns), there is a danger that the head will make contact with the disk surface. Although the disk platters are coated with a thin protective layer, the head will sometimes damage the magnetic surface. This accident is called a head crash. A ______________ normally cannot be repaired; the entire disk must be replaced.
head crash
Structure of the page table Some of the most common techniques for structuring the page table:
hierarchical paging hashed page tables inverted page tables
thrashing
high paging activity A process is thrashing if it is spending more time paging than executing
Clustering is usually used to provide __________________________ service—that is, service will continue even if one or more systems in the cluster fail. Generally, we obtain high availability by adding a level of redundancy in the system. A layer of cluster software runs on the cluster nodes. Each node can monitor one or more of the others (over the LAN). If the monitored machine fails, the monitoring machine can take ownership of its storage and restart the applications that were running on the failed machine. The users and clients of the applications see only a brief interruption of service
high-availability
Since a cluster consists of several computer systems connected via a network, clusters can also be used to provide ___________________________________ environments.
high-performance computing
multilevel queue scheduling from highest priority to lowest priority
highest priority system processes interactive processes interactive editing processes batch processes student processes lowest priority
The percentage of times that the page number of interest is found in the TLB is called the __________________.
hit ratio An 80-percent hit ratio, for example, means that we find the desired page number in the TLB 80 percent of the time. If it takes 100 nanoseconds to access memory, then a mapped-memory access takes 100 nanoseconds when the page number is in the TLB. If we fail to find the page number in the TLB then we must first access memory for the page table and frame number (100 nanoseconds) and then access the desired byte in memory (100 nanoseconds), for a total of 200 nanoseconds.
Because the SCSI protocol is complex, the SCSI bus controller is often implemented as a separate circuit board (or a _____________________) that plugs into the computer
host adaptor
mechanisms are distinct from policies -- mechanisms determine ___________ something will be done; policies decide ______________ will be done.
how what
resource utilization
how various hardware and software resources are shared. Performance is, of course, important to the user; but such systems are optimized for the single-user experience rather than the requirements of multiple users
_______________ is a mobile operating system designed for the iPhone and iPad a. Mac OS X b. Android c. UNIX d. iOS
iOS
____________________ is the latest network-attached storage protocol. In essence, It uses the IP network protocol to carry the SCSI protocol. Thus, networks -- rather than SCSI cables -- can be used as the interconnects between hosts and their storage. As a result, hosts can treat their storage as if it were directly attached, even if the storage is distant from the host.
iSCSI
A unique approach is that of _____________________________. Once a file is declared as shared by its creator, it cannot be modified. An immutable file has two key properties: its name may not be reused, and its contents may not be altered. Thus, the name of an immutable file signifies that the contents of the file are fixed. The implementation of these semantics in a distributed system is simple, because the sharing is disciplined (read-only).
immutable shared files
The most common technique for writing multithreaded Java programs is _____. Select one: a. extending the Thread class and overriding the run() method b. implementing the Runnable interface and defining its run() method c. designing your own Thread class d. using the CreateThread() function
implementing the Runnable interface and defining its run() method
Linked lists are of several types:
in a singly linked list, each item points to its successor In a doubly linked list, a given item can refer either to its predecessor or its successor In a circularly linked list, the last element in the list refers to the first element, rather than to null
queue
in contrast, is a sequentially ordered data structure that uses the first in, first out (FIFO) principle: items are removed from a queue in the order in which they were inserted. There are many everyday examples of queues, including shoppers waiting in a checkout line at a store and cars waiting in line at a traffic signal. Queues are also quite common in operating systems—jobs that are sent to a printer are typically printed in the order in which they were submitted, for example.
Android runs Java programs _____________. Select one: a. in the Dalvik virtual machine b. natively c. in the Java virtual machine d. Android does not run Java programs
in the Dalvik virtual machine
network
in the simplest terms, is a communication path between two or more systems. Distributed systems depend on networking for their functionality. Networks vary by the protocols used, the distances between nodes, and the transport media.
symmetric multiprocessing (SMP)
in which each processor performs all tasks, including operating system functions and user processes. SMP means that all processors are peers; no boss-worker relationship exists between processors.
Multiprogramming
increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute. One of the most important aspects of operating systems is the ability to multiprogram. A single program cannot, in general, keep either the CPU or the I/O devices busy at all times. Single users frequently have multiple programs running
processes within a system may be _________________ or _________________
independent cooperating
The ______________, like an index in the back of a book, contains pointers to the various blocks. To find a record in the file, we first search the index and then use the pointer to access the file directly and to find the desired record.
index
What are the advantages of process cooperation?
information sharing computation speed-up modularity convenience
Noncontainer objects
inherit no other permissions. Furthermore, if a permission is changed on a directory, the new permissions do not automatically apply to existing files and subdirectories; the user may explicitly apply them if he so desires
The _______ process is assigned as the parent to orphan processes. Select one: a. zombie b. init c. main d. renderer
init
Usually, a program resides on a disk as a binary executable file. To be executed, the program must be brought into memory and placed within a process. Depending on the memory management in use, the process may be moved between disk and memory during its execution. The process on the disk that are waiting to be brought into memory for execution form the ___________________.
input queue
For each of these four object types, the VFS defines a set of operations that may be implemented. Every object of one of these types contains a pointer to a function table. The function table lists the addresses of the actual functions that implement the defined operations for that particular object. For example, an abbreviated API for some of the operations for the file object includes:
int open(...)—Open a file. int close(...)—Close an already-open file. ssize_t read(...)—Read from a file. ssize_t write(...)—Write to a file. int mmap(...)—Memory-map a file.
Windows added mandatory integrity control, which works by assigning an ___________________________ to each securable object and subject. In order for a given subject to have access to an object, it must have the access requested in the discretionary access-control list, and its integrity label must be equal to or higher than that of the secured object (for the given operation).
integrity label
checksums
integrity of data. ZFS maintains internal checksums of all blocks, including data and metadata. These checksums are not kept with the block that is being checksummed. Rather, they are stored with the pointer to that block.
Time sharing requires an _________________ computer system, which provides direct communication between the user and the system.
interactive The user gives instructions to the operating system or to a program directly, using a input device such as a keyboard, mouse, touch pad, or touch screen, and waits for immediate results on an output device. Accordingly, the response time should be short -- typically less than one second.
Like other complex software-engineering problems, the approach here involves abstraction, encapsulation, and software layering. Specifically, we can abstract away the detailed differences in I/O devices by identifying a few general kinds. Each general kind is accessed through a standardized set of functions—an ________________. The differences are encapsulated in kernel modules called device drivers that internally are custom-tailored to specific devices but that export one of the standard interfaces.
interface
Memory fragmentation can be internal as well as external. Consider a multiple-partition allocation scheme with a hole of 18,464 bytes. Suppose that the next process requests 18,462 bytes. If we allocate exactly the requested block, we are left with a hole of 2 bytes. The overhead to keep track of this hole will be substantially larger than the hole itself. The general approach to avoiding this problem is to break the physical memory into fixed-sized blocks and allocate memory in units based on block size. With this approach, the memory allocated to a process may be slightly larger than the requested memory. The difference between these two numbers is ______________________—unused memory that is internal to a partition.
internal fragmentation
In such instances, it may be more efficient to arrange for the hardware controller to notify the CPU when the device becomes ready for service, rather than to require the CPU to poll repeatedly for an I/O completion. The hardware mechanism that enables a device to notify the CPU is called an _____________________.
interrupt
The occurrence of an event is usually signaled by an ________________ from either the hardware or the software.
interrupt
In practice, however, computers have more devices (and, hence, interrupt handlers) then they have address elements in the interrupt vector. A common way to solve this problem is to use _________________, in which each element in the interrupt vector points to the head of a list of interrupt handlers. When an interrupt is raised, the handlers on the corresponding list are called one by one, until one is found that can service the request
interrupt chaining
tree
is a data structure that can be used to represent data hierarchically. Data values in a tree structure are linked through parent-child relationships.
As mentioned earlier, modern operating systems are _______________________. If there are no processes to execute, no I/O devices to service, and no users to whom to respond, and operating system will sit quietly, waiting for something to happen.
interrupt driven
If the CPU does not poll the control bit, but instead receives an interrupt when the device is ready for the next byte, the data transfer is said to be ________________.
interrupt driven
The interrupt mechanism also implements a system of ________________________________. These levels enable the CPU to defer the handling of low-priority interrupts without masking all interrupts and makes it possible for a high-priority interrupt to preempt the execution of a low-priority interrupt.
interrupt priority levels
Since only a predefined number of interrupts is possible, the interrupt routine is called indirectly through a table of pointers, with no intermediate routine needed. Generally, the table of pointers is stored in low memory (the first hundred or so locations). These locations hold the addresses of the interrupt service routines for the various devices. This array, or _______________________, of addresses is then indexed by a unique device number, given with the interrupt request, to provide the address of the interrupt service routine for the interrupting device
interrupt vector
In modern computer hardware, these three features are provided by the CPU and by the __________________________
interrupt-controller hardware
The basic interrupt mechanism works as follows. The CPU hardware has a wire called the _____________________________ that the CPU senses after executing every instruction. When the CPU detects that a controller has asserted a signal on the interrupt-request line, the CPU performs a state save and jumps to the interrupt-handler routine at a fixed address in memory.
interrupt-request line
We should note that in our discussion of security, we use the terms _________________ and __________________ for those attempting to breach security.
intruder cracker
Securing systems and facilities is intimately linked to ____________________. Intrusion detection, as its name suggests, strives to detect attempted or successful intrusions into computer systems and to initiate appropriate responses to the intrusions.
intrusion detection
These degrees of freedom in the design space for detecting intrusions have yielded a wide range of solutions, known as _______________________ and _____________________________. IDS systems raise an alarm when an intrusion is detected, while IDP systems act as routers, passing traffic unless an intrusion is detected (at which point that traffic is blocked).
intrusion-detection systems (IDSs) intrusion-prevention systems (IDPs)
One of the drawbacks of the operating system having to calculate where in the table the associated physical address is located is that each page table may consist of millions of entries. These tables may consume large amounts of physical memory just to keep track of how other physical memory is being used. To solve this problem, we can use an _________________________. This page table has one entry for each real page (or frame) of memory. Each entry consists of the virtual address of the page stored in that real memory location, with information about the process that owns the page
inverted page table
Replication
involves the automatic duplication of writes between separate sites for redundancy and disaster recovery. Replication can be synchronous or asynchronous. In synchronous replication, each block must be written locally and remotely before the write is considered complete, whereas in asynchronous replication, the writes are grouped together and written periodically.
Virtual memory
involves the separation of logical memory as perceived by users from physical memory. This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Virtual memory makes the task of programming much easier, because the programmer no longer needs to worry about the amount of physical memory available; she can concentrate instead on the problem to be programmed.
A tree of processes on a typical Solaris
is a binary search tree organized by pid values
spool
is a buffer that holds output for a device, such as a printer, that cannot accept interleaved data streams. Although a printer can serve only one job at a time, several applications may wish to print their output concurrently, without having their output mixed together
DTrace
is a facility that dynamically adds probes to a running system, both in user processes and in the kernel. These probes can be queried via the D programming language to determine an astonishing amount about the kernel, the system state, and process activities. For example, Figure 2.20 follows an application as it executes a system call (ioctl()) and shows the functional calls within the kernel as they execute to perform the system call. Lines ending with "U" are executed in user mode, and lines ending in "K" in kernel mode.
virus
is a fragment of code embedded in a legitimate program. Viruses are self-replicating and are designed to "infect" other programs. They can wreak havoc in a system by modifying or destroying files and causing system crashes and program malfunctions. As with most penetration attacks, viruses are very specific to architectures, operating systems, and applications. Viruses are a particular problem for users of
Time sharing (or multitasking)
is a logical extension of multiprogramming. In time-sharing systems, the CPU execute multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running
buffer
is a memory area that stores data being transferred between two devices or between a device and an application. Buffering is done for three reasons. One reason is to cope with a speed mismatch between the producer and consumer of the data stream. Suppose, for example, that a file is being received via modem for storage on the hard disk. The modem is about a thousand times slower than the hard disk. So a buffer is created in main memory to accumulate the bytes received from the modem. When an entire buffer of data has arrived, the buffer can be written to disk in a single operation. Since the disk write is not instantaneous and the modem still needs a place to store additional incoming data, two buffers are used. After the modem fills the first buffer, the disk write is requested. The modem then starts to fill the second buffer while the first buffer is written to disk. By the time the modem has filled the second buffer, the disk write from the first one should have completed, so the modem can switch back to the first buffer while the disk writes the second one.
segmentation
is a memory-management scheme that supports this programmer view of memory. A logical address space is a collection of segments. Each segment has a name and a length. The addresses specify both the segment name and the offset within the segment. The programmer therefore specifies each address by two quantities: a segment name and an offset.
cache
is a region of fast memory that holds copies of data. Access to the cached copy is more efficient than access to the original. For instance, the instructions of the currently running process are stored on disk, cached in physical memory, and copied again in the CPU's secondary and primary caches. The difference between a buffer and a cache is that a buffer may hold the only existing copy of a data item, whereas a cache, by definition, holds a copy on faster storage of an item that resides elsewhere.
source file
is a sequence of functions, each of which is further organized as declarations followed by executable statements
stack
is a sequentially ordered data structure that uses the last in, first out (LIFO) principle for adding and removing items, meaning that the last item placed into a stack is the first item removed. The operations for inserting and removing items from a stack are known as push and pop, respectively. An operating system often uses a stack when invoking function calls. Parameters, local variables, and the return address are pushed onto the stack when a function is called; returning from the function call pops those items off the stack.
executable file
is a series of code sections that the loader can bring into memory and execute
personal firewall
is a software layer either included with the operating system or added as an application. Rather than limiting communication between security domains, it limits communication to (and possibly from) a given host
bitmap
is a string of n binary digits that can be used to represent the status of n items. For example, suppose we have several resources, and the availability of each resource is indicated by the value of a binary digit: 0 means that the resource is available, while 1 indicates that it is unavailable (or vice-versa). The value of the ith position in the bitmap is associated with the ith resource.
virtualization
is a technology that allows operating systems to run as applications within other operating systems. At first blush, there seems to be little reason for such functionality. But the virtualization industry is vast and growing, which is a testament to its utility and importance (it is used for software testing)
cloud computing
is a type of computing that delivers computing, storage, and even applications as a service across a network. In some ways, it's a logical extension of virtualization, because it uses virtualization as a base for its functionality. For example, the Amazon Elastic Compute Cloud (EC2) facility has thousands of servers, millions of virtual machines, and petabytes of storage available for use by anyone on the Internet. Users pay per month based on how much of those resources they use.
shared lock
is akin to a reader lock in that several processes can acquire the lock concurrently.
Cocoa Touch
is an API for Objective-C that provides several frameworks for developing applications that run on iOS devices. The fundamental difference between Cocoa, mentioned earlier, and Cocoa Touch is that the latter provides support for hardware features unique to mobile devices, such as touch screens. It goes like this: Cocoa Touch Media Services Core Services Core OS
Prepaging
is an attempt to prevent a high level of initial paging. The strategy is to bring into memory at once time all the pages that will be needed. Some operating systems -- notably Solaris -- prepage the page frames for small files
network operating system
is an operating system that provides features such as file sharing across the network, along with a communication scheme that allows different processes on different computers to exchange messages. A computer running a network operating system acts autonomously from all other computers on the network, although it is aware of the network and is able to communicate with other networked computers
Paging
is another memory-management scheme that offers this advantage. However, paging avoids external fragmentation and the need for compaction, whereas segmentation does not. It also solves the considerable problem of fitting memory chunks of varying sizes onto the backing store. Most memory-management schemes used before the introduction of paging suffered from this problem. The problem arises because, when code fragments or data residing in main memory need to be swapped out, space must be found on the backing store.
working-set model
is based off the assumption of locality This model uses a parameter, Δ, to define the working-set window. The idea is to examine the most recent Δ page references. The set of pages in the most recent Δ page references is the working set (Figure 8.20). If a page is in active use, it will be in the working set. If it is no longer being used, it will drop from the working set Δ time units after its last reference. Thus, the working set is an approximation of the program's locality. For example, given the sequence of memory references shown in Figure 8.20, if Δ = 10 memory references, then the working set at time t1 is {1, 2, 5, 6, 7}. By time t2, the working set has changed to {3, 4}.
variable timer
is generally implemented by a fixed-rate clock and a counter. The operating system sets the counter. Every time the clock ticks, the counter is decremented. When the counter reaches 0, an interrupt occurs. For instance, a 10-bit counter with a 1-millisecond clock allows interrupts at intervals from 1 millisecond to 1,024 milliseconds, in steps of 1 millisecond.
debugging
is the activity of finding and fixing errors in a system, both in hardware and in software performance problems are also considered bugs, so debugging can also include performance tuning
host controller
is the controller at the computer end of the bus
TCP/IP
is the most common network protocol, and it provides fundamental architecture of the Internet. Most operating systems support TCP/IP including all general purpose ones. Some systems support proprietary protocols to suit their needs. To an operating system, a network protocol simply needs an interface device—a network adapter, for example—with a device driver to manage it, as well as software to handle data. These concepts are discussed throughout this book
Optimal page replacement ____. Select one: a. is the page replacement algorithm most often implemented b. is used mostly for comparison with other page replacement schemes c. can suffer from Belady's anomaly d. requires that the system keep track of previously used pages
is used mostly for comparison with other page replacement schemes
emulation
is used when the source CPU type is different from the target CPU type. For example, when Apple switched from the IBM Power CPU to the Intel x86 CPU for its desktop and laptop computers, it included an emulation facility called "Rosetta," which allowed applications compiled for the IBM CPU to run on the Intel CPU. That same concept can be extended to allow an entire operating system written for one platform to run on another.
In the case of UNIX and Linux for programs written in the C language, the library is called _________.
libc
What are the two primary ways of implementing thread libraries?
library entirely in user space kernel-level library supported by the OS
A bit, called the mode bit, is added to the hardware of the computer to indicate the current mode:
kernel (0) or user (1) With the mode bit, we can distinguish between a task that is executed on behalf of the operating system and one that is executed on behalf of the user. When the computer system is executing on behalf of a user application, the system is in user mode. However, when a user application requests a service from the operating system (via a system call), the system must transition from user to kernel mode to fulfill the request.
system-contention scope (SCS)
kernel thread scheduled onto available CPU -- competition among all threads in a system
These are the very reasons for efforts to create asymmetric key algorithms. Not only can the keys be exchanged in public, but a given user needs only one private key, no matter how many other people she wants to communicate with. There is still the matter of managing a public key for each recipient of the communication, but since public keys need not be secured, simple storage can be used for that _________________.
key ring
A _______________________ is an infinite set of bits that can be used to encrypt a plaintext stream by simply XORing it with the plaintext. (XOR, for "eXclusive OR" is an operation that compares two input bits and generates one output bit. If the bits are the same, the result is 0. If the bits are different, the result is 1.) RC4 is used in encrypting steams of data, such as in WEP, the wireless LAN protocol. Unfortunately, RC4 as used in WEP (IEEE standard 802.11) has been found to be breakable in a reasonable amount of computer time. In fact, RC4 itself has vulnerabilities.
keystream
Any vulnerable Microsoft Explorer web browser visiting those sites received a browser virus with any download. The browser virus installed several back-door programs, including a _____________________, which records everything entered on the keyboard (including passwords and credit-card numbers). It also installed a daemon to allow unlimited remote access by an intruder and another that allowed an intruder to route spam through the infected desktop computer.
keystroke logger
media services
layer that provides services for graphics, audio, and video
Network protocols are typically organized in __________________, like an onion or a parfait, with each layer acting as a client of the one below it. That is, when one protocol generates a message to send to its protocol peer on another machine, it hands its message to the protocol below it in the network-protocol stack for delivery to its peer on that machine. For example, in an IP network, TCP (a transport-layer protocol) acts as a client of IP (a network-layer protocol): TCP packets are passed down to IP for delivery to the IP peer at the other end of the connection. IP encapsulates the TCP packet in an IP packet, which it similarly passes down to the data-link layer to be transmitted across the network to its peer on the destination computer. This IP peer then delivers the TCP packet up to the TCP peer on that machine.
layers
A demand-paging system is similar to a paging system with swapping (Figure 8.4) where processes reside in secondary memory (usually a disk). When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, though, we use a _________________________.
lazy swapper A lazy swapper never swaps a page into memory unless the page will be needed.
There are many other algorithms that can be used for page replacement. For example, we can keep a counter of the number of references that have been made to each page and develop the following two schemes.
least frequently use (LFU) most frequently use (MFU)
If the optimal algorithm is not feasible, perhaps an approximation of the optimal algorithm is possible. The key distinction between the FIFO and OPT algorithms (other than looking backward versus forward in time) is that the FIFO algorithm uses the time when a page was brought into memory, whereas the OPT algorithm uses the time when a page is to be used. If we use the recent past as an approximation of the near future, then we can replace the page that has not been used for the longest period of time. This approach is the least ____________________________________ algorithm.
least recently used (LRU) algorithm
The industry is moving toward use of the _____________________________________ as a secure distributed naming mechanism. In fact, active directory is based on LDAP. Oracle Solaris and most other major operating systems include LDAP and allow it to be employed for user authentication as well as system-wide retrieval of information, such as availability of printers. Conceivably, one distributed LDAP directory could be used by an organization to store all user and resource information for all the organization's computers. The result would be secure single sign-on for users, who would enter their authentication information once for access to all computers within the organization. It would also ease system-administration efforts by combining, in one location, information that is currently scattered in various files on each system or in different distributed information services.
lightweight directory-access protocol (LDAP)
The linear address on the IA-32 is 32 bits long and is formed as follows. The segment register points to the appropriate entry in the LDT or GDT. The base and limit information about the segment in question is used to generate a ________________________. First, the limit is used to check for address validity. If the address is not valid, a memory fault is generated, resulting in a trap to the operating system. If it is valid, then the value of the offset is added to the value of the base, resulting in a 32-bit linear address.
linear address
A ______________ is effectively a pointer to another file or subdirectory. For example, a link may be implemented as an absolute or a relative path name. When a reference to a file is made, we search the directory. If the directory entry is marked as a link, then the name of the real file is included in the link information.
link
The file-allocation table (FAT) used in MS-DOS is an example of _____. Select one: a. contiguous allocation b. indexed allocation c. linked allocation d. multilevel index
linked allocation
Once the security policy is in place, the people it affects should know it well. It should be their guide. The policy should also be a ________________________ that is reviewed and updated periodically to ensure that it is still pertinent and still followed.
living document
Perhaps the best current methodology for operating-system design involves using ______________________________________.
loadable kernel modules The overall result resembles a layered system in that each kernel section has defined, protected interfaces; but it is more flexible than a layered system, because any module can call any other module. The approach is also similar to the microkernel approach in that the primary module has only core functions and knowledge of how to load and communicate with other modules; but it is more efficient, because modules do not need to invoke message passing in order to communicate.
The IA-32 architecture allows a segment to be as large as 4 GB, and the maximum number of segments per process is 16 K. The logical address space of a process is divided into two partitions. The first partition consists of up to 8 K segments that are private to that process. The second partition consists of up to 8 K segments that are shared among all the processes. Information about the first partition is kept in the ____________________________; information about the second partition is kept in the _____________________________. Each entry in the LDT and GDT consists of an 8-byte segment descriptor with detailed information about a particular segment, including the base location and limit of that segment.
local descriptor table (LDT) global descriptor table (GDT)
We can limit the effects of thrashing by using a ____________________________. With local replacement, if one process starts thrashing, it cannot steal frames from another process and cause the latter to thrash as well. However, the problem is not entirely solved. If processes are thrashing, they will be in the queue for the paging device most of the time. The average service time for a page fault will increase because of the longer average queue for the paging device. Thus, the effective access time will increase even for a process that is not thrashing.
local replacement algorithm (or priority replacement algorithm)
The ___________________ model states that, as a process executes, it moves from locality to locality. A locality is a set of pages that are actively used together (Figure 8.19). A program is generally composed of several different localities, which may overlap.
locality model To prevent thrashing, we must provide a process with as many frames as it needs. But how do we know how many frames it "needs"? There are several techniques. The working-set strategy (Section 8.6.2) starts by looking at how many frames a process is actually using. This approach defines the locality model of process execution.
Theoretically, some programs could access several new pages of memory with each instruction execution (one page for the instruction and many for data), possibly causing multiple page faults per instruction. This situation would result in unacceptable system performance. Fortunately, analysis of running processes shows that this behavior is exceedingly unlikely. Programs tend to have ___________________________, described in Section 8.6.1, which results in reasonable performance from demand paging.
locality of reference
Which of the following implementations of the access matrix is a compromise between two other implementations listed below? Select one: a. access list b. capability list c. global table d. lock-key
lock-key
The _______________________ is a compromise between access lists and capability lists. Each object has a list of unique bit patterns, called ____________. Similarly, each domain has a list of unique bit patterns, called ___________. A process executing in a domain can access an object only if that domain has a key that matches one of the locks of the object
lock-key scheme locks keys
When demand paging is used, we sometimes need to allow some of the pages to be ____________ in memory. One such situation occurs when I/O is done to or from user (virtual) memory. I/O is often implemented by a separate I/O processor. For example, a controller for a USB storage device is generally given the number of bytes to transfer and a memory address for the buffer (Figure 8.28). When the transfer is complete, the CPU is interrupted.
locked
If a process fails, most operating systems write the error information to a ___________________ to alert system operators or users that the problem occurred. The operating system can also take a _______________—a capture of the memory of the process—and store it in a file for later analysis. (Memory was referred to as the "core" in the early days of computing.) Running programs and core dumps can be probed by a debugger, which allows a programmer to explore the code and memory of a process.
log file core dump
Computer scientists often find that algorithms and technologies originally used in one area are equally useful in other areas. Such is the case with the database log-based recovery algorithms. These logging algorithms have been applied successfully to the problem of consistency checking. The resulting implementations are known as _________________________ (or journaling) file systems
log-based transaction-oriented
Consider a program that initiates a security incident only under certain circumstances. It would be hard to detect because under normal operations, there would be no security hole. However, when a predefined set of parameters was met, the security hole would be created. This scenario is known as a _________________. A programmer, for example, might write code to detect whether he was still employed; if that check failed, a daemon could be spawned to allow remote access, or code could be launched to cause damage to the site.
logic bomb
An address generated by a CPU is referred to as a ____. Select one: a. physical address b. logical address c. post relocation register address d. memory management unit (MMU) generated address
logical address
An address generated by the CPU is commonly referred to as a ______________________, whereas an address seen by the memory unit -- that is, the one loaded into the __________________________ of the memory -- is commonly referred to as a ________________________
logical address memory-address register physical address
We use logical address and virtual address interchangeably. The set of all logical addresses generated by a program is a ________________________. The set of all physical addresses corresponding to these logical addresses is a ___________________. Thus, in execution-time address-binding scheme, the logical and physical address spaces differ.
logical address space physical address space
Modern hard disk drives are addressed as large one-dimensional arrays of ________________________, where the logical block is the smallest unit of transfer. The size of a logical block is usually 512 bytes, although some disks can be low-level formatted to have a different logical block size, such as 1,024 bytes.
logical blocks
Finally, the ________________________ manages metadata information. Metadata includes all of the file-system structure except the actual data (or contents of the files). The logical file system manages the directory structure to provide the file-organization module with the information the latter needs, given a symbolic file name
logical file system
Such systems are considered __________________________. Each node may be a single processor system or a multicore system. We should note that the definition of clustered is not concrete; many commercial packages wrestle to define a clustered system and why one form is better than another. The generally accepted definition is that clustered computers share storage and are closely linked via a local-area network LAN or a faster interconnect, such as InfiniBand.
loosely coupled
A new hard disk is a blank slate: it is just a platter of a magnetic recording material. Before a disk can store data, it must be divided into sectors that the disk controller can read and write. This process is called _______________________, or _________________________.
low-level formatting physical formatting
The UNIX system uses a crude _____________________ stored at the beginning of some files to indicate roughly the type of the file -- executable program, shell script, PDF file, and so on. Not all files have magic numbers, so system features cannot be based solely on this information
magic number
The most common secondary storage device is ____. Select one: a. random access memory b. solid state disks c. tape drives d. magnetic disk
magnetic disk
control program
manages the execution of user programs to prevent errors and improper use of the computer. It is especially concerned with the operation and control of I/O devices. A slightly different view of an operating system emphasizes the need to control the various I/O devices and user programs. An operating system is a control program
operating systems may provide either ___________________ or __________________ file-locking mechanisms
mandatory advisory
The most common method used by attackers to breach security is ____. Select one: a. masquerading b. message modification c. session hijacking d. phishing
masquerading
Attackers use several standard methods in their attempts to breach security. The most common is _______________________, in which one participant in a communication pretends to be someone else (another host or another person). By masquerading, attackers breach ____________________, the correctness of identification; they can then gain access that they would not normally be allowed or escalate their privileges—obtain privileges to which they would not normally be entitled.
masquerading authentication
What are the scheduling algorithm optimization criteria?
max CPU utilization Max throughput Min turnaround time Min waiting time Min response time
interprocess communication - message passing
mechanism for processes to communicate and to synchronize their actions
Consider a sequential read of a file on disk using the standard system calls open(), read(), and write(). Each file access requires a system call and disk access. Alternatively, we can use the virtual memory techniques discussed so far to treat file I/O as routine memory accesses. This approach, known as __________________________ a file, allows a part of the virtual address space to be logically associated with the file. As we shall see, this can lead to significant performance increases.
memory mapping
Notice that marking a page invalid will have no effect if the process never attempts to access that page. Hence, if we guess right and page in all pages that are actually needed and only those pages, the process will run exactly as though we had brought in all pages. While the process executes and accesses pages that are _________________________, execution proceeds normally.
memory resident
The run-time mapping from virtual to physical addresses is done by a hardware device called the ____________________________________.
memory-management unit (MMU)
To allow more convenient access to I/O devices, many computer architectures provide ______________________________. In this case, ranges of memory addresses are set aside and are mapped to the device registers. Reads and writes to these memory addresses cause the data to be transferred to and from the device registers. This method is appropriate for devices that have fast response times, such as video controllers
memory-mapped I/O
the device controller can support _____________________. In this case, the device-control registers are mapped into the address space of the processor. The CPU executes I/O requests using the standard data-transfer instructions to read and write the device-control registers at their mapped locations in physical memory
memory-mapped I/O
But frequently it is done along with _______________________________, again to escalate privileges. Consider the damage that could be done if a request for authentication had a legitimate user's information replaced with an unauthorized user's. Yet another kind of attack is the __________________________, in which an attacker sits in the data flow of a communication, masquerading as the sender to the receiver, and vice versa. In a network communication, a man-in-the-middle attack may be preceded by a ______________________________,
message modification man-in-the-middle attack session hijacking
Microkernels use _____ for communication. Select one: a. message passing b. shared memory c. system calls d. virtualization
message passing
The first main type of authentication algorithm uses symmetric encryption. In a ______________________________, a cryptographic checksum is generated from the message using a secret key. A MAC provides a way to securely authenticate short values. If we use it to authenticate H(m) for an H that is collision resistant, then we obtain a way to securely authenticate long messages by hashing them first. Note that k is needed to compute both Sk and Vk, so anyone able to compute one can compute the other.
message-authentication code (MAC)
Local file systems can fail for a variety of reasons, including failure of the disk containing the file system, corruption of the directory structure or other disk-management information (collectively called ___________________), disk-controller failure, cable failure, and host-adapter failure
metadata
The ARM architecture also supports two levels of TLBs. At the outer level are two ___________________ -- a separate TLB for data and another for instructions. The micro TLB supports ASIDs as well. At the inner level is a single __________________. Address translation begins at the micro TLB level. In the case of a miss, the main TLB is then checked
micro TLBs main TLB
The simplest (but most expensive) approach to introducing redundancy is to duplicate every disk. This technique is called _________________. With mirroring, a logical disk consists of two physical disks, and every write is carried out on both disks. The result is called a _________________________. If one of the disks in the volume fails, the data can be read from the other. Data will be lost only if the second disk fails before the first failed disk is replaced.
mirroring mirrored volume
Although most operating systems for PCs and servers support some modified version of swapping, ______________________ typically do not support swapping in any form.
mobile systems Mobile devices generally use flash memory rather than more spacious hard disks as their persistent storage. The resulting space constraint is one reason why mobile operating-system designers avoid swapping.
Block ciphers are not in themselves secure encryption schemes. In particular, they do not directly handle messages longer than their required block sizes. However, there are many __________________________ that are based on stream ciphers, which can be used to securely encrypt longer messages.
modes of encryption
Notice that, if no frames are free, two page transfers (one out and one in) are required. This situation effectively doubles the page-fault service time and increases the effective access time accordingly. We can reduce this overhead by using a _________________. When this scheme is used, each page or frame has a modify bit associated with it in the hardware.
modify bit (or dirty bit)
Generally, viruses are the most disruptive security attacks, and because they are effective, they will continue to be written and to spread. An active security-related debate within the computing community concerns the existence of a _____________________, in which many systems run the same hardware, operating system, and application software.
monoculture
A system as large and complex as a modern operating system must be engineered carefully if it is to function properly and be modified easily. A common approach is to partition the task into small components, or modules, rather than have one ________________ system.
monolithic
The operating system is given the name of the device and the _____________________—the location within the file structure where the file system is to be attached. Some operating systems require that a file system type be provided, while others inspect the structures of the device and determine the type of file system. Typically, a mount point is an empty directory. For instance, on a UNIX system, a file system containing a user's home directories might be mounted as /home; then, to access the directory structure within that file system, we could precede the directory names with /home, as in /home/jane. Mounting that file system under /users would result in the path name /users/jane, which we could use to reach the same directory.
mount point
The _______________________ establishes the initial logical connection between a server and a client. In Solaris, each machine has a server process, outside the kernel, performing the protocol functions
mount protocol
UNIX has a ______________________ that associates prefixes of path names with specific device names. To resolve a path name, UNIX looks up the name in the mount table to find the longest matching prefix; the corresponding entry in the mount table gives the device name. This device name also has the form of a name in the file-system name space. When UNIX looks up this name in the file-system directory structures, it finds not an inode number but a <major, minor> device number. The major device number identifies a device driver that should be called to handle I/O to this device. The minor device number is passed to the device driver to index into a device table. The corresponding device-table entry gives the port address or the memory-mapped address of the device controller.
mount table
A recent trend in CPU design is to include multiple computing cores on a single chip. Such multiprocessor systems are termed _______________. They can be more efficient than multiple chips with single cores because on-chip communication is faster than between-chip communication. In addition, one chip with multiple cores uses significantly less power than multiple single-core chips
multicore
Multicore programming
multicore systems putting pressure on programmers challenges include dividing activities balance data splitting data dependency testing and debugging
Within the past several years, __________________________________ have begun to dominate the landscape of computing. Such systems have two or more processors in close communication, sharing the computer bus and sometimes the clock, memory, and peripheral devices. Multiprocessor systems first appeared prominently in servers and have since migrated to desktop and laptop systems. Recently, multiple processors have appeared on mobile devices such as smartphones and tablet computers.
multiprocessor systems (also known as parallel systems or multicore systems)
Little's Formula
n = average queue length W = average waiting time in queue (lambda) = average arrival rate into queue Little's law -- in the steady state, processes leaving the queue must equal processes arriving, thus: n = (lambda) * W - valid for any scheduling algorithm and arrival distribution For example, if on average 7 processes arrive per second, and normally 14 processes in queue, then average wait time per process = 2 seconds
A(n) ______________ allows several unrelated processes to use the pipe for communication. Select one: a. named pipe b. anonymous pipe c. LIFO d. ordinary pipe
named pipe
The call to CreateFileMapping() creates a _____________________________ called SharedObject. The consumer process will communicate using this shared-memory segment by creating a mapping to the same named object. The producer then creates a view of the memory-mapped file in its virtual address space.
named shared-memory object
A process should be allowed to access only those resources for which it has authorization. Furthermore, at any time, a process should be able to access only those resources that it currently requires to complete its task. This second requirement, commonly referred to as the ________________________ principle, is useful in limiting the amount of damage a faulty process can cause in the system. For example, when process p invokes procedure A(), the procedure should be allowed to access only its own variables and the formal parameters passed to it;
need-to-know principle
State transitions of a process
new -> ready (admitted) ready -> running (scheduler dispatch) running -> waiting (I/O or event wait) -> ready (interrupt) -> exit (terminated) waiting -> ready (I/O or event completion)
As a new process executes, it changes state
new: the process is being created running: instructions are being executed waiting: the process is waiting for some event to occur ready: The process is waiting to be assigned to a processor terminated: the process has finished execution
Systems in which memory access times vary significantly are known as __________. Select one: a. memory-mapped I/O b. demand-paged memory c. non-uniform memory access d. copy-on-write memory
non-uniform memory access
Systems in which memory access times vary significantly are known collectively as __________________________ systems, and without exception, they are slower than systems in which memory and CPUs are located on the same motherboard
non-uniform memory access (NUMA)
Some user-level processes need ___________________ I/O. One example is a user interface that receives keyboard and mouse input while processing and displaying data on the screen. Another example is a video application that reads frames from a file on disk while simultaneously decompressing and displaying the output on the display.
nonblocking
Most CPUs have two interrupt request lines. One is the ___________________ interrupt, which is reserved for events such as unrecoverable memory errors. The second interrupt line is ________________: it can be turned off by the CPU before the execution of critical instruction sequences that must not be interrupted. The maskable interrupt is used by device controllers to request service.
nonmaskable interrupt maskable
Scheduling under 1 and 4 is _____________________
nonpreemptive All other scheduling is preemptive - consider access to shared data - consider preemption while in kernel mode - consider interrupts occurring during crucial OS activities
Authentication is a component of many aspects of security. For example, digital signatures are the core of _______________________, which supplies proof that an entity performed an action. A typical example of nonrepudiation involves the filling out of electronic forms as an alternative to the signing of paper contracts. Nonrepudiation assures that a person filling out an electronic form cannot deny that he did so.
nonrepudiation
Each cache is populated with _____________ that are instantiations of the kernel data structure the cache represents. For example, the cache representing semaphores stores instances of semaphore objects, the cache representing process descriptors stores instances of process descriptor objects, and so forth.
objects
asymmetric multiprocessing
one of the two types of multi-processor systems in use today. A boss processor controls the system; the other processors either look to the boss for instruction or have predefined tasks. This scheme defines a boss-worker relationship. The boss processor schedules and allocates work to the worker processors.
Typically, an open-file table also has an ________________________ associated with each file to indicate how many processes have the file open. Each close() decreases this open count, and when the open count reaches zero, the file is no longer in use, and the file's entry is removed from the open file table
open count
The Windows CreateFile() system call is used to create a file. What is the equivalent system call in UNIX? Select one: a. ioctl() b. open() c. fork() d. createfile()
open()
Most of the file operations mentioned involve searching the directory for the entry associated with the named file. To avoid this constant searching, many systems require that an open() system call be made before a file is first used. The operating system keeps a table, called the _________________________, containing information about all open files. When a file operation is requested, the file is specified via an index into this table, so no searching is required. When the file is no longer being actively used, it is closed by the process, and the operating system removes its entry from the open-file table. create() and delete() are system calls that work with closed rather than open files.
open-file table
The base and limit registers can only be loaded by the _____________________________________, which uses a special privileged instruction
operating system
Certainly, a good part of the battle between cryptographers (those inventing ciphers) and cryptanalysts (those trying to break them) involves keys. With symmetric algorithms, both parties need the key, and no one else should have it. The delivery of the symmetric key is a huge challenge. Sometimes it is performed _____________________—say, via a paper document or a conversation. These methods do not scale well, however. Also consider the key-management challenge. Suppose a user wanted to communicate with N other users privately. That user would need N keys and, for more security, would need to change those keys frequently.
out-of-band
To implement sharing and protection, the system must maintain more file and directory attributes than are needed on a single-user system. Although many approaches have been taken to meet this requirement, most systems have evolved to use the concepts of file (or directory) ________________ (or user) and _______________
owner group The owner is the user who can change attributes and grant access and who has the most control over the file. The group attribute defines a subset of users who can share access to the file. For example, the owner of a file on a UNIX system can issue all operations on a file, while members of the file's group can execute one subset of those operations, and all other users can execute another subset of operations.
As software developers began to discover the 4-GB memory limitations of 32-bit architectures, Intel adopted a _______________________________, which allows 32-bit processors to access a physical address space larger than 4 GB. The fundamental difference introduced by PAE support was that paging went from a two-level scheme (as shown in Figure 7.23) to a three-level scheme, where the top two bits refer to a ____________________________. Figure 7.24 illustrates a PAE system with 4-KB pages. (PAE also supports 2-MB pages.)
page address extension (PAE) page directory pointer table
The 10 high-order bits reference an entry in the outermost page table, which IA-32 terms the _________________________.
page directory
What happens if the process tries to access a page that was not brought into memory? Access to a page marked invalid causes a ______________. The paging hardware, in translating the address through the page table, will notice that the invalid bit is set, causing a trap to the operating system. This trap is the result of the operating system's failure to bring the desired page into memory.
page fault
Every address generated by the CPU is divided into two parts: a __________________ and a _________________. The page number is used as an index into a _________________. The page table contains the base address of each page in physical memory. The base address is combined with the page offset to define the physical memory address that is sent to the memory unit.
page number (p) page offset (d) page table
A swap area may be in either a swap file on a regular file system or a dedicated swap partition. Each swap area consists of a series of 4-KB ______________, which are used to hold swapped pages.
page slots
The working-set model is successful, and knowledge of the working set can be useful for prepaging (Section 8.9.1), but it seems a clumsy way to control thrashing. A strategy that uses the ______________________ takes a more direct approach.
page-fault frequency (PFF)
The effective access time is directly proportional to the ___________________. If one access out of 1,000 causes a page fault, the effective access time is 8.2 microseconds. The computer will be slowed down by a factor of 40 because of demand paging! If we want performance degradation to be less than 10 percent, we need to keep the probability of page faults at the following level:
page-fault rate 220 > 200 + 7,999,800 × p , 20 > 7,999,800 × p , p < 0.0000025.
Most contemporary computers computers, however, allow the page table to be very large (for example, 1 million entries). For these machines, the use of fast registers to implement the page table is not feasible. Rather, the page table is kept in main memory, and a __________________________ points to the page table. Changing page tables requires changing only this one register, substantially reducing context-switch time.
page-table base register (PTBR)
Rarely does a process use all its address range. In fact, many processes use only a small fraction of the address space available to them. It would be wasteful in these cases to create a page table with entries for every page in the address range. Most of this table would be unused but would take up valuable memory space. Some systems provide hardware, in the form of a ______________________________________, to indicate the size of the page table. This value is checked against every logical address to verify that the address is in the valid range for the process. Failure of this test causes an error trap to the operating system.
page-table length register (PTLR)
In Solaris, when a thread incurs a page fault, the kernel assigns a page to the faulting thread from the list of free pages it maintains. Therefore, it is imperative that the kernel keep a sufficient amount of free memory available. Associated with this list of free pages is a parameter—lotsfree—that represents a threshold to begin paging. The lotsfree parameter is typically set to 1/64 the size of the physical memory. Four times per second, the kernel checks whether the amount of free memory is less than lotsfree. If the number of free pages falls below lotsfree, a process known as a _____________________ starts up.
pageout
In the context of a demand-paging system, use of the term "swapper" is technically incorrect. A swapper manipulates entire processes, whereas a ________________ is concerned with the individual pages of a process. We thus use "pager," rather than "swapper," in connection with demand paging.
pager
zero-fill-on-demand
pages have been zeroed-out before being allocated, thus erasing the previous contents
To avoid the problems of password sniffing and shoulder surfing, a system can use a set of ____________________________. When a session begins, the system randomly selects and presents one part of a password pair; the user must supply the other part. In this system, the user is ___________________________ and must __________________ with the correct answer to that challenge.
paired passwords challenged respond
____________ process create _______________ processes, which, in turn create other processes, forming a tree of processes
parent children
execution
parent and children execute concurrently OR parent waits until children terminate
A storage device can be used in its entirety for a file system. It can also be subdivided for finer-grained control. For example, a disk can be _______________________ into quarters, and each quarter can hold a separate file system. Storage devices can also be collected together into RAID sets that provide protection from the failure of a single disk (as described in Section 9.7). Sometimes, disks are subdivided and also collected into RAID sets.
partitioned
Now we are ready to turn to memory allocation. One of the simplest methods for allocating memory is to divide memory into several fixed-sized _____________________.
partitions Each partition may contain exactly one process. Thus, the degree of multiprogramming is bound by the number of partitions
We emphasize that a program by itself is not a process. A program is a _______________ entity, like the contents of a file stored on disk, whereas a _______________ is an active entity.
passive active
The phrase "My mother's name is Katherine" might yield the password "Mmn.isK!". The password is hard to crack but easy for the user to remember. A more secure system would allow more characters in its passwords. Indeed, a system might also allow passwords to include the space character, so that a user could create a ________________.
passphrase
The most common approach to authenticating a user identity is the use of ______________________. When the user identifies herself by user ID or account name, she is asked for a password. If the user-supplied password matches the password stored in the system, the system assumes that the account is being accessed by the owner of that account.
passwords
Specifying a user name and a file name defines a path in the tree from the root (the MFD) to a leaf (the specified file). Thus, a user name and a file name define a ______________. Every file in the system has a path name. To name a file uniquely, a user must know the path name of the file desired.
path name
The core activity of most vulnerability assessments is a ____________________________, in which the entity is scanned for known vulnerabilities. Because this book is concerned with operating systems and the software that runs on them, we concentrate on those aspects of vulnerability assessment.
penetration test
Another form of solid state memory is flash memory, which is popular in cameras and __________________________, in robots, and increasingly for storage on general-purpose computers
personal digital assistants (PDAs)
Sometimes, pw is just a ___________________________________________. The output of any of these systems shows the one-time password. A one-time password generator that requires input by the user involves __________________________. Two different types of components are needed in this case—for example, a one-time password generator that generates the correct response only if the PIN is valid. Two-factor authentication offers far better authentication protection than single-factor authentication because it requires "something you have" as well as "something you know."
personal identification number (PIN) two-factor authentication
Implementation of communication link
physical (shared memory, hardware bus) logical (e.g. logical properties)
In systems that support virtual memory, ____. Select one: a. virtual memory is separated from logical memory b. virtual memory is separated from physical memory c. physical memory is separated from secondary storage d. physical memory is separated from logical memory
physical memory is separated from logical memory
A database process may want to manage a chunk of memory, for example, moving blocks between disk and memory itself because it has the best knowledge of how it is going to use its data. Such _________________ of pages in memory is fairly common, and most operating systems have a system call allowing an application to request that a region of its logical address space be pinned. Note that this feature could be abused and could cause stress on the memory-management algorithms. Therefore, an application frequently requires special privileges to make such a request.
pinning
A ____ virus changes each time it is installed to avoid detection by antivirus software. Select one: a. polymorphic b. tunneling c. multipartite d. stealth
polymorphic
When it is determined that a page is going to be duplicated using copy-on-write, it is important to note the location from which the free page will be allocated. Many operating systems provide a _____________ of free pages for such requests. These free pages are typically allocated when the stack or heap for a process must expand or when there are copy-on-write pages to be managed.
pool Operating systems typically allocate these pages using a technique known as zero-fill-on-demand
ZFS combines file-system management and volume management into a unit providing greater functionality than the traditional separation of those functions allows. Disks, or partitions of disks, are gathered together via RAID sets into _____________ of storage.
pools A pool can hold one or more ZFS file systems. The entire pool's free space is available to all file systems within that pool. ZFS uses the memory model of malloc() and free() to allocate and release storage for each file system as blocks are used and freed within the file system. As a result, there are no artificial limits on storage use and no need to relocate file systems between volumes or resize volumes. ZFS provides quotas to limit the size of a file system and reservations to assure that a file system can grow by a specified amount, but those variables can be changed by the file-system owner at any time.
The CPU transfers data through these kinds of devices by reading and writing a few device registers, called an I/O ___________. To send out a long string of bytes through a memory-mapped serial port, the CPU writes one data byte to the data register and sets a bit in the control register to signal that the byte is available.
port
A device communicates with a computer system by sending signals over a cable or even through the air. The device communicates with the machine via a connection point, or ____________________—for example, a serial port. If devices share a common set of wires, the connection is called a bus. A ________________ is a set of wires and a rigidly defined protocol that specifies a set of messages that can be sent on the wires. In terms of the electronics, the messages are conveyed by patterns of electrical voltages applied to the wires with defined timings.
port bus
Companies establish _____________, which provide web accessibility to their internal servers
portals
The buddy system allocates memory from a fixed-size segment consisting of physically contiguous pages. Memory is allocated from this segment using a __________________________, which satisfies requests in units sized as a power of 2 (4 KB, 8 KB, 16 KB, and so forth). A request in units not appropriately sized is rounded up to the next highest power of 2. For example, a request for 11 KB is satisfied with a 16-KB segment.
power-of-2 allocator
Then the client generates a random 46-byte _________________ pms and sends cpms = Eke (pms) to the server. The server recovers pms = Dkd (cpms). Now both the client and the server are in possession of nc, ns, and pms, and each can compute a shared 48-byte _________________ ms = H(nc, ns, pms). Only the server and client can compute ms, since only they know pms. Moreover, the dependence of ms on nc and ns ensures that ms is a fresh value—that is, a session key that has not been used in a previous communication.
premaster secret master secret
LIFO
principle for adding and removing items, meaning that the last item placed onto a stack is the first item removed.
Frequently, a guiding principle can be used throughout a project, such as the design of an operating system. Following this principle simplifies design decisions and keeps the system consistent and easy to understand. A key, time-tested guiding principle for protection is the ________________________________. It dictates that programs, users, and even systems be given just enough privileges to perform their tasks.
principle of least privilege
earliest deadline first scheduling (EDF)
priorities are assigned according to deadlines: - the earlier the deadline, the higher the priority; - the later the deadline, the lower the priority
Recent releases of the Solaris kernel have provided enhancements of the paging algorithm. One such enhancement involves recognizing pages from shared libraries. Pages belonging to libraries that are being shared by several processes—even if they are eligible to be claimed by the scanner—are skipped during the page-scanning process. Another enhancement concerns distinguishing pages that have been allocated to processes from pages allocated to regular files. This is known as _____________________________
priority paging
The dual mode of operation provides us with the means for protecting the operating system from errant users—and errant users from one another. We accomplish this protection by designating some of the machine instructions that may cause harm as __________________________________.
privileged instructions The hardware allows privileged instructions to be executed only in kernel mode. If an attempt is made to execute a privileged instruction in user mode, the hardware does not execute the instruction but rather treats it as illegal and traps it in the operating system
The procedure-call mechanism of Hydra was designed as a direct solution to the ___________________________________________________________. This problem is defined as follows. Suppose that a program can be invoked as a service by a number of different users (for example, a sort routine, a compiler, a game). When users invoke this service program, they take the risk that the program will malfunction and will either damage the given data or retain some access right to the data to be used (without authority) later.
problem of mutually suspicious subsystems
A(n) ________ is the unit of work in a system. Select one: a. process b. operating system c. timer d. mode bit
process
System calls can be grouped into size major categories:
process control file manipulation device manipulation information maintenance communications protection
process termination
process executes last statement and asks the operating system to delete it (exit) - output data from child to parent (via wait) - process' resources are deallocated by operating system Parent may terminate execution of child processes (abort) - child has exceeded allocated resources - task assigned to child is no longer acquired - if parent is executing (some operating systems do not allow child to continue if its parent terminates)
Generally, process is identified and managed via a ________________________
process identifier (pid)
Process Control Block (PCB) information in order
process state process number process counter registers memory limits list of open files ...
A single-threaded process has one _______________________ specifying the next program to execute
program counter The execution of such a process must be sequential. The CPU executes one instruction of the process after another, until the process completes. Further, at any time, one instruction at most is executed on behalf of the process. Thus, although two processes may be associated with the same program, they are nevertheless considered two separate execution sequences. A multithreaded process has multiple program counters, each pointing to the next instruction to execute for a given thread
A process includes:
program counter stack data section
If the CPU uses polling to watch the control bit, constantly looping to see whether the device is ready, this method of operation is called ________________________.
programmed I/O (PIO)
For a device that does large transfers, such as a disk drive, it seems wasteful to use an expensive general-purpose processor to watch status bits and to feed data into a controller register one byte at a time—a process termed _________________. Many computers avoid burdening the main CPU with PIO by offloading some of this work to a special-purpose processor called a _______________________ controller.
programmed I/O (PIO) direct-memory-access (DMA)
application programs
programs that are useful in solving common problems or performing common operations. These include web browsers, word processors, text formatters, spreadsheets, database systems, compilers, plotting and statistical-analysis packages, and games.
To facilitate the scheme just described, a process operates within a _________________________, which specifies the resources that the process may access. Each domain defines a set of objects and the types of operations that may be invoked on each object. The ability to execute an operation on an object is an ________________.
protection domain access right
Operating systems for mobile computers
provide an environment in which a user can easily interface with the computer to execute programs.
System calls
provide an interface to the services made available by an operating system. These calls are generally available as routines written in C and C++, although certain low-level tasks (for example, tasks where hardware must be accessed directly) may have to be written using assembly-language instructions.
File systems
provide efficient and convenient access to the disk by allowing data to be stored, located, and retrieved easily. A file system poses two quite different design problems. The first problem is defining how the file system should look to the user. This task involves defining a file and its attributes, the operations allowed on a file, and the directory structure for organizing files. The second problem is creating algorithms and data structures to map the logical file system onto the physical secondary-storage devices.
In RSA, ke is the __________________, and kd is the ________________. N is the product of two large, randomly chosen prime numbers p and q (for example, p and q are 512 bits each). It must be computationally infeasible to derive kd, N from ke, N, so that ke need not be kept secret and can be widely disseminated. The encryption algorithm is Eke, N(m) = mke mod N, where ke satisfies kekd mod (p − 1)(q − 1) = 1. The decryption algorithm is then Dkd, N(c) = ckd mod N.
public key private key
Any sender can use that key to encrypt a communication, but only the key creator can decrypt the communication. This scheme, known as _____________________________, was a breakthrough in cryptography. No longer must a key be kept secret and delivered securely. Instead, anyone can encrypt a message to the receiving entity, and no matter who else is listening, only that entity can decrypt the message.
public-key encryption
In the extreme case, we can start executing a process with no pages in memory. When the operating system sets the instruction pointer to the first instruction of the process, which is on a non-memory-resident page, the process immediately faults for the page. After this page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs is in memory. At that point, it can execute with no more faults. This scheme is _________________________: never bring a page into memory until it is required.
pure demand paging
The two general approaches to load balancing are __________ and ____________. Select one: a. soft affinity, hard affinity b. coarse-grained, fine-grained c. soft real-time, hard real-time d. push migration, pull migration
push migration, pull migration
As we shall see, tasks that are waiting to be run on an available CPU are often organized in _________________.
queues
We say that the device controller ________________ an interrupt by asserting a signal on the interrupt request line, the CPU _________________ the interrupt and ___________________ it to teh interrupt handler, and the handler ________________ the interrupt by servicing the device
raises catches dipatches clears
Some operating systems give special programs the ability to use a disk partition as a large sequential array of logical blocks, without any file-system data structures. This array is sometimes called the ___________________, and I/O to this array is termed raw I/O. For example, some database systems prefer raw I/O because it enables them to control the exact disk location where each database record is stored. Raw I/O bypasses all the file-system services, such as the buffer cache, file locking, prefetching, space allocation, file names, and directories. We can make certain applications more efficient by allowing them to implement their own special-purpose storage services on a raw partition, but most applications perform better when they use the regular file-system services.
raw disk
some operating systems give special programs the ability to use a disk partition as a large sequential array of logical blocks, without any file-system data structures. This array is sometimes called the _____________, and I/O to this array is termed raw I/O.
raw disk
Alternatively, swap space can be created in a separate ___________________. No file system or directory structure is placed in this space. Rather, a separate swap-space storage manager is used to allocate and deallocate the blocks from the raw partition. This manager uses algorithms optimized for speed rather than for storage efficiency, because swap space is accessed much more frequently than file systems (when it is used). Internal fragmentation may increase, but this trade-off is acceptable because the life of data in the swap space generally is much shorter than that of files in the file system.
raw partition
With ___________________, a requested page and several subsequent pages are read and cached. These pages are likely to be requested after the current page is processed. Retrieving these data from the disk in one transfer and caching them saves a considerable amount of time.
read-ahead
When a CPU receives a reset event—for instance, when it is powered up or rebooted—the instruction register is loaded with a predefined memory location, and execution starts there. At that location is the initial bootstrap program. This program is in the form of _________________________, because the RAM is in an unknown state at system startup. ROM is convenient because it needs no initialization and cannot easily be infected by a computer virus.
read-only memory (ROM)
A system maintains a _____________________ consisting of all processes whose memory images are on the backing store or in memory and are ready to run
ready queue
multicore processors
recent trend to place multiple proccessor cores on same physical chip Faster and consumes less power Multiple threads per core are also growing - takes advantage of memory stall to make progress on another thread while memory retrieve happens
The solution to the problem of reliability is to introduce ___________________; we store extra information that is not normally needed but can be used in the event of failure of a disk to rebuild the lost information. Thus, even if a disk fails, data are not lost
redundancy
A variety of disk-organization techniques, collectively called _________________________________, are commonly used to address the performance and reliability issues
redundant arrays of independent disks (RAID)
An advantage of paging is the possibility of sharing common code. This consideration is particularly important in a time-sharing environment. Consider a system that supports 40 users, each of whom executes a text editor. If the text editor consists of 150 KB of code and 50 KB of data space, we need 8,000 KB to support the 40 users. If the code is ____________________________, however, it can be shared, as shown in Figure 7.16. Here, we see three processes sharing a three-page editor—each page 50 KB in size (the large page size is used to simplify the figure). Each process has its own data page.
reentrant code (or pure code)
Few computer systems provide sufficient hardware support for true LRU page replacement. In fact, some systems provide no hardware support, and other page-replacement algorithms (such as a FIFO algorithm) must be used. Many systems provide some help, however, in the form of a _____________________. The reference bit for a page is set by the hardware whenever that page is referenced (either a read or a write to any byte in the page). Reference bits are associated with each entry in the page table.
reference bit
We evaluate an algorithm by running it on a particular string of memory references and computing the number of page faults. The string of memory references is called a ___________________. We can generate reference strings artificially (by using a random-number generator, for example), or we can trace a given system and record the address of each memory reference. The latter choice produces a large number of data (on the order of 1 million addresses per second). To reduce the number of data, we use two facts.
reference string
Mobile computing
refers to computing on handheld smartphones and tablet computers. These devices share the distinguishing physical features of being portable and lightweight. Historically, compared with desktop and laptop computers, mobile systems gave up screen size, memory capacity, and overall functionality in return for handheld mobile access to services such as e-mail and web browsing. Over the past few years, however, features on mobile devices have become so rich that the distinction in functionality between, say, a consumer laptop and a tablet computer may be difficult to discern (except a laptop is much much more powerful lol)
The hardware implementation of the page table can be done in several ways. In the simplest case, the page table is implemented as a set of dedicated _________________.
registers These registers should be built with very high-speed logic to make the paging-address translation efficient. Every access to memory must go through the paging map, so efficiency is a major consideration.
Convoy effect
short processes behind long processes (consider one CPU-bound and many I/O-bound processes
Load time -- If it is not known at compile time where the process will reside in memory, then the compiler must generate ___________________. In this case, final binding is delayed until load time. If the starting address changes, we need only reload the user code to incorporate this changed value.
relocatable code
remote procedure calls (RPC)
remote procedure calls (RPC) abstracts procedure calls between processes on networked systems Stubs -- client-side proxy for the actual procedure on the server The client-side stub locates the server and marshalls the parameters The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server
A disk can be ____________________, allowing different disks to be mounted as needed. Removable hard disks generally consist of one platter, held in a plastic case to prevent damage while not in the disk drive. Other forms of removable disks include CDs, DVDs, and Blu-ray discs as well as removable flash-memory devices known as ________________________ (which are a type of solid-state drive).
removable flash drives
A blocking send() and blocking receive() is known as a(n) _________________. Select one: a. synchronized message b. rendezvous c. blocked message d. asynchronous message
rendezvous
Another common attack is to replay a captured exchange of data. A ____________________ consists of the malicious or fraudulent repeat of a valid data transmission.
replay attack
Another feature that naturally results from the WAFL file system implementation is ___________________, the duplication and synchronization of a set of data over a network to another system. First, a snapshot of a WAFL file system is duplicated to another system
replication
list
represents a collection of data values as a sequence. The most common method for implementing this structure is a linked list (in which items are linked to one another)
Types of system calls with device management
request device, release device read, write, reposition get device attributes, set device attributes logically attach or detach devices
Common system calls used within Device Management
request() -- a system with multiple users uses this to ensure the exclusive use of a device release() -- system call we use when we are finished with a device read(), write(), reposition() -- We can use these once the device has been requested (and allocated to us)
local replacement
requires that each process select from only its own set of allocated frames
With a smaller page size, then, we have better _______________, allowing us to isolate only the memory that is actually needed. With a larger page size, we must allocate and transfer not only what is needed but also anything else that happens to be in the page, whether it is needed or not. Thus, a smaller page size should result in less I/O and less total allocated memory.
resolution
We _________________ the link by using that path name to locate the real file. Links are easily identified by their format in the directory entry (or by having a special type on systems that support types) and are effectively indirect pointers.
resolve
The benefits of multithreaded programming can be broken down into four categories:
responsiveness resource sharing economy scalability
For macro viruses, one defense is to exchange Microsoft Word documents in an alternative file format called _______________________. Unlike the native Word format, RTF does not include the capability to attach macros.
rich-text format (RTF)
Hydra also provides ______________________________. This scheme allows a procedure to be certified as trustworthy to act on a formal parameter of a specified type on behalf of any process that holds a right to execute the procedure. The rights held by a trustworthy procedure are independent of, and may exceed, the rights held by the calling process.
rights amplification
In MULTICS, the protection domains are organized in a _____. Select one: a. star structure b. linear structure c. ring structure d. directory structure
ring structure
Solaris 10 advances the protection available in the operating system by explicitly adding the principle of least privilege via __________________________________. This facility revolves around privileges. A privilege is the right to execute a system call or to use an option within that system call (such as opening a file with write access). Privileges can be assigned to processes, limiting them to exactly the access they need to perform their work.
role-based access control (RBAC)
Privileges and programs can also be assigned to _______________. Users are assigned roles or can take roles based on passwords to the roles. In this way, a user can take a role that enables a privilege, allowing the user to run a program to accomplish a specific task.. This implementation of privileges decreases the security risk associated with superusers and setuid programs.
roles
The ___________________________, which contains the operating-system kernel and sometimes other system files, is mounted at boot time. Other volumes can be automatically mounted at boot or manually mounted later, depending on the operating system. As part of a successful mount operation, the operating system verifies that the device contains a valid file system
root partition
The __________________________ is the additional time for the disk to rotate the desired sector to the disk head. The disk ____________________ is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer.
rotational latency bandwidth
When the disk is in use, a drive motor spins it at high speed. Most drives rotate 60 to 250 times per second, specified in terms of _______________________________. Common drives spin at 5,400, 7,200, 10,000, and 15,000 RPM.
rotations per minute (RPM)
The best protection against computer viruses is prevention, or the practice of __________________________. Purchasing unopened software from vendors and avoiding free or pirated copies from public sources or disk exchange offer the safest route to preventing infection.
safe computing
Another popular technique is to run a program in a __________________, which is a controlled or emulated section of the system. The antivirus software analyzes the behavior of the code in the sandbox before letting it run unmonitored. Some antivirus programs also put up a complete shield rather than just scanning files within a file system. They search boot sectors, memory, inbound and outbound e-mail, files as they are downloaded, files on removable devices or media, and so on.
sandbox
scatter-gather method is useful for a variety of reasons Multiple separate buffers can have their contents transferred via one system call, avoiding context-switching and system-call overhead. Without vectored I/O, the data might first need to be transferred to a larger buffer in the right order and then transmitted, which is inefficient
scatter-gather
This example buffer-overflow attack reveals that considerable knowledge and programming skill are needed to recognize exploitable code and then to exploit it. Unfortunately, it does not take great programmers to launch security attacks. Rather, one cracker can determine the bug and then write an exploit. Anyone with rudimentary computer skills and access to the exploit—a so-called ___________________—can then try to launch the attack at target systems.
script kiddie
The number of bits of history included in the shift register can be varied, of course, and is selected (depending on the hardware available) to make the updating as fast as possible. In the extreme case, the number can be reduced to zero, leaving only the reference bit itself. This algorithm is called the __________________________________________ algorithm.
second-chance page-replacement
Thus, most computer systems provide _____________________ as an extension for main memory.
secondary storage The main requirement for secondary storage is that it be able to hold large quantities of data permanently
As an alternative to sector sparing, some controllers can be instructed to replace a bad block by _____________________. Here is an example: Suppose that logical block 17 becomes defective and the first available spare follows sector 202. Sector slipping then remaps all the sectors from 17 to 202, moving them all down one spot. That is, sector 202 is copied into the spare, then sector 201 into 202, then 200 into 201, and so on, until sector 18 is copied into sector 19. Slipping the sectors in this way frees up the space of sector 18 so that sector 17 can be mapped to it.
sector slipping
More sophisticated disks are smarter about bad-block recovery. The controller maintains a list of bad blocks on the disk. The list is initialized during the low-level formatting at the factory and is updated over the life of the disk. Low-level formatting also sets aside spare sectors not visible to the operating system. The controller can be told to replace each bad sector logically with one of the spare sectors. This scheme is known as ____________________ or __________________.
sector sparing forwarding
We say that a system is __________________ if its resources are used and accessed as intended under all circumstances. Unfortunately, total security cannot be achieved. Nonetheless, we must have mechanisms to make security breaches a rare occurrence, rather than the norm
secure
When a user logs on, Windows 7 creates a ______________________________________ that includes the security ID for the user, security IDs for any groups of which the user is a member, and a list of any special privileges that the user has. Examples of special privileges include backing up files and directories, shutting down the computer, logging on interactively, and changing the system clock. Every process that Windows 7 runs on behalf of a user will receive a copy of the access token.
security access token
The simple subject is assigned a __________________________ based on the security access token of the user.
security context
Security attributes of an object in Windows 7 are described by a _____________________________________. The security descriptor contains the security ID of the owner of the object (who can change the access permissions), a group security ID used only by the POSIX subsystem, a discretionary access-control list that identifies which users or groups are allowed (and which are explicitly denied) access, and a system access-control list that controls which auditing messages the system will generate.
security descriptor
A network firewall limits network access between the two ____________________________________ and monitors and logs all connections. It can also limit connections based on source or destination address, source or destination port, or direction of the connection. For instance, web servers use HTTP to communicate with web browsers
security domains
The first step toward improving the security of any aspect of computing is to have a _________________________. Policies vary widely but generally include a statement of what is being secured. For example, a policy might state that all outside-accessible applications must have a code review before being deployed, or that users should not share their passwords, or that all connection points between a company and the outside must have port scans run every six months.
security policy
In fact, some people advocate __________________________________, stating that no tools should be written to test security, because such tools can be used to find (and exploit) security holes. Others believe that this approach to security is not a valid one, pointing out, for example, that crackers could write their own tools. It seems reasonable that security through obscurity be considered one of the layers of security only so long as it is not the only layer.
security through obscurity
Each entry in the segment table has a _____________________ and a ____________________.
segment base segment limit The segment base contains the starting physical address where the segment resides in memory, and the segment limit specifies the length of the segment.
With segmentation, a logical address consists of _____. Select one: a. segment number and offset b. segment name and offset c. segment number and page number d. segment table and segment number
segment number and offset
Although the programmer can now refer to objects in the program by a two-dimensional address, the actual physical memory is still, of course, a one-dimensional sequence of bytes. Thus, we must define an implementation to map two-dimensional programmer-defined addresses into one-dimensional physical addresses. This mapping is effected by a _________________________.
segment table
Memory management in IA-32 systems is divided into two components—_______________________—and works as follows: The CPU generates logical addresses, which are given to the segmentation unit. The segmentation unit produces a linear address for each logical address. The linear address is then given to the paging unit, which in turn generates the physical address in main memory. Thus, the segmentation and paging units form the equivalent of the memory-management unit (MMU).
segmentation and paging
Short-term scheduler
selects from among the processes in ready queue, and allocates the CPU to one of them - queue may be ordered in various ways
short-term scheduler (or CPU scheduler)
selects which process should be executed next and allocates CPU Short-term scheduler is invoked very frequently (milliseconds) -> (must be fast)
long-term scheduler (or job scheduler)
selects which processes should be brought into the ready queue the long-term scheduler is invoked very infrequently (seconds, minutes) -> (may be slow) The long-term scheduler also controls the degree of multiprogramming
Many early storage devices, including paper tape and core memories, are relegated to museums now that magnetic tape and ______________________ have become faster and cheaper
semiconductor memory lol yeah magnetic tape is not being used anymore. That's old as shizzz
With direct communication, processes must name each other explicitly:
send (P, message) -- send a message to process P receive(Q, message) -- receive a message from process Q
IPC (interprocess communication) provides two operations:
send (message) -- message size fixed or variable receive (message)
Primitives are defined as for indirect communication:
send(A, message) -- send a message to mailbox A receive(A, message) -- receive a message from mailbox A
The simplest file access method is ____. Select one: a. sequential access b. logical access c. relative access d. direct access
sequential access
The simplest access method is __________________________. Information in the file is processed in order, one record after the other. This mode of access is by far the most common; for example, editors and compilers usually access files in this fashion.
sequential access Reads and writes make up the bulk of the operations on a file. A read operation—read_next()—reads the next portion of the file and automatically advances a file pointer, which tracks the I/O location. Similarly, the write operation—write_next()—appends to the end of the file and advances to the end of the newly written material (the new end of file).
Files store information. When it is used, this information must be accessed and read into computer memory. The information in the file can be accessed in several ways. Some systems provide only one access method for files. while others support many access methods, and choosing the right one for a particular application is a major design problem. These are some of the access methods:
sequential access direct access other methods can be built on top of a direct-access method. These methods generally involve the construction of an index for the file.
Remote file systems allow a computer to mount one or more file systems from one or more remote machines. In this case, the machine containing the files is the _________________, and the machine seeking access to the files is the ____________. The client-server relationship is common with networked machines. Generally, the server declares that a resource is available to clients and specifies exactly which resource (in this case, which files) and exactly which clients.
server client
A __________________________ is a process implemented as a protected server that uses the security context of the client when acting on the client's behalf
server subject
It seems reasonable to service all the requests close to the current head position before moving the head far away to service other requests. This assumption is the basis for the ___________________________ algorithm. The SSTF algorithm selects the request with the least seek time from the current head position. In other words, SSTF chooses the pending request closest to the current head position
shortest-seek-time-first (SSTF)
As PCs have become faster, more powerful, and cheaper, designers have shifted away from centralized system architecture. Terminals connected to centralized systems are now being supplanted by PCs and mobile devices. Correspondingly, user-interface functionality once handled directly by centralized systems is increasingly being handled by PCs, quite often through a web interface. As a result, many of today's systems act as __________________________ to satisfy requests generated by ______________________.
server systems client systems
system-call interface
serves as the link to system calls made available by the operating system. The system-call interface intercepts function calls in the API and invokes the necessary system calls within the operating system. Typically, a number is associated with each system call, and the system-call interface maintains a table indexed according to these numbers. The system call interface then invokes the intended system call in the operating-system kernel and returns the status of the system call and any return values.
SSL is a complex protocol with many options. Here, we present only a single variation of it. Even then, we describe it in a very simplified and abstract form, so as to maintain focus on its use of cryptographic primitives. What we are about to see is a complex dance in which asymmetric cryptography is used so that a client and a server can establish a secure _____________________ that can be used for symmetric encryption of the session between the two—all of this while avoiding man-in-the-middle and replay attacks. For added cryptographic strength, the session keys are forgotten once a session is completed. Another communication between the two will require generation of new session keys.
session key
Common system calls used in Protection
set_permission() and get_permission() -- manipulate the permission settings of resources such as files and disks allow_user() and deny_user() -- system calls that specify whether particular users can or cannot be allowed to access certain resources
In the UNIX operating system, a domain is associated with the user. Switching the domain corresponds to changing the user identification temporarily. This change is accomplished through the file system as follows. An owner identification and a domain bit (known as the __________________) are associated with each file. When the setuid bit is on, and a user executes that file, the userID is set to that of the owner of the file. When the bit is off, however, the userID does not change. For example, when a user A (that is, a user with userID = A) starts executing a file owned by B, whose associated domain bit is off, the userID of the process is set to A. When the setuid bit is on, the userID is set to that of the owner of the file: B. When the process exits, this temporary userID change ends.
setuid bit
small computer-systems interface (SCSI) controller
seven or more devices can be attached to this controller. A device controller maintains some local buffer storage and a set of special purpose registers. The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.
More than one version of a library may be loaded into memory, and each program uses its version information to decide which copy of the library to use. Versions with minor changes retain the same version number, whereas versions with major changes increment the number. Thus, only programs that are compiled with the new library version are affected by any incompatible changes incorporated in it. Other programs linked before the new library was installed will continue using the older library. This system is also known as ________________________.
shared libraries
Cooperating processes need interprocess communication (IPC). There are two models of IPC:
shared memory message passing
The system uses the extension to indicate the type of the file and the type of operations that can be done on that file. Only a file with a .com, .exe, or .sh extension can be executed, for instance. The .com and .exe files are two forms of binary executable files, whereas the .sh file is a ___________________ containing, in ASCII format, commands to the operating system.
shell script
____________________ are very common on systems that are command-line oriented
shell scripts
In addition to being guessed, passwords can be exposed as a result of visual or electronic monitoring. An intruder can look over the shoulder of a user (______________________) when the user is logging in and can learn the password easily by watching the keyboard. Alternatively, anyone with access to the network on which a computer resides can seamlessly add a network monitor, allowing him to __________, or watch, all data being transferred on the network, including user IDs and passwords. Encrypting the data stream containing the password solves this problem
shoulder surfing sniff
the simplest directory structure is the ________________________ directory. All of the files are contained in the same directory, which is easy to support and understand
single-level directory
A second strategy for allocating kernel memory is known as _________________________. A slab is made up of one or more physically contiguous pages. A ___________consists of one or more slabs. There is a single cache for each unique kernel data structure—for example, a separate cache for the data structure representing process descriptors, a separate cache for file objects, a separate cache for semaphores, and so forth.
slab allocation cache
Bluetooth and 802.11 devices use wireless technology to communicate over several feet, in essence creating a ____. Select one: a. local-area network b. wide-area network c. small-area network d. metropolitan-area network
small-area network
The ____ of a process contains temporary data such as function parameters, return addresses, and local variables. Select one: a. text section b. data section c. program counter d. stack
stack
Because the performance and addressing characteristics of network I/O differ significantly from those of disk I/O, most operating systems provide a network I/O interface that is different from the read()-write()-seek() interface used for disks. One interface available in many operating systems, including UNIX and Windows, is the network __________________ interface.
socket
communications in client-server systems
sockets remote procedure calls remote method invocation (Java)
The ECC is an error-correcting code because it contains enough information, if only a few bits of data have been corrupted, to enable the controller to identify which bits have changed and calculate what their correct values should be. It then reports a recoverable _____________________. The controller automatically does the ECC processing whenever a sector is read or written.
soft error
The second kind of capability is the so-called _____________________________, which is protected, but not interpreted, by the CAP microcode. It is interpreted by a protected (that is, privileged) procedure, which may be written by an application programmer as part of a subsystem.
software capability
Specifying and designing an operating system is a highly creative task. Although no textbook can tell you how to do it, general principles have been developed in the field of _________________________
software engineering
Another example is found in the implementation of system calls. Usually, a program uses library calls to issue system calls. The library routines check the arguments given by the application, build a data structure to convey the arguments to the kernel, and then execute a special instruction called a ______________________, or ____________. This instruction has an operand that identifies the desired kernel service. When a process executes the trap instruction, the interrupt hardware saves the state of the user code, switches to kernel mode, and dispatches to the kernel routine that implements the requested service.
software interrupt trap
A(n) ____ file is a sequence of functions. Select one: a. text b. source c. object d. executable
source
Clustered page tables are particularly useful for _____________ address spaces, where memory references are noncontiguous and scattered throughout the address space
sparse
Virtual address spaces that include holes are known as ____________ address spaces. Using a sparse address space is beneficial because the holes can be filled as the stack or heap segments grow or if we wish to dynamically link libraries (or possibly other shared objects) during program execution.
sparse
limit register
specifies the size of the range For example, if the base register holds 300040 and the limit register is 120900, then the program can legally access all addresses from 300040 through 420939 (inclusive)
A(n) ____ is a buffer that holds output for a device that cannot accept interleaved data streams. Select one: a. escape b. block device c. cache d. spool
spool
Another variation on the Trojan horse is ________________________. Spyware sometimes accompanies a program that the user has chosen to install. Most frequently, it comes along with freeware or shareware programs, but sometimes it is included with commercial software. The goal of spyware is to download ads to display on the user's system, create pop-up browser windows when certain sites are visited, or capture information from the user's system and return it to a central site. This latter practice is an example of a general category of attacks known as _________________________, in which surreptitious communication occurs.
spyware covert channels
Like optimal replacement, LRU replacement does not suffer from Belady's anomaly. Both belong to a class of page-replacement algorithms, called ________________________, that can never exhibit Belady's anomaly
stack algorithms
Completing memory access may take many cycles of the CPU clock. In such cases, the processor normally needs to _________________, since it does not have the data required to complete the instruction that it is executing
stall This situation is intolerable because of the frequency of memory accesses. The remedy is to add fast memory between the CPU and main memory, typically on the CPU chip for fast access. Such a cache was described in Section 1.8.3. To manage a cache built into the CPU, the hardware automatically speeds up memory access without any operating-system control.
To implement this kind of recovery from failure, some kind of _____________________ may be maintained on both the client and the server. If both server and client maintain knowledge of their current activities and open files, then they can seamlessly recover from a failure.
state information
In the situation where the server crashes but must recognize that it has remotely mounted exported file systems and opened files, NFS takes a simple approach, implementing a _______________DFS. In essence, it assumes that a client request for a file read or write would not have occurred unless the file system had been remotely mounted and the file had been previously open.
stateless
The association between a process and a domain may be either ________________, if the set of resources available to the process is fixed throughout the process's lifetime, or __________________. As might be expected, establishing dynamic protection domains is more complicated than establishing static protection domains
static dynamic
Some operating systems support only ____________________, in which system libraries are treated like any other object module and are by the loader into the binary program image.
static linking Dynamic linking, in contrast, is similar to dynamic loading. Here, though, linking rather than loading, is postponed until execution time
A sense key reports on the failure of a SCSI device by ____. Select one: a. stating the general category of failure b. stating the general nature of the failure c. giving detailed information about the exact cause of failure d. maintaining internal pages of error-log information
stating the general nature of the failure
A _____ is a private network connecting servers and storage units. Select one: a. host-attached storage b. network-attached storage c. storage area network d. private area network
storage area network
High-end workstations and servers generally use more sophisticated I/O architectures such as fibre channel (FC), a high-speed serial architecture that can operate over optical fiber or over a four-conductor copper cable. It has two variants. One is a large switched fabric having a 24-bit address space. This variant is expected to dominate in the future and is the basis of _______________________________________________.
storage-area network (SANs)
A stream is a full-duplex connection between a device driver and user-level process. It consists of a _________________________ that interfaces with the user process, a _______________ that controls the device, and zero or more ______________________ between the stream head and the driver end. Each of these components contains a pair of queues -- a read queue and a write queue.
stream head driver end stream modules
With dynamic linking, a ______________ is included in the image for each library-routine reference. The stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine or how to load the library if the routine is not already present
stub
A ____________________ is used to track and manage permissions for each program that a user runs. It is composed of the user's access token and the program acting on behalf of the user. Since Windows 7 operates with a client-server model, two classes of subjects are used to control access: simple subjects and server subjects
subject
Container objects
such as directories, can logically contain other objects. By default, when an object is created within a container object, the new object inherits permissions from the parent object. Similarly, if the user copies a file from one directory to a new directory, the file will inherit the permissions of the destination directory
application programs
such as word processors, spreadsheets, compilers, and web browsers--define the ways in which these resources are used to solve users' computing problems. The operating system controls the hardware and coordinates its use among the various application programs for the various users
distributed lock manager (DLM)
supplies access control and locking to ensure that no conflicting operations occur
Personal computer (PC) operating systems
support complex games, business applications, and everything in between
kernel threads
supported by the kernel examples of this: Windows XP/2000 Solaris Linux Tru64 UNIX Mac OS X
Associated with each swap area is a _____________________-- an array of integer counters, each corresponding to a page slot in the swap area. If the value of a counter is 0, the corresponding page slot is available.
swap map
A process must be in memory to be executed. A process, however, can be __________________ temporarily out of memory to a ____________________ and then brought back into memory for continued execution.
swapped backing store Swapping makes it possible for the total physical address space of all processes to exceed the real physical memory of the system, thus increasing the degree of multiprogramming in a system
Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves:
switching context switching to user mode jumping to the proper location in the user program to restart that program
In a _____________________________________, the same key is used to encrypt and to decrypt. Therefore, the secrecy of k must be protected. Note that the key exchange can take place directly between the two parties or via a trusted third party (that is, a certificate authority)
symmetric encryption algorithm
Blocking is considered __________________
synchronous Blocking send has the sender block until the message is received Blocking receive has the receiver block until a message is available
It is possible to design, code, and implement an operating system specifically for one machine at one site. More commonly, however, operating systems are designed to run on any of class of machines at a variety of sites with a variety of peripheral configurations. The system must then be configured or generated for each specific computer site, a process sometimes known as ___________________________.
system generation (SYSGEN)
signature-based detection
system input or network traffic is examined for specific behavior patterns (or signatures) known to indicate attacks
Once the kernel is loaded and executing, it can start providing services to the system and its users. Some services are provided outside of the kernel, by system programs that are loaded into memory at boot time to become _______________________ or _______________________ that run the entire time the kernel is running.
system processes system daemons
Along with the kernel, there are two other types of programs:
system programs (which are associated with the operating system but not necessarily part of the program) application programs (which include all programs not associated with the operation of the system)
In capability lists, each object has a ____ to denote its type. Select one: a. gate b. tag c. key d. lock
tag
hash function
takes data as its input, performs a numeric operation on this data, and returns a numeric value. This numeric value can then be used as an index into a table (typically an array) to quickly retrieve the data. Whereas searching for a data item through a list of size n can require up to O(n) comparisons in the worst case, using a hash function for retrieving data from table can be as good as O(1) in the worst case, depending on implementation details.
The Linux CFS scheduler identifies _____________ as the interval of time during which every runnable task should run at least once. Select one: a. virtual run time b. targeted latency c. nice value d. load balancing
targeted latency
A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large computer. Select one: a. terminal concentrator b. network daemon c. I/O channel d. context switch coordinator
terminal concentrator
A microkernel is a kernel ____. Select one: a. containing many components that are optimized to reduce resident memory size b. that is compressed before loading in order to reduce its resident memory size c. that is compiled to produce the smallest size possible when stored to disk d. that is stripped of all nonessential components
that is stripped of all nonessential components
Cocoa
the Cocoa environment specifies an API for the Objective-C programming language, which is used for writing Mac OS X applications.
optimal page-replacement algorithm
the algorithm that has the lowest page-fault rate of all algorithms and will never suffer from Belady's anomaly. Such an algorithm does exist and has been called OPT or MIN. It is simply this: Replace the page that will not be used for the longest period of time. Use of this page-replacement algorithm guarantees the lowest possible page-fault rate for a fixed number of frames
relative block number
the block number provided by the user to the operating system. The relative block number is an index relative to the beginning of the file. Thus, the first relative block of the file is 0, the next is 1, and so on, even though the absolute disk address may be 14703 for the first block and 3192 for the second.
hardware
the central processing unit (CPU), the memory, the input/output (I/O) devices -- provides the basic computing resources for the system.
The advantages of using a higher-level language, or at least a systems-implementation language, for implementing operating systems are the same as those gained when the language is used for application programs:
the code can be written faster, is more compact, and is easier to understand and debug. An operating system is far easier to port--to move to some other hardware--if written in a higher-level language
closed-source
the code is not available at all -- Microsoft Windows a well-known example of the opposite of open-source
In a paired-password system, ____. Select one: a. the user specifies two passwords b. the computer supplies one part of a password and the user enters the other part c. passwords must contain equal amounts of numbers and digits paired together d. two users must enter their own separate password to gain access to the system
the computer supplies one part of a password and the user enters the other part
A mount point is _____. Select one: a. a root of the file system b. a location of a shared file system c. only appropriate for shared file systems d. the location within the file structure where the file system is to be attached
the location within the file structure where the file system is to be attached
layered approach
the operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface. Essentially if we were to have a visual of this, it would look like this: layer N (user interface) ... layer 1 layer 0 (hardware) layer 1 ... layer N (user interface)
Protection
then, is any mechanism for controlling the access of processes or users to the resources defined by a computer system. This mechanism must provide means to specify the controls to be imposed and to enforce the controls
resource sharing
there are three scenarios: parent and children processes share all resources children share subset of parent's resources parent and child share no resources
A ____ can be used to prevent a user program from never returning control to the operating system. Select one: a. portal b. program counter c. firewall d. timer
timer
There are many special-purpose file systems. Consider the types of file systems in the Solaris example mentioned above:
tmpfs -- a "temporary" file system that is created in volatile main memory and has its contents erased if the system reboots or crashes objfs -- a "virtual" file system (essentially an interface to the kernel that looks like a file system) that gives debuggers access to kernel symbols ctfs -- a virtual file system that maintains "contract" information to manage which processes start when the system boots and must continue to run during operation lofs -- a "loop back" file system that allows one file system to be accessed in place of another one procfs -- a virtual file system that presents information on all processes of a file system ufs, zfs -- general-purpose file systems
We mentioned earlier that performance tuning seeks to improve performance by removing processing bottlenecks. To identify bottlenecks, we must be able to monitor system performance. Thus, the operating system must have some means of computing and displaying measures of system behavior. In a number of systems, the operating system does this by producing ___________________________ of system behavior.
trace listings
Fundamentally, all metadata changes are written sequentially to a log. Each set of operations for performing a specific task is a _____________________. Once the changes are written to this log, they are considered to be committed, and the system call can return to the user process, allowing it to continue execution. Meanwhile, these log entries are replayed across the actual file-system structures. As the changes are made, a pointer is updated to indicate which actions have completed and which are still incomplete. When an entire committed transaction is completed, it is removed from the log file, which is actually a circular buffer
transaction
Disk speed has two parts. What are they?
transfer rate -- is the rate at which data flow between the drive and the computer. positioning time -- (or random access time), consists of two parts: the time necessary for the desired sector to rotate to the disk head, called the ROTATIONAL LATENCY
A character-stream device ____. Select one: a. transfers data in blocks of bytes b. transfers data a byte at a time c. is a device such as a disk drive d. is similar to a random access device
transfers data a byte at a time
The relocation-register scheme provides an effective way to allow the operating system's size to change dynamically. This flexibility is desirable in many situations. For example, the operating system contains code and buffer space for device drivers. If a device driver (or other operating-system service) is not commonly used, we do not want to keep the code and data in memory, as we might be able to use that space for other purposes. Such code is sometimes called _________________ operating-system code; it comes and goes as needed. Thus, using this code changes the size of the operating system during program execution.
transient
The problem with this approach is the time required to access a user memory location. If we want to access location i, we must first index into the page table, using the value in the PTBR offset by the page number for i. The standard solution to this problem is to use a special, small, fast-lookup hardware cache called a _________________________.
translation look-aside buffer (TLB)
The designer of a program or system might leave a hole in the software that only she is capable of using. This type of security breach (or _________________) was shown in the movie War Games. For instance, the code might check for a specific user ID or password, and it might circumvent normal security procedures.
trap door
Swap space management ____. Select one: a. is a high-level operating system task b. tries to provide the best throughput for the virtual memory system c. is primarily used to increase the reliability of data in a system d. none of the above
tries to provide the best throughput for the virtual memory system
DES is now considered insecure for many applications because its keys can be exhaustively searched with moderate computing resources. (Note, though, that it is still frequently used.) Rather than giving up on DES, NIST created a modification called _____________________, in which the DES algorithm is repeated three times (two encryptions and one decryption) on the same plaintext using two or three keys—for example, c = Ek3(Dk2(Ek1(m))). When three keys are used, the effective key length is 168 bits. Triple DES is in widespread use today.
triple DES
More generally, Java's load-time and run-time checks enforce _______________________ of Java classes. Type safety ensures that classes cannot treat integers as pointers, write past the end of an array, or otherwise access memory in arbitrary ways. Rather, a program can access an object only via the methods defined on that object by its class.
type safety
A __________ contains the same pages for memory-mapped IO as well as ordinary IO. Select one: a. double cache b. unified virtual memory c. page cache d. unified buffer cache
unified buffer cache
Several systems--including Solaris, Linux, and Windows--use page caching to cache both process pages and file data. This is known as __________________________
unified file memory
The Windows 7 security model is based on the notion of _____________________________. Windows 7 allows the creation of any number of user accounts, which can be grouped in any manner. Access to system objects can then be permitted or denied as desired.
user accounts
Our earlier discussion of authentication involves messages and sessions. But what about users? If a system cannot authenticate a user, then authenticating that a message came from that user is pointless. Thus, a major security problem for operating systems is ________________________. The protection system depends on the ability to identify the programs and processes currently executing, which in turn depends on the ability to identify each user of the system. Users normally identify themselves.
user authentication
execution of RPC
user calls kernel to send RPC message to procedure X kernel sends message to matchmaker to find port number From: client To: server Port: matchmaker Re: address for RPC X matchmaker receives message, looks up answer matchmaker replies to client with port P From: server To: client Port: kernel Re: RPC X Port: P kernel places port P in user RPC message kernel sends RPC From: client To: server Port: port P <contents> daemon listening to port P receives message daemon processes request and processes send output From: RPC Port: P To: client Port: kernel <output> kernel receives reply, passes it to user
The requirements can be divided into two basic groups:
user goals and system goals A similar set of requirements can be defined by those people who must design, create, maintain, and operate the system. The system should be easy to design, implement, and maintain; and it should be flexible, reliable, error free, and efficient. Again, these requirements are vague and may be interpreted in various ways
The two separate modes of operating in a system are Select one: a. supervisor mode and system mode b. kernel mode and privileged mode c. physical mode and logical mode d. user mode and kernel mode
user mode and kernel mode
In order to ensure the proper execution of the operating system, we must be able to distinguish between the execution of operating-system code and user-defined code. At the very least, we need two separate modes of operation:
user mode and kernel mode (also called supervisor mode, system mode, or privileged mode)
voice over IP (VoIP)
uses a hybrid peer- to-peer approach. It includes a centralized login server, but it also incorporates decentralized peers and allows two peers to communicate.
command-line interface (CLI)
uses text commands and a method for entering them (say, a keyboard for typing in commands in a specific format with specific options)
wide-area-network (WAN)
usually links buildings, cities, or countries. A global company may have a WAN to connect its offices worldwide, for example. These networks may run one protocol or several protocols.
In the _______________________ scheme, the operating system keeps a table indicated which parts of memory are available and which are occupied. Initially, all memory is available for user processes and is considered one large block of available memory, a _____________.
variable-partition hole Eventually, as you will see, memory contains a set of holes of various sizes
The compile-time and load-time address-binding methods generate identical logical and physical addresses. However, the execution-time address-binding scheme results in differing logical and physical addresses. In this case, we usually refer to the logical address as a ________________________.
virtual address
The __________________________ of a process refers to the logical (or virtual) view of how a process is stored in memory. Typically, this view is that a process begins at a certain logical address--say, address 0--and exists in contiguous memory. It is up to the memory-management unit (MMU) to map logical pages to physical page frames in memory.
virtual address space
The concept of modes can be extended beyond two modes (in which case the CPU uses more than one bit to set and test the mode). CPUs that support virtualization frequently have a separate mode to indicate when the ______________________________—and the virtualization management software—is in control of the system.
virtual machine manager (VMM) and the virtualization management software—is in control of the system. In this mode, the VMM has more privileges than user processes but fewer than the kernel. It needs that level of privilege so it can create and manage virtual machines, changing the CPU state to do so. Sometimes, too, different modes are used by various kernel components. We should note that, as an alternative to modes, the CPU designer may use other methods to differentiate operational privileges.
Several versions of UNIX (including Solaris and Linux) provide a variation of the fork() system call—vfork() (for __________________________)—that operates differently from fork() with copy-on-write. With vfork(), the parent process is suspended, and the child process uses the address space of the parent. Because vfork() does not use copy-on-write, if the child process changes any pages of the parent's address space, the altered pages will be visible to the parent once it resumes. Therefore, vfork() must be used with caution to ensure that the child process does not modify the address space of the parent.
virtual memory fork
How do viruses work? Once a virus reaches target machine, a program known as a ____________________ inserts the virus into the system. The virus dropper is usually a Trojan horse, executed for other reasons but installing the virus as its core activity. Once installed, the virus may do any one of a number of things.
virus dropper
A typical instruction-execution cycle, as executed on a system with a __________________________________, first fetches an instruction from memory and stores that instruction in the instruction register
von Neumann architecture
Magnetic tape
was used as an early secondary-storage medium. Although it is relatively permanent and can hold large quantities of data, its access time is slow compared with that of main memory and hard disk. In addition, random access to magnetic tape is about a thousand times slower than random access to hard disk, so tapes are not very useful for secondary storage. Tapes are used mainly for backup, for storage of infrequently used information, and as a medium for transferring information from one system to another.
proportional allocation
we allocate available memory to each process according to its size. Let the size of the virtual memory for process p_i be s_i and define S = Σ si. Then, if the total number of available frames is m, we allocate ai frames to process pi, where ai is approximately ai = si/S × m. Of course, we must adjust each ai to be an integer that is greater than the minimum number of frames required by the instruction set, with a sum not exceeding m. With proportional allocation, we would split 62 frames between two processes, one of 10 pages and one of 127 pages, by allocating 4 frames and 57 frames, respectively, since 10 / 137 × 62 ≈ 4 , and 127 / 137 × 62 ≈ 57.
multiple-partition method
when a partition is free, a process is selected from the input queue and loaded into the free partition. When the process terminates, the partition becomes available for another process. This method was originally used by the IBM OS/360 operating system (called MFT) but is no longer in use.
asymmetric clustering
when one machine is in hot-standby mode while the other is running the applications. The hot-standby host becomes the active server.
process-contention scope (PCS)
when thread library schedules user-level threads to run on LWP (this is done within many-to-many and many-to-one models)
symmetric clustering
when two or more hosts are running application and are monitoring each other. This structure is obviously more efficient, as it uses all of the available hardware. However it does require that more than one application be available to run.
message system
where processes communicate with each other without resorting to shared variables
clustered system
which gathers together multiple CPUs. Clustered systems differ from the multiprocessor systems described
Profiling
which periodically samples the instruction pointer to determine which code is being executed, can show statistical trends but not individual activities. Code can be included in the kernel to emit specific data under specific circumstances, but that code slows down the kernel and tends not to be included in the part of the kernel where the specific problem being debugged is occurring.
performance tuning
which seeks to improve performance by removing processing bottlenecks
Furthermore, some TLBs allow certain entries to be ____________________, meaning that they cannot be removed from the TLB. Typically, TLB entries for key kernel code are wired down
wired down
personal area network (PAN)
wireless technology used to communicate over a distance of several feet -- typically used for bluetooth between a phone and headset or desktop computer and smartphone
copy semantics
with copy semantics, the version of the data written to disk is guaranteed to be the version at the time of the application system call, independent of any subsequent changes in the application's buffer. A simple way in which the operating system can guarantee copy semantics is for the write() system call to copy the application data into a kernel buffer before returning control to the application.
Free Software Foundation (FSF)
with the goal of encouraging the free exchange of software source code and the free use of that software. Rather than copyright its software, the FSF "copylefts" the software to encourage sharing and improvement.
A ______________ is a process that uses the _____________ mechanism to duplicate itself. The worm spawns copies of itself, using up system resources and perhaps locking out all other processes. On computer networks, worms are particularly potent, since they may reproduce themselves among systems and thus shut down an entire network. Such an event occurred in 1988 to UNIX systems on the Internet, causing the loss of system and system-administrator time worth millions of dollars.
worm spawn
Because disk I/O has such a huge impact on system performance, file-system design and implementation command quite a lot of attention from system designers. Some file systems are general purpose, in that they can provide reasonable performance and functionality for a wide variety of file sizes, file types, and I/O loads. Others are optimized for specific tasks in an attempt to provide better performance in those areas than general-purpose file systems. The _____________________________ from Network Appliance is an example of this sort of optimization. WAFL is a powerful, elegant file system optimized for random writes.
write-anywhere file layout (WAFL)
circular buffer
writes to the end of its space and then continues at the beginning, overwriting older values as it goes. We would not want the buffer to write over data that had not yet been saved, so that scenario is avoided. The log may be in a separate section of the file system or even on a separate disk spindle. It is more efficient, but more complex, to have it under separate read and write heads, thereby decreasing head contention and seek times
Historically, AMD had often developed chips based on Intel's architecture, but now the roles were reversed as Intel adopted AMD's x86-64 architecture. In discussing this architecture, rather than using the commercial names AMD64 and Intel 64, we will use the more general term ________________.
x86-64
These different approaches yield IDSs and IDPs with very different properties, however. In particular, anomaly detection can find previously unknown methods of intrusion (so-called _______________________). Signature-based detection, in contrast, will identify only known attacks that can be codified in a recognizable pattern.
zero-day attacks
A process that has terminated, but whose parent has not yet called wait(), is known as a ________ process. Select one: a. zombie b. orphan c. terminated d. init
zombie
Because port scans are detectable, they are frequently launched from ____________________. Such systems are previously compromised, independent systems that are serving their owners while being used for nefarious purposes, including denial-of-service attacks and spam relay. Zombies make crackers particularly difficult to prosecute because determining the source of the attack and the person that launched it is challenging
zombie systems