Operating-System Structures Ch. 2
single step
Information Maintenance A program trace lists each system call as it is executed. Even microprocessors provide a CPU mode known as _______, in which a trap is executed by the CPU after every instruction. The trap is usually caught by a debugger.
running
Now that the full bootstrap program has been loaded, it can traverse the file system to find the operating system kernel, load it into memory, and start its execution. It is only at this point that the system is said to be _________.
debugging performance tuning bottlenecks
OS debugging ____________ is the activity of finding and fixing errors in a system, both in hardware and in software. Performance problems are considered bugs, so debugging can also include _________, which seeks to improve performance by removing processing ___________. In this section, we explore debugging process and kernel errors and performance problems. Hardware debugging is outside the scope of this text.
log file core dump crash crash dump
OS debugging: Failure Analysis 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.) A failure in the kernel is called a _______. When it occurs, error information is saved to a log file, and the memory state is saved to a _________.
unix top windows task manager
OS debugging: Performance Tuning 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 trace listings of system behavior. All interesting events are logged with their time and important parameters and are written to a file. Later, an analysis program can process the log file to determine system performance and to identify bottlenecks and inefficiencies. These same traces can be run as input for a simulation of a suggested improved system. Traces also can help people to find errors in operating-system behavior Another approach to performance tuning uses single-purpose, interactive tools that allow users and administrators to question the state of various system components to look for bottlenecks 2 examples of these interactive tools are: _________ and _______
layered approach
OS structures: _____1______ A system can be made modular in many ways. One method is the ______1______, in which 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. An operating-system layer is an implementation of an abstract object made up of data and the operations that can manipulate those data. A typical operating-system layer—say, layer M—consists of data structures and a set of routines that can be invoked by higher-level layers. Layer M, in turn, can invoke operations on lower-level layers. The main advantage of the layered approach is simplicity of construction and debugging
hybrid systems
OS structures: ______1______ In practice, very few operating systems adopt a single, strictly defined structure. Instead, they combine different structures, resulting in _____1_____ that address performance, security, and usability issues.
modules
OS structures: ______1______ Perhaps the best current methodology for operating-system design involves using loadable kernel _____1_____. Here, the kernel has a set of core components and links in additional services via _____1______, either at boot time or during run time. The idea of the design is for the kernel to provide core services while other services are implemented dynamically, as the kernel is running. Linking services dynamically is preferable to adding new features directly to the kernel, which would require recompiling the kernel every time a change was made. Thus, for example, we might build CPU scheduling and memory management algorithms directly into the kernel and then add support for different file systems by way of loadable 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.
microkernels
OS structures: _______1______ We have already seen that as UNIX expanded, the kernel became large and difficult to manage. In the mid-1980s, researchers at Carnegie Mellon University developed an operating system called Mach that modularized the kernel using the _______1________. 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. They provide minimal process and memory management, in addition to a communication facility.
simple structure
OS structures: _____________ Many operating systems do not have well-defined structures. Frequently, such systems started as small, simple, and limited systems and then grew beyond their original scope. MS-DOS is an example of such a system. It was originally designed and implemented by a few people who had no idea that it would become so popular. It was written to provide the most functionality in the least space, so it was not carefully divided into modules.
shells
On systems with multiple command interpreters to choose from, the interpreters are known as ______. 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. The MS-DOS and UNIX shells operate in this way. These commands can be implemented in two general ways.
command interpreter
One provides a command-line interface, or ___________, that allows users to directly enter commands to be performed by the operating system. The other allows users to interface with the operating system via a graphical user interface, or GUI.
user interface program execution i/o operations file-system manipulation communications error detection
One set of operating system services provides functions that are helpful to the user. The 6 functions are: 1. 2. 3. 4. 5. 6.
debugger bugs
Process Control A running program needs to be able to halt its execution either normally (end()) or abnormally (abort()). If a system call is made to terminate the currently running program abnormally, or if the program runs into a problem and causes an error trap, a dump of memory is sometimes taken and an error message generated. The dump is written to disk and may be examined by a ________—a system program designed to aid the programmer in finding and correcting errors, or _______—to determine the cause of the problem.
lock
Quite often, two or more processes may share data. To ensure the integrity of the data being shared, operating systems often provide system calls allowing a process to ______ shared data. Then, no other process can access the data until the lock is released. Typically, such system calls include acquire lock() and release lock().
Scheduling classes File systems Loadable system calls Executable formats STREAMS modules Miscellaneous Device and bus drivers
Solaris 7 loadable kernel modules are:
booting bootstrap program bootstrap loader
System Boot The procedure of starting a computer by loading the kernel is known as ________ the system. On most computer systems, a small piece of code known as the _____________ or _____________ locates the kernel, loads it into main memory, and starts its execution.
protection
System Call Type: ____________ This type provides a mechanism for controlling access to the resources provided by a computer system. Historically, protection was a concern only on multiprogrammed computer systems with several users. However, with the advent of networking and the Internet, all computer systems, from servers to mobile handheld devices, must be concerned with protection. Typically, system calls providing protection include set permission() and get permission(), which manipulate the permission settings of resources such as files and disks. The allow user() and deny user() system calls specify whether particular users can—or cannot—be allowed access to certain resources.
device managment
System Call Type: ____________ A process may need several resources to execute—main memory, disk drives, access to files, and so on. If the resources are available, they can be granted, and control can be returned to the user process. Otherwise, the process will have to wait until sufficient resources are available. The various resources controlled by the operating system can be thought of as devices. Some of these devices are physical devices (for example, disk drives), while others can be thought of as abstract or virtual devices (for example, files). A system with multiple users may require us to first request() a device, to ensure exclusive use of it. After we are finished with the device, we release() it.
information maintenance
System Call Type: ____________ Many system calls exist simply for the purpose of transferring information between the user program and the operating system. For example, most systems have a system call to return the current time() and date(). Other system calls may return information about the system, such as the number of current users, the version number of the operating system, the amount of free memory or disk space, and so on.
communication message-passing model host name
System Call Type: ____________ There are two common models of interprocess communication: the _______________ and the shared-memory model. In the message-passing model, the communicating processes exchange messages with one another to transfer information. Messages can be exchanged between the processes either directly or indirectly through a common mailbox. Before communication can take place, a connection must be opened. The name of the other communicator must be known, be it another process on the same system or a process on another computer connected by a communications network. Each computer in a network has a __________ by which it is commonly known. A host also has a network identifier, such as an IP address. Similarly, each process has a process name, and this name is translated into an identifier by which the operating system can refer to the process.
file managment
System Call Type: ____________ We first need to be able to create() and delete() files. Either system call requires the name of the file and perhaps some of the file's attributes. Once the file is created, we need to open() it and to use it. We may also read(), write(), or reposition() (rewind or skip to the end of the file, for example). Finally, we need to close() the file, indicating that we are no longer using it. We may need these same sets of operations for directories if we have a directory structure for organizing files in the file system. In addition, for either files or directories, we need to be able to determine the values of various attributes and perhaps to reset them if necessary. File attributes include the file name, file type, protection codes, accounting information, and so on. At least two system calls, get file attributes() and set file attributes(), are required for this function. Some operating systems provide many more calls, such as calls for file move() and copy().
application programs
System Programs Along with system programs, most operating systems are supplied with programs that are useful in solving common problems or performing common operations. Such _______________ include Web browsers, word processors and text formatters, spreadsheets, database systems, compilers, plotting and statistical-analysis packages, and games.
file management status information file modification programming-language support program loading and execution communications background services
System Programs List the system programs: Page 74 for descriptions on each. 1. 2. 3. 4. 5. 6. 7.
process control file manipulation device manipulation information maintenance communications protection
System calls can be grouped roughly into six major categories:
process control file management device management information maintanence communications
Types of system calls. 1. _______________ ◦ 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 2. _______________ ◦ create file, delete file ◦ open, close ◦ read, write, reposition ◦ get file attributes, set file attributes 3. _______________ ◦ request device, release device ◦ read, write, reposition ◦ get device attributes, set device attributes ◦ logically attach or detach devices 4. ______________ ◦ 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 5. _______________ ◦ create, delete communication connection ◦ send, receive messages ◦ transfer status information ◦ attach or detach remote devices
services the system provides interface it makes available components and their interconnections
We can view an operating system from several vantage points. One view focuses on the _____________; another, on the ______________ to users and programmers; a third, on its ________________.
system administrators power users
___________ who manage computers and _____________ who have deep knowledge of a system frequently use the command-line interface. For them, it is more efficient, giving them faster access to the activities they need to perform. Indeed, on some systems, only a subset of system functions is available via the GUI, leaving the less common tasks to those who are command-line knowledgeable
system programs system utilities
___________, also known as system _____________, provide a convenient environment for program development and execution
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.
client server
Communication The source of the communication, known as the _________, and the receiving daemon, known as a _______,then exchange messages by using read message() and write message() system calls.
operating system
An ____________________ provides an environment for the execution of programs.
resource allocation accounting protection and security
Another set of operating system functions exists not for helping the user but rather for ensuring the efficient operation of the system itself. Systems with multiple users can gain efficiency by sharing the computer resources among the users. These functions are: 1. 2. 3.
read-only memory
At that location is the initial bootstrap program. This program is in the form of ____1_____, because the RAM is in an unknown state at system startup. _____1______ is convenient because it needs no initialization and cannot easily be infected by a computer virus
user goals system goals
Design & implementation Beyond this highest design level, the requirements may be much harder to specify. The requirements can, however, be divided into two basic groups: __________ and __________.
policy mechanism
Design & implementation One important principle is the separation of _____1____ from ___________. One determines how to do something; and the other determines what will be done. The separation of the two is important for flexibility. ____1_____ decisions are important for all resource allocation. Whenever it is necessary to decide whether or not to allocate a resource, a policy decision must be made. Whenever the question is how rather than what, it is a mechanism that must be determined.
system-call interface
For most programming languages, the run-time support system (a set of functions built into libraries included with a compiler) provides a ______1_______ that serves as the link to system calls made available by the operating system. The _____1_____intercepts function calls in the API and invokes the necessary system calls within the operating system
application programming interface
Frequently, systems execute thousands of system calls per second. Most programmers never see this level of detail, however. Typically, application developers design programs according to an application programming interface (
shell scripts
Command line interfaces usually make repetitive tasks easier, in part because they have their own programmability. For example, if a frequent task requires a set of command-line steps, those steps can be recorded into a file, and that file can be run just like a program. The program is not compiled into executable code but rather is interpreted by the command-line interface. These __________ are very common on systems that are command-line oriented, such as UNIX and Linux.
boot disk system disk
A disk that has a boot partition is called a __________ or a _________.
erasable programmable read-only memory firmware
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. All forms of ROM are also known as ___________, since their characteristics fall somewhere between those of hardware and those of software.
daemon
Communication A __________ is a long-running background process that answers requests for services.