操作系统概念第七版答案(含编程代码)

操作系统概念第七版答案(含编程代码)
操作系统概念第七版答案(含编程代码)

solutions to the exercises

Chapter 1

1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems.

a. What are two such problems?

b. Can we ensure the same degree of security in a time-shared machine as in a dedicated machine? Explain your answer.

Answer:

a. Stealing or copying one’s programs or data; using system resources (CPU, memory, disk space, peripherals) without proper accounting.

b. Probably not, since any protection scheme devised by humans can inevitably be broken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation.

1.2 The issue of resource utilization shows up in different forms in different types of operating systems. List what resources must be managed

carefully in the following settings: a. Mainframe or minicomputer systems b. Workstations connected to servers c. Handheld computers

Answer:

a. Mainframes:memory and CPU resources, storage, network bandwidth.

b. Workstations: memory and CPU resouces

c. Handheld computers: power consumption, memory resources.

1.3 Under what circumstances would a user be better off using a timesharing system rather than a PC or single-user workstation?

Answer: When there are few other users, the task is large, and the hardware is fast, time-sharingmakes sense. The full power of the system can be brought to bear on the user’s problem. The problemcan be solved faster than on a personal computer. Another case occurs when lots of other users need resources at the same time.

A personal computer is best when the job is small enough to be executed reasonably on it and when performance is sufficient to execute the program to the user’s satisfaction.

1.4 Which of the functionalities listed below need to be supported by the operating system for the following two settings: (a) handheld devices and (b) real-time systems.

a. Batch programming

b. Virtual memory

c. Time sharing

Answer: For real-time systems, the operating system needs to support virtual memory

and time sharing in a fair manner. For handheld systems,the operating system needs to provide virtual memory, but does not need to provide time-sharing. Batch programming is not necessary in both settings.

1.5 Describe the differences between symmetric and asymmetric multiprocessing.What are three advantages and one disadvantage of multiprocessor systems?

Answer: Symmetric multiprocessing treats all processors as equals, and I/O can be processed on any CPU. Asymmetric multiprocessing has one master CPU and the remainder CPUs are slaves. The master distributes tasks among the slaves, and I/O is usually done by the master only.

Multiprocessors can save money by not duplicating power supplies,housings, and peripherals. They can execute programs more quickly and can have increased reliability. They are also more complex in both hardware and software than uniprocessor systems.

1.6 How do clustered systems differ from multiprocessor systems? What is required for two machines belonging to a cluster to cooperate to provide a highly available service?

Answer: Clustered systems are typically constructed by combining multiple computers into a single system to perform a computational task distributed across the cluster. Multiprocessor systems on the other hand could be a single physical entity comprising of multiple CPUs. A clustered system is less tightly coupled than a multiprocessor system.Clustered systems communicate using messages, while processors in a multiprocessor system could communicate using shared memory.

In order for twomachines to provide a highly available service, the state on the two machines should be replicated and should be consistently updated. When one of the machines fail, the other could then take-over the functionality of the failed machine.

1.7 Distinguish between the client-server and peer-to-peer models of distributed systems.

Answer: The client-server model firmly distinguishes the roles of the client and server. Under this model, the client requests services that are provided by the server. The peer-to-peer model doesn’t have such strict roles. In fact, all nodes in the system are considered peers and thus may act as either clients or servers - or both. A node may request a service from another peer, or the node may in fact provide such a service to other peers in the system.

For example, let’s consider a system of nodes that share cooking recipes.Under the client-server model, all recipes are stored with the server. If a client wishes to access a recipe, it must request the recipe from the specified server. Using the peer-to-peer model, a peer node could ask other peer nodes for the specified recipe.

The node (or perhaps nodes) with the requested recipe could provide it to the requesting node. Notice how each peer may act as both a client (i.e. it may request recipes) and as a server (it may provide recipes.)

1.8 Consider a computing cluster consisting of twonodes running adatabase.Describe two ways in which the cluster software can manage access to the data on the disk. Discuss the benefits and disadvantages of each.

Answer: Consider the following two alternatives: asymmetric clustering and parallel clustering. With asymmetric clustering, one host runs the database application with the other host simply monitoring it. If the server fails, the monitoring host becomes the active server. This is appropriate for providing redundancy. However, it does not utilize the potential processing power of both hosts. With parallel clustering, the database application can run in parallel on both hosts. The difficulty implementing parallel clusters is providing some form of distributed locking mechanism for files on the shared disk.

1.9 How are network computers different from traditional personal computers? Describe some usage scenarios in which it is advantageous to use network computers.

Answer: A network computer relies on a centralized computer for most of its services. It can therefore have a minimal operating system to manage its resources. A personal computer on the other hand has to be capable of providing all of the required functionality in a standalonemanner without relying on a centralized manner. Scenarios where administrative costs are high and where sharing leads to more efficient use of resources are precisely those settings where network computers are preferred.

1.10 What is the purpose of interrupts? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose?

Answer: An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors.

1.11 Direct memory access is used for high-speed I/O devices in order to avoid increasing the CPU′s execution load.

a. How does the CPU interface with the device to coordinate the transfer?

b. How does the CPU know when the memory operations are complete?

c. The CPU is allowed to execute other programs while the DMA controller is

transferring data. Does this process interfere with the execution of the user programs? If so, describe what forms of interference are caused.

Answer: The CPU can initiate a DMA operation by writing values into special registers that can be independently accessed by the device.The device initiates the corresponding operation once it receives a command from the CPU. When the device is finished with its operation, it interrupts the CPU to indicate the completion of the operation.

Both the device and the CPU can be accessing memory simultaneously.The memory controller provides access to the memory bus in a fair manner to these two entities.

A CPU might therefore be unable to issue memory operations at peak speeds since it has to compete with the device in order to obtain access to the memory bus.

1.12 Some computer systems do not provide a privileged mode of operation in hardware. Is it possible to construct a secure operating system for these computer systems? Give arguments both that it is and that it is not possible.

Answer: An operating system for a machine of this type would need to remain in control (or monitor mode) at all times. This could be accomplished by two methods:

a. Software interpretation of all user programs (like some BASIC,Java, and LISP systems, for example). The software interpreter would provide, in software, what the hardware does not provide.

b. Require meant that all programs be written in high-level languages so that all object code is compiler-produced. The compiler would generate (either in-line or by function calls) the protection checks that the hardware is missing.

1.13 Give two reasons why caches are useful.What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?

Answer: Caches are useful when two or more components need to exchange data, and the components perform transfers at differing speeds.Caches solve the transfer problem by providing a buffer of intermediate speed between the components. If the fast device finds the data it needs in the cache, it need not wait for the slower device. The data in the cache must be kept consistent with the data in the components. If a omponent has a data value change, and the datum is also in the cache, the cache must also be updated. This is especially a problem on multiprocessor systemswhere more than one process may be accessing a datum.Acomponent may be eliminated by an equal-sized cache, but only if: (a) the cache and the component have equivalent state-saving capacity (that is,if the component retains its data when electricity is removed, the cache must retain data as well), and (b) the cache is affordable, because faster storage tends to be more expensive.

1.14 Discuss, with examples, how the problem of maintaining coherence of cached data manifests itself in the following processing environments:

a. Single-processor systems

b. Multiprocessor systems

c. Distributed systems

Answer: In single-processor systems, the memory needs to be updated when a processor issues updates to cached values. These updates can be performed immediately or in a lazy manner. In amultiprocessor system,different processors might be caching the same memory location in its local caches. When updates are made, the other cached locations need to be invalidated or updated. In distributed systems, consistency of cached memory values is not an issue. However, consistency problems might arise when a client caches file data.

1.15 Describe a mechanism for enforcing memory protection in order to prevent a program from modifying the memory associated with other programs.

Answer: The processor could keep track of what locations are associated with each process and limit access to locations that are outside of a program’s extent. Information regarding the extent of a program’s memory could be maintained by using base and limits registers and by performing a check for every memory access.

1.16 What network configuration would best suit the following environments?

a. A dormitory floor

b. A university campus

c. A state

d. A nation

Answer:

a. A dormitory floor - A LAN.

b. A university campus - A LAN, possible a WAN for very large campuses.

c. A state - AWAN.

d. A nation - A WAN.

1.17 Define the essential properties of the following types of operating systems:

a. Batch

b. Interactive

c. Time sharing

d. Real time

e. Network

f. Parallel

g. Distributed

h. Clustered

i. Handheld

Answer:

a. Batch. Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I/O devices busy at all times through buffering, off-line operation, spooling, andmultiprogramming. Batch is good for executing large jobs that need little interaction; it can be submitted and picked up later.

b. Interactive. This system is composed of many short transactions where the results of the next transaction may be unpredictable. Response time needs to be short (seconds) since the user submits and waits for the result.

c. Time sharing. This systems uses CPU scheduling and multiprogramming to provide economical interactive use of a system. The CPU switches rapidly from one user to another. Instead of having a job defined by spooled card images, each program reads its next control card from the terminal, and output is normally printed immediately to the screen.

d. Real tim

e. Often used in a dedicated application, this system reads information from sensors and must respond within a fixed amount of time to ensure correct performance.

e. Network. Provides operating system features across a network such as file sharing.

f. SMP. Used in systems where there are multiple CPU’s eac h running the same copy of the operating https://www.360docs.net/doc/123619613.html,munication takes place across the system bus.

g. Distributed.This system distributes computation among several physical processors. The processors do not share memory or a clock. Instead, each processor has its own local memory. They communicate with each other through various communication lines, such as a high-speed bus or local area network.

h. Clustered. A clustered system combines multiple computers into a single system to perform computational task distributed across the cluster.

i. Handheld. A small computer system that performs simple tasks such as calendars, email, and web browsing. Handheld systems differ from traditional desktop systemswith smallermemory and display screens and slower processors.

1.18 What are the tradeoffs inherent in handheld computers?

Answer: Handheld computers are much smaller than traditional desktop PC’s. This results in smaller memory, smaller screens, and slower processing capabilities than a standard desktop PC. Because of these limitations,most handhelds currently can perform only basic tasks such as calendars, email, and simple word processing. However, due to their small size, they are quite portable and, when they are equipped with wireless access, can provide remote access to electronic mail and the world wide web.

Chapter 2

2.1 The services and functions provided by an operating system can be divided into two main categories. Briefly describe the two categories and discuss how they differ.

Answer: One class of services provided by an operating system is to enforce protection between different processes running concurrently in the system. Processes are allowed to access only thosememory locations that are associated with their address spaces. Also, processes are not allowed to corrupt files associated with other users. A process is also not allowed to access devices directly without operating system ntervention.

The second class of services provided by an operating system is to provide new functionality that is not supported directly by the underlying hardware. Virtual memory and file systems are two such examples of new services provided by an operating system.

2.2 List five services provided by an operating system that are designed to make it more convenient for users to use the computer system. In what cases it would be impossible for user-level programs to provide these services? Explain.

Answer:

?Program execution. The operating system loads the contents (or sections) of a file into memory and begins its execution. A user-level program could not be trusted to properly allocate CPU time.

? I/O operations. Disks, tapes, serial lines, and other devices must be communicated with at a very low level. The user need only specify the device and the operation to perform on it, while the system converts that request into device- or controller-specific commands. User-level programs cannot be trusted to only access devices they should have access to and to only access them when they are otherwise unused.

? File-system manipulation. There are many details in file creation, deletion, allocation, and naming that users should not have to perform. Blocks of disk space are used by files and must be tracked. Deleting a file requires removing the name file information and freeing the allocated blocks. Protections must also be checked to assure proper file access. User programs could neither ensure adherence to protection methods nor be trusted to allocate only free blocks and deallocate blocks on file deletion.

? Communications. Message passing between systems requires messages be turned into packets of information, sent to the network controller,transmitted across a communications medium, and reassembled by the destination system. Packet ordering and data correction must take place. Again, user programs might not coordinate access to the network device, or they might receive packets destined for other processes. ? Error detection. Error detection occurs at both the hardware and software levels. At the hardware level, all data transfers must be inspected to ensure that data have

not been corrupted in transit. All data on media must be checked to be sure they have not changed since they were written to the media. At the software level, media must be checked for data consistency; for instance, do the number of allocated and

unallocated blocks of storage match the total number on the device. There, errors are frequently process-independent (for instance, the corruption of data on a disk), so there must be a global program (the operating system) that handles all types of errors. Also, by having errors processed by the operating system, processes need not contain code to catch and correct all the errors possible on a system.

2.3 Describe three general methods for passing parameters to the operating system.

Answer:

a. Pass parameters in registers

b. Registers pass starting addresses of blocks of parameters

c. Parameters can be placed, or pushed, onto the stack by the program, and popped off the stack by the operating system.

2.4 Describe how you could obtain a statistical profile of the amount of time spent by a program executing different sections of its code.Discuss the importance of obtaining such a statistical profile.

Answer: One could issue periodic timer interrupts and monitor what instructions or what sections of code are currently executing when the interrupts are delivered.

A statistical profile of which pieces of code were active should be consistent with the time spent by the program in different sections of its code. Once such a statistical profile has been obtained, the programmer could optimize those sections of code that are consuming more of the CPU resources.

2.5 What are the five major activities of an operating system in regard to file management?

Answer:

? The creati on and deletion of files

? The creation and deletion of directories

? The support of primitives for manipulating files and directories

? The mapping of files onto secondary storage

? The backup of files on stable (nonvolatile) storage media

2.6 What are the advantages and disadvantages of using the same systemcall interface for manipulating both files and devices?

Answer: Each device can be accessed as though it was a file in the file system. Since most of the kernel deals with devices through this file interface,it is relatively

easy to add a new device driver by implementing the hardware-specific code to support this abstract file interface. Therefore,this benefits the development of both user program code, which can bewritten to access devices and files in the samemanner, and device driver code, which can be written to support a well-defined API. The disadvantage with using the same interface is that it might be difficult to capture the functionality of certain devices within the context of the file access API, thereby either resulting in a loss of functionality or a loss of performance. Some of this could be overcome by the use of ioctl operation that provides a general purpose interface for processes to invoke operations on devices.

2.7 What is the purpose of the command interpreter? Why is it usually separate from the kernel? Would it be possible for the user to develop a new command interpreter using the system-call interface provided by the operating system?

Answer: It reads commands from the user or from a file of commands and executes them, usually by turning them into one or more system calls. It is usually not part of the kernel since the command interpreter is subject to changes. An user should be able to develop a new command interpreter using the system-call interface provided by the operating system. The command interpreter allows an user to create and manage processes and also determine ways by which they communicate (such as through pipes and files). As all of this functionality could be accessed by an user-level program using the system calls, it should be possible for the user to develop a new command-line interpreter.

2.8 What are the two models of interprocess communication? What are the strengths and weaknesses of the two approaches?

Answer: The two models of interprocess communication are message-passing model and the shared-memory model.

2.9 Why is the separation of mechanism and policy desirable?

Answer: Mechanism and policymust be separate to ensure that systems are easy to modify. No two system installations are the same, so each installation may want to tune the operating system to suit its needs.With mechanism and policy separate, the policy may be changed at will while the mechanism stays unchanged. This arrangement provides a more flexible system.

2.10 Why does Java provide the ability to call from a Java program native methods that are written in, say, C or C++? Provide an example of a situation in which a native method is useful.

Answer: Java programs are intended to be platform I/O independent. Therefore, the language does not provide access to most specific system resources such as reading

fromI/O devices or ports. To perform a system I/O specific operation, you must write it in a language that supports such features (such as C or C++.) Keep in mind that a Java program that calls a native method written in another language will no longer be architecture-neutral.

2.11 It is sometimes difficult to achieve a layered approach if two components of the operating system are dependent on each other. Identify a scenario in which it is unclear how to layer two system components that require tight coupling of their functionalities.

Answer: The virtual memory subsystem and the storage subsystem are typically tightly-coupled and requires careful design in a layered system due to the following interactions. Many systems allow files to be mapped into the virtual memory space of an executing process. On the other hand, the virtualmemory subsystem typically uses the storage system to provide the backing store for pages that do not currently reside in memory. Also, updates to the filesystem are sometimes buffered in physical memory before it is flushed to disk, thereby requiring careful coordination of the usage of memory between the virtual memory subsystem and the filesystem.

2.12 What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in amicrokernel architecture? What are the disadvantages of using the microkernel approach?

Answer: Benefits typically include the following (a) adding a new service does not require modifying the kernel, (b) it is more secure as more operations are done in user mode than in kernel mode, and (c) a simpler kernel design and functionality typically results in a more reliable operating system. User programs and system services interact in a microkernel architecture by using interprocess communication mechanisms such asmessaging. These messages are conveyed by the operating system. The primary disadvantage of the microkernel architecture are the overheads associated with interprocess communication and the frequent use of the operating system’s messaging functions in order to enable the user process and the system service to interact with each other.

2.13 In what ways is the modular kernel approach similar to the layered approach? In what ways does it differ from the layered approach?

Answer: The modular kernel approach requires subsystems to interact with each other through carefully constructed interfaces that are typically narrow (in terms of the functionality that is exposed to external modules). The layered kernel approach is similar in that respect. However, the layered kernel imposes a strict ordering of subsystems such that subsystems at the lower layers are not allowed to invoke operations corresponding to the upper-layer subsystems. There are no such restrictions in the modular-kernel approach, wherein modules are free to invoke each

操作系统概念习题集锦

1 引论 小结 1.计算机系统由硬件和软件组成。硬件是计算机系统的物质基础,操作系统是硬件之上的第一层软件,是支撑其他所有软件运行的基础。 2.多道程序设计是指在内存中同时存放多道程序,这些程序在管理程序的控制下交替运行,共享处理机及系统中的其他资源。在单处理机系统中多道程序运行的特点是:·多道:计算机内存中同时存放多道相互独立的程序。 ·宏观上并行:同时进入系统的多道程序都处于运行过程中,即它们先后开始了各自的运行,但都未运行完毕。 ·微观上串行:内存中的多道程序轮流占有CPU,交替执行。 3.操作系统是一组控制和管理计算机硬件和软件资源,合理地组织计算机工作流程,以及方便用户的程序的集合。 4.操作系统有三种基本类型,即批处理操作系统、分时操作系统及实时操作系统。 ·批处理操作系统能对一批作业自动进行处理,在批处理系统中引入多道程序设计技术就形成了多道批处理系统。多道批处理系统的主要特征是用户脱机使用计算机、成批处理及多道程序运行。 ·在分时操作系统中,处理机的运行时间被分成很短的时间片,系统按时间片轮流把处理机分配给各联机作业使用,若某个作业在分配给它的时间片内不能完成其计算,则该作业暂时停止运行,把处理机让给另一个作业使用,等待下一轮时再继续其运行。分时系统的特征是同时性、交互性、独立性和及时性。 ·实时系统能及时响应外部事件的请求,在规定的时间内完成对该事件的处理,并控制所有实时设备和实时任务协调一致地工作。实时系统的主要特征是响应及时和可靠性高。 5.操作系统的特征是并发性、共享性、虚拟性及不确定性。 ·并发是指两个或多个事件在同一时间间隔内发生。 ·共享是指系统中的资源供多个用户共同使用。

操作系统 习题答案(中文版)

操作系统概第七版中文版习题答案(全) 1.1在多道程序和分时环境中,多个用户同时共享一个系统,这种情况导致多种安全问题。a. 列出此类的问题 b.在一个分时机器中,能否确保像在专用机器上一样的安全度?并解释之。 答:a.窃取或者复制某用户的程序或数据;没有合理的预算来使用资源(CPU,内存,磁盘空间,外围设备)b.应该不行,因为人类设计的任何保护机制都会不可避免的被另外的人所破译,而且很自信的认为程序本身的实现是正确的是一件困难的事。 1.2资源的利用问题在各种各样的操作系统中出现。试例举在下列的环境中哪种资源必须被严格的管理。(a)大型电脑或迷你电脑系统(b)与服务器相联的工作站(c)手持电脑 答:(a)大型电脑或迷你电脑系统:内存和CPU资源,外存,网络带宽(b)与服务器相联的工作站:内存和CPU资源(c)手持电脑:功率消耗,内存资源 1.3在什么情况下一个用户使用一个分时系统比使用一台个人计算机或单用户工作站更好? 答:当另外使用分时系统的用户较少时,任务十分巨大,硬件速度很快,分时系统有意义。充分利用该系统可以对用户的问题产生影响。比起个人电脑,问题可以被更快的解决。还有一种可能发生的情况是在同一时间有许多另外的用户在同一时间使用资源。当作业足够小,且能在个人计算机上合理的运行时,以及当个人计算机的性能能够充分的运行程序来达到用户的满意时,个人计算机是最好的,。 1.4在下面举出的三个功能中,哪个功能在下列两种环境下,(a)手持装置(b)实时系统需要操作系统的支持?(a)批处理程序(b)虚拟存储器(c)分时 答:对于实时系统来说,操作系统需要以一种公平的方式支持虚拟存储器和分时系统。对于手持系统,操作系统需要提供虚拟存储器,但是不需要提供分时系统。批处理程序在两种环境中都是非必需的。 1.5描述对称多处理(SMP)和非对称多处理之间的区别。多处理系统的三个优点和一个缺点? 答:SMP意味着所以处理器都对等,而且I/O可以在任何处理器上运行。非对称多处理有一个主处理器控制系统,与剩下的处理器是随从关系。主处理器为从处理器安排工作,而且I/O也只在主处理器上运行。多处理器系统能比单处理器系统节省资金,这是因为他们能共享外设,大容量存储和电源供给。它们可以更快速的运行程序和增加可靠性。多处理器系统能比单处理器系统在软、硬件上也更复杂(增加计算量、规模经济、增加可靠性) 1.6集群系统与多道程序系统的区别是什么?两台机器属于一个集群来协作提供一个高可靠性的服务器的要求是什么? 答:集群系统是由多个计算机耦合成单一系统并分布于整个集群来完成计算任务。另一方面,多道程序系统可以被看做是一个有多个CPU组成的单一的物理实体。集群系统的耦合度比多道程序系统的要低。集群系统通过消息进行通信,而多道程序系统是通过共享的存储空间。为了两台处理器提供较高的可靠性服务,两台机器上的状态必须被复制,并且要持续的更新。当一台处理器出现故障时,另一台处理器能够接管故障处理的功能。 1.7试区分分布式系统(distribute system)的客户机-服务器(client-server)模型与对等系统(peer-to-peer)模型 答:客户机-服务器(client-server)模型可以由客户机和服务器的角色被区分。在这种模型下,客户机向服务器发出请求,然后服务器满足这种请求。对等系统(peer-to-peer)模

操作系统概念笔记

导论小结 操作系统是管理计算机硬件并提供应用程序运行环境的软件。也许操作系统最为直观之处在于它提供了人与计算机系统的接口。 为了让计算机执行程序,程序必须位于内存中。内存是处理机能够直接访问的唯一的大容量存储区域。内存为字节或字的数组,容量为数百KB到数百MB。每个字都有其地址。内存是易失性存储器,当没有电源时会失去其内容。绝大多数计算机系统都提供了外存以扩充内存。二级存储器提供了一种非易失性存储,它可以长久地存储大量数据。最常用的二级存储器是磁盘,它提供对数据和程序的存储。 根据速度和价格,可以将计算机系统的不同存储系统按层次;来组织。最高层为最昂贵但也最快。随着向层次结构下面移动,每一个为的存储价格通常降低,而访问时间通常增加。 计算机系统的设计有多种不同的方法。单处理器系统只有一个处理器,而多处理器系统包含两个或更多的处理器来共享物理存储及外设。对称多处理技术(SMP)是最为普遍的多处理器设计技术,其中所有的处理器被视为对等的,且彼此独立地运行。集群系统是一种特殊的多处理器系统,它由通过局域网连接的多个计算机系统组成。 为了更好地利用CPU,现代操作系统采用允许多个作业同时位于内存中的多道程序设计,以保证CPU中总有一个作业在执行。分时系统是多道程序系统的扩展,它采用调度算法实现作业之间快速的切换,好像每个作业在同时进行一样。 操作系统必须确保计算机系统的正确操作。为了防止用户干预系统的正常操作,,硬件有两种模式:用户模式和内核模式。许多指令(如I/O指令和停机指令)都是特权的,只能在内核模式下执行。这些工具(如双模式、特权指令、内存保护、定时器中断)是操作系统所使用的基本单元,用以实现正确操作。 进程(或作业)是操作系统工作的基本单元。进程管理包括创建和删除进程,为进程提供与其他进程通信和同步的机制。操作系统通过跟踪内存的哪部分被使用及被谁使用来管理内存。操作系统还负责动态地分配和释放内存空间,同时还管理存储空间,包括为描述文件提供文件系统和目录,以及管理大存储器设备的空间。 操作系统必须考虑到它和用户的保护和安全问题。保护是提供控制进程或用户访问计算机系统资源的机制。安全措施用来抵御计算机系统所受到的外部或内部的攻击。 分布式系统允许用户共享通过网络连接的、在地理位置上是分散的计算机的资源。可以通过客户机-服务器模式或对等模式来提供服务。在集群系统中,多个机器可以完成驻留在共享存储器上的数据的计算,即便某些集群的子集出错,计算仍可以继续。 局域网和广域网是两种基本的网络类型。局域网允许分布在较小地理区域的处理器进行通信,而广域网允许分布在较大地理区域内的处理器进行通信。局域网通常比广域网快。 计算机系统具有一些特殊的服务目的,包括为嵌入式环境设计的实时操作系统,如消费设备、汽车和机器人。实时操作系统具有已定义的、固定的时间约束。进程必须在定义的约束内执行,否则系统将出错。多媒体系统涉及多媒体数据传送,常常有显示或使用音频、视频或者同步的音频和视频的特别要求。 近来,由于Internet和WWW的影响,现代操作系统也集成了WWW浏览器、网络和通信软件。 操作系统结构小结 操作系统提供若干服务。在最底层,系统调用允许运行程序直接向操作系统发出请求。在高层,命令解释程序或Shell提供了一个机制以便用户不必编写程序就能发出请求。命令可以来自文件(批处理模式),或者直接来自键盘输入(交互模式或分时模式)。系统程序用来满足一些常用用户操作。

操作系统概念第七版翻译版高等教育出版郑扣根译

·1.1在多道程序和分时环境中,多个用户同时共享一个系统,这种情况 导致多种安全问题。a. 列出此类的问题b.在一个分时机器中,能否确保像 在专用机器上一样的安全度?并解释之。 Answer:a.窃取或者复制某用户的程序或数据;没有合理的预算来使用资源(CPU,内存,磁盘空间,外围设备)b.应该不行,因为人类设计的任何 保护机制都会不可避免的被另外的人所破译,而且很自信的认为程序本身的 实现是正确的是一件困难的事。 1.2资源的利用问题在各种各样的操作系统中出现。试例举在下列的环境中 哪种资源必须被严格的管理。(a)大型电脑或迷你电脑系统(b)与服 务器相联的工作站(c)手持电脑 Answer: (a)大型电脑或迷你电脑系统:内存和CPU资源,外存,网络带宽(b)与服务器相联的工作站:内存和CPU资源(c)手持电脑:功率消耗, 内存资源 1.3在什么情况下一个用户使用一个分时系统比使用一台个人计算机或单 用户工作站更好? Answer:当另外使用分时系统的用户较少时,任务十分巨大,硬件速度很快, 分时系统有意义。充分利用该系统可以对用户的问题产生影响。比起个人电脑,问题可以被更快的解决。还有一种可能发生的情况是在同一时间有许多另外的用户在同一时间使用资源。当作业足够小,且能在个人计算机上合理的运行时,以及当个人计算机的性能能够充分的运行程序来达到用户的满意时,个人计算机 是最好的,。 1.4在下面举出的三个功能中,哪个功能在下列两种环境下,(a)手持装置 (b)实时系统需要操作系统的支持?(a)批处理程序(b)虚拟存储器(c)分时Answer:对于实时系统来说,操作系统需要以一种公平的方式支持虚拟存储器 和分时系统。对于手持系统,操作系统需要提供虚拟存储器,但是不需要提供分时系统。批处理程序在两种环境中都是非必需的。 1.5描述对称多处理(SMP)和非对称多处理之间的区别。多处理系统的 三个优点和一个缺点? Answer:SMP意味着所以处理器都对等,而且I/O可以在任何处理器上运行。非对称多处理有一个主处理器控制系统,与剩下的处理器是随从关系。主处理器为从处理器安排工作,而且I/O也只在主处理器上运行。多处理器系统能比单处理器系统节省资金,这是因为他们能共享外设,大容量存储和电源供给。它们可以更快速的运行程序和增加可靠性。多处理器系统能比单处理器系统在软、硬件上也更复杂(增加计算量、规模经济、增加可靠性) 1.6集群系统与多道程序系统的区别是什么?两台机器属于一个集群来协 作提供一个高可靠性的服务器的要求是什么? Answer:集群系统是由多个计算机耦合成单一系统并分布于整个集群来完成计 算任务。另一方面,多道程序系统可以被看做是一个有多个CPU组成的单一的 物理实体。集群系统的耦合度比多道程序系统的要低。集群系统通过消息进行通信,而多道程序系统是通过共享的存储空间。为了两台处理器提供较高的可靠性服务,两台机器上的状态必须被复制,并且要持续的更新。当一台处理器出现故障时,另一台处理器能够接管故障处理的功能。 1.7 试区分分布式系统(distribute system)的客户机-服务器(clientserver)模型与对等系统(peer-to-peer)模型

操作系统概念第七版习题答案(中文版)完整版

1.1 在多道程序和分时环境中,多个用户同时共享一个系统,这种情况导致多种安全问题。a. 列出此类的问题b.在一个分时机器中,能否确保像在专用机器上一样的安全度?并解释之。 Answer:a.窃取或者复制某用户的程序或数据;没有合理的预算来使用资源(CPU,内存,磁盘空间,外围设备)b.应该不行,因为人类设计的任何保护机制都会不可避免的被另外的人所破译,而且很自信的认为程序本身的实现是正确的是一件困难的事。 1.2 资源的利用问题在各种各样的操作系统中出现。试例举在下列的环境中哪种资源必须被严格的管理。(a)大型电脑或迷你电脑系统(b)与服务器相联的工作站(c)手持电脑 Answer: (a)大型电脑或迷你电脑系统:内存和CPU 资源,外存,网络带宽(b)与服务器相联的工作站:内存和CPU 资源(c)手持电脑:功率消耗,内存资源 1.3 在什么情况下一个用户使用一个分时系统比使用一台个人计算机或单用户工作站更好? Answer:当另外使用分时系统的用户较少时,任务十分巨大,硬件速度很快,分时系统有意义。充分利用该系统可以对用户的问题产生影响。比起个人电脑,问题可以被更快的解决。还有一种可能发生的情况是在同一时间有许多另外的用户在同一时间使用资源。当作业足够小,且能在个人计算机上合理的运行时,以及当个人计算机的性能能够充分的运行程序来达到用户的满意时,个人计算机是最好的,。 1.4 在下面举出的三个功能中,哪个功能在下列两种环境下,(a)手持装置(b)实时系统需要操作系统的支持?(a)批处理程序(b)虚拟存储器(c)分时 Answer:对于实时系统来说,操作系统需要以一种公平的方式支持虚拟存储器和分时系统。对于手持系统,操作系统需要提供虚拟存储器,但是不需要提供分时系统。批处理程序在两种环境中都是非必需的。 1.5 描述对称多处理(SMP)和非对称多处理之间的区别。多处理系统的三个优点和一个缺点? Answer:SMP意味着所以处理器都对等,而且I/O 可以在任何处理器上运行。非对称多处理有一个主处理器控制系统,与剩下的处理器是随从关系。主处理器为从处理器安排工作,而且I/O 也只在主处理器上运行。多处理器系统能比单处理器系统节省资金,这是因为他们能共享外设,大容量存储和电源供给。它们可以更快速的运行程序和增加可靠性。多处理器系统能比单处理器系统在软、硬件上也更复杂(增加计算量、规模经济、增加可靠性) 1.6 集群系统与多道程序系统的区别是什么?两台机器属于一个集群来协作提供一个高可靠性的服务器的要求是什么? Answer:集群系统是由多个计算机耦合成单一系统并分布于整个集群来完成计算任务。另一方面,多道程序系统可以被看做是一个有多个CPU 组成的单一的物理实体。集群系统的耦合度比多道程序系统的要低。集群系统通过消息进行通信,而多道程序系统是通过共享的存储空间。为了两台处理器提供较高的可靠性服务,两台机器上的状态必须被复制,并且要持续的更新。当一台处理器出现故障时,另一台处理器能够接管故障处理的功能。

操作系统概论重点整理2017(2017年张琼声版)

操作系统概论-02323(2017年张琼声版本) 第1章操作系统简介 1.1什么是操作系统 (1)操作系统概念: 操作系统是一种复杂的系统软件,是不同程序代码、数据结构、初始化文件的集合,可执行。 操作系统是提供计算机用户与计算机硬件之间的接口,并管理计算机软件和硬件资源,并且通过这个接口使应用程序的开发变得简单、高效。 接口是两个不同部分的交接面。接口分为硬件接口和软件接口,计算机的所有功能最终都是由硬件的操作来实现的,计算机屏蔽了对硬件操作的细节。 (2)操作系统完成的两个目标: 1)与硬件相互作用,为包含在所有硬件平台上的所有底层可编程部件提供服务; 2)为运行在计算机系统上的应用程序(即用户程序)提供执行环境。 现代计算机特点是支持多任务,一方面保证用户程序的顺利执行,另一方面使计算机系统资源得到高效的利用,保证计算机系统的高性能。 (3)操作系统的功能: 处理机管理、内存管理、设备管理、文件管理。 1.2操作系统的发展 1)无操作系统 2)单道批处理系统 3)多道程序系统(多道批处理系统、分时系统) 4)微机操作系统 5)实时操作系统 6)嵌入式操作系统 7)物联网操作系统 1.2.1无操作系统阶段: 电子管,无存储设备,第一台:1946年宾夕法尼亚大学的「埃尼阿克」 单道批处理系统: 晶体管,磁性存储设备,内存中有一道批处理作业,计算机资源被用户作业独占。 吞吐量是指单位时间内计算机系统处理的作业量

1.2.2单道批处理系统 特点:自动性、顺序性、单道性。 优点:减少了等待人工操作的时间 缺点:CPU资源不能得到有效的利用。 1.2.3多道程序系统 多道程序系统:集成电路芯片,出现了分时操作系统(多个终端)。 特点:多道性、无序性、调度性、复杂性。 优点:能够使CPU和内存IO资源得到充分利用,提高系统的吞吐量。 缺点:系统平均周转时间长,缺乏交互能力。 1.2.4微机操作系统: 第一台Intel公司顾问GaryKildall 编写的CP/M系统,是一台磁盘操作系统,用于Intel8080. 1.2.5操作系统特点 (1)分时系统: 特点:多路性、及时性、交互性、独立性。 优点:提供了人机交互,可以使用户通过不同终端分享主机。 缺点:不能及时接收及时处理用户命令。 (2)实时操作系统(用户实时控制和实时信息处理): 实时操作系统:广泛应用于各种工业现场的自动控制、海底探测、智能机器人和航空航天等。 特点:多路性、独立性、及时性、交互性、可靠性。 在实时系统中,往往采取多级容错措施来保证系统安全和数据安全。 (3)操作系统产品: 1)主机操作系统(批处理、事务处理(银行支票处理或航班预订)、分时处理) 2)微机操作系统 3)服务器操作系统 4)嵌入式操作系统(物联网操作系统) 1.3操作系统的特征 现代操作系统都支持多任务,具有并发、共享、虚拟和异步性特征。 (1)并发: 指两个或多个事件在同一时间间隔内发生; (2)共享:指系统中的资源可供内存中多个并发执行的进程共同使用。 资源共享两种方式:互斥共享,同时共享; (3)虚拟:指通过某种技术把一个物理实体变成若干逻辑上的对应物;

操作系统概念第七版7-9章课后题答案(中文版)

7.1 假设有如图7.1所示的交通死锁。 a.证明这个例子中实际上包括了死锁的四个必要条件。 b.给出一个简单的规则用来在这个系统中避免死锁。 a.死锁的四个必要条件: (1)互斥;(2)占有并等待;(3)非抢占;(4)循环等待。 互斥的条件是只有一辆车占据道路上的一个空间位置。占有并等待表示一辆车占据道路上的位置并且等待前进。一辆车不能从道路上当前的位置移动开(就是非抢占)。最后就是循环等待,因为每个车正等待着随后的汽车向前发展。循环等待的条件也很容易从图形中观察到。 b.一个简单的避免这种的交通死锁的规则是,汽车不得进入一个十字路口如果明确地规定, 这样就不会产生相交。 7.2 考虑如下的死锁可能发生在哲学家进餐中,哲学家在同个时间获得筷子。讨论此种情况下死锁的四个必要条件的设置。讨论如何在消除其中任一条件来避免死锁的发生。 死锁是可能的,因为哲学家进餐问题是以以下的方式满足四个必要条件:1)相斥所需的筷子, 2 )哲学家守住的筷子在手,而他们等待其他筷子, 3 )没有非抢占的筷子,一个筷子分配给一个哲学家不能被强行拿走,4 )有可能循环等待。死锁可避免克服的条件方式如下: 1 )允许同时分享筷子, 2 )有哲学家放弃第一双筷子如果他们无法获得其他筷子,3 )允许筷子被强行拿走如果筷子已经被一位哲学家了占有了很长一段时间4 )实施编号筷子,总是获得较低编号的筷子,之后才能获得较高的编号的筷子。 7.3 一种可能以防止死锁的解决办法是要有一个单一的,优先于任何其他资源的资源。例如,如果多个线程试图访问同步对象A?…E,那么就可能发生死锁。(这种同步对象可能包括互斥体,信号量,条件变量等),我们可以通过增加第六个对象来防止死锁。每当一个线程希望获得同步锁定给对象A???E,它必须首先获得对象F的锁.该解决方案被称为遏制:对象A???E的锁内载对象F的锁。对比此方案的循环等待和Section7.4.4的循环等待。 这很可能不是一个好的解决办法,因为它产生过大的范围。尽可能在狭隘的范围内定义死锁政策会更好。 7.4 对下列问题对比循环等待方法和死锁避免方法(例如银行家算法): a.运行费用 b.系统的吞吐量 死锁避免方法往往会因为追踪当前资源分配的成本从来增加了运行费用。然而死锁避免方法比静态地防止死锁的形成方法允许更多地并发使用资源。从这个意义上说,死锁避免方案可以增加系统的吞吐量。 7.5 在一个真实的计算机系统中,可用的资源和进程命令对资源的要求都不会持续很久是一致的长期(几个月)。资源会损坏或被替换,新的进程会进入和离开系统,新的资源会被购买和添加到系统中。如果用银行家算法控制死锁,下面哪

操作系统概念第七版期末考试

操作系统期末考试试卷(B) 计算机科学系______级______科______班姓名__________学号__________ 题号一二三四总分 分数 ?、 填空(1%×30) ★该题答写在本卷纸上★ 1.操作系统的基本类型有1)____________________ 2)____________________ 3)____________________4)___________________5)___________________ _ 和6)分布式操作系统等。 2.常用的进程调度算法和作业调度算法有1)____________________ 2)___________________ 3)___________________ 4)____________________ 5)____________________ 和6)最高相应比优 先(HRN)算法等。 3.作业调度的目标主要有1)____________________ 2)____________________ 3)____________________4)___________________。 4.内存管理要解决的问题有1)_________________ 2)____________________ 3)____________________4)___________________5)___________________ 。 5.常用的内存管理方法有1)单一连续区管、2)___________________ 3)___________________ 和4)____________________等。 6.作业由1) 程序、2)__________________和3)__________________组成。 1

考研操作系统-操作系统概念与历史

考研操作系统-操作系统概念与历史 (总分:246.00,做题时间:90分钟) 一、填空题(总题数:12,分数:12.00) 1.在操作系统中,不可中断执行的操作称为 1。 填空项1:__________________ (正确答案:原语操作) 原语操作的英文名称为Atomic Operation,有时也称为原子操作。原子在很长时间内被人类认为是不可分割的最小粒子,因此它引申的意思为不可分割或不可中断。原语操作是操作系统提供并发的基础。 2.UNIX操作系统在结构上分为两个部分: 1和 2。 填空项1:__________________ (正确答案:外壳(Shell)) 填空项1:__________________ (正确答案:内核(Kernel)) 操作系统的实体通常称为内核,它包括操作系统的所有功能构件,如进程管理、内存管理、文件系统等。这些功能构件并不能直接被一般用户使用。为了方便用户使用操作系统,操作系统设计者还为操作系统覆盖了一层外壳,用户通过外壳与操作系统打交道。这个壳可以看成是操作系统的用户界面。 3.特权指令能在 1下执行,而不能在 2下执行。 填空项1:__________________ (正确答案:内核态(Kernel Mode)、用户态(user Mode)) 顾名思义,特权指令具有特权,这个特权就是对计算机资源的访问权力。与此相对的是非特权指令,此种指令不能随意访问计算机的资源。操作系统为了实现特权和非特权指令而设计了内核态和用户态。凡是在内核态下执行的指令都是特权指令,在用户态下执行的指令都是非特权指令。 4.操作系统向用户提供了两类接口:一类是 1,另一类是 2。 填空项1:__________________ (正确答案:命令级接口(command Interface)、程序级接口(Programming Interface)) 对操作系统的使用有两种方式:直接向操作系统发出命令;编程序调用操作系统服务。前一种接口是所谓的命令接口,通过操作系统的壳实现;后一种接口是程序接口,通过操作系统调用(System call)和程序语言库函数实现。 5.分时系统中 1是衡量分时系统性能的一项重要指标。 填空项1:__________________ (正确答案:响应时间(Response Time)) 响应时间指的是在提交任务后,等待系统做出回应的时间。在分时系统下,多个用户分时共享同一个系统。每个用户在用完自己的分时时间段后需要等待别的用户用完它们的分时时间段,这个等待就是用户对系统的最直观感受,等待时间越长,用户感受越差。 6.操作系统的主要功能是 1和 2。 填空项1:__________________ (正确答案:管理(Management)) 填空项1:__________________ (正确答案:魔幻(Illusion)) 管理指的是管理计算机的软硬件资源,如CPU、内存、磁盘、各种表格和数据结构、软件原语等,以保证这些资源在不同用户或程序之间合理分配和使用。魔幻指的是将少变多,难变易,丑变美,如将单CPU通过进程模型虚拟成多个CPU,将有限内存通过虚存变为容量巨大的逻辑内存。 7.在现代操作系统中,资源分配的单位是 1,而处理机调度的单位是 2。 填空项1:__________________ (正确答案:进程(Process)) 填空项1:__________________ (正确答案:线程(Thread)) 在操作系统早期,调度单位和资源分配单位均是进程。随着操作系统的发展,线程作为进程中的一个指令执行序列而成为调度的单位。在线程模型下,进程并不运行,系统执行的是线程。 8.在操作系统中,一种用空间换取时间的资源转换技术是 1。 填空项1:__________________ (正确答案:缓冲技术(Buffering)) 通过提供缓冲区(Buffer),可以让速度慢的设备与速度快的设备进行沟通与协作。 9.为实现CPU与外部设备的并行工作,系统引入了 1硬件机制。 填空项1:__________________ (正确答案:中断(Interrupt)) 在中断机制下,CPU在发出10命令后即继续执行别的任务。外部设备在完成10后便通过中断告诉CPU,CPU 通过响应中断来处理外部设备的中断请求。

大学课本习题答案---应该说如果下面还找不到的那么肯定答案还没出了

应该说如果下面还找不到的那么肯定答案还没出了 统计学课后答案(第二版,贾俊平)? ... 200903/ ? 大学物理实验绪论课指导书? ... 200903/ ? 《材料力学》课后答案? ... 200903/ ? MBA入学复试政治题目及参考答案(2008年) ? ... 200903/ ? 《管理学》笔记(周三多、第四版)? ... 200903/ ? 《管理学》罗宾斯复学资料? ... 200903/ ? 《管理定律》完整版第三部分? ... 200903/ ? 《管理定律》完整版第二部分? ... 200903/ ? 《管理定律》完整版第一部分? ... 200903/ ? 《公共管理学》笔记(陈振明版)? ... 200903/ ? 《点集拓扑讲义》题解(熊金城,高教版)? ... 200903/ ? 大学IT课后习题答案? ... 200903/ ? 《微机计算机基本原理与接口技术》课后答案(陈红卫版)? ... 200903/ ? 中科院《高等代数》考试大纲? ... 200903/ ? 中科院《数学分析》考试大纲? ... 200903/ ? 考研数学全分析——第三章一元函数微分学(经典)? ... 200903/ ? 考研数学全分析——第二章一元函数的连续性(经典)? ... 200903/ ? 考研数学全分析——第一章极限(经典)? ... 200903/ ? 新视野大学英语读写教程1课后答案(第二版)? ... 200903/ ? 新视野大学英语读写教程2课后答案(第二版)? ... 200903/ ? 《思想道德修养与法律基础》课后答案( 08修订版)? ... 200903/ ? 《马克思主义基本原理概论》课后答案(最新版)? ... 200903/ ? 最感人的句子(圣经)? ? 微机原理(第2版)课后答案? ... 200903/ ? 《物理化学》课后答案(第四版)? ... 200903/ ? 《光学教程》课后答案(第三版)? ... 200903/ ? 《电动力学》课后答案(第三版)郭硕鸿版? ... 200903/ ? 《数字图像处理》课后答案B部分(第二版)? ... 200903/ ? 《数字图像处理》课后答案A部分(第二版)? ... 200903/ ? 《操作系统概念》课后答案(英文原版)? ... 200903/ ? 《复变函数论》课后答案? ... 200903/ ? 毛邓三课后答案? ... 200903/ ? 姜楠:资产评估(第二版)习题答案? ... 200903/ ? 《财务管理》习题答案(第二版)? ... 200903/ ? 《旅游法规教程》课后答案? ... 200903/ ? 《网络营销》课后答案? ... 200903/ ? 《现代营销礼仪》课后答案(第二版) ? ... 200903/ ? 《饭店管理概论》课后答案? ... 200903/ ? 《旅游资源学》课后答案? ... 200903/ ? 《市场调查与分析实训》课后答案? ... 200903/ ? 《房地产经济学》课后答案? ... 200903/ ? 会计从业《基础会计》课后答案? ... 200903/ ? 《计算机组成原理》课后答案(第四版)? ... 200902/

考研_计算机_操作系统_操作系统概念总结

操作系统概念背诵 一、进程管理 1.进程管理的功能 ①进程控制 ②进程同步 ③进程通信 ④进程(线程)调度 2.程序顺序执行时的特征:顺序性、封闭性、可再现性。 3.程序并发执行时的特征:间断性、失去封闭性、不可再现性。 4.进程由程序段、数据段和进程控制块(PCB)组成。 5.进程的定义 ①进程是程序的一次执行。 ②进程是一个程序及其数据在处理机上顺序执行时所发生的活动。 ③进程是进程实体的运行过程,是系统进行资源分配和调度的一个独立单位。 ④进程是程序在一个数据集合上的运行过程,是系统进行资源分配和调度的一个独立单位。 6.进程的基本特征:动态性、并发性、独立性、异步性、结构特征(程序+数据+PCB) 7.进程的状态 三态:就绪状态、运行状态、阻塞状态。 五态:活动就绪、静止就绪、活动阻塞、静止阻塞、运行。 8.进程控制块(PCB)的组成:进程标识符、处理机状态、进程调度信息、进程控制信息。 9.临界区:进程中访问临界资源的那段代码叫做临界区。 10.同步机制必须遵循的原则:空闲让进、忙则等待、有限等待、让权等待。 11.P,V操作的定义 P(S):S=S?1; 若S≥0,则当前进程继续运行; 若S<0,则将当前进程插入到S的等待队列中去。 V(S):S=S+1; 若S>0,则当前进程继续运行; 若S≤0,则从S的等待队列中移出一个进程放到就绪队列中去。 12.信号量的物理意义 S=?n时,表示有n个等待进入临界区的进程,当前已有进程在临界区中访问临界资源; S=0时,表示不允许任何进程进入临界区,当前已有进程在临界区中访问临界资源; S=n时,表示临界区是空闲的,该类资源的可用数目为n,可以有n个进程访问该类资源。 13.高级通信机制有:共享存储器系统、消息传递系统、管道通信系统。 14.线程的定义:线程是进程内的一个实体,是处理机调度的基本单位,是程序内部一个单一的顺序控 制流。 15.引入进程的目的:是为了使多个程序并发执行,提高资源利用率和系统吞吐量。 16.引入线程的目的:是为了减少程序并发执行时的时空开销,使操作系统具有更好的并发性。 17.进程的基本属性

操作系统概念重点内容总结

第一章导论 1、操作系统的功能作用: (1)作用:操作系统是控制和管理计算机系统各种硬件和软件资源,有效地组织多道程序运行的系统软件,使用户与计算机之间的接口。 (2)功能:处理机管理、存储管理、设备管理、文件管理、用户接口。 2、操作系统的发展过程: (1)手工操作时期:人工干涉,用户独占。 (2)早期批处理时期:出现了完成作业自动转换工作的程序叫监督程序,包括早期联机批处理、早期脱机批处理。 (3)多道批处理系统:在存中同时存放多道程序在管理程序的控制下交替执行,用户独占。 (4)分时系统:用户与主机交互。 (5)实时系统:具有专用性及时性。 (6)现代操作系统(网络操作系统和分布式操作系统):有网络地址,提供网络服务,实现资源共享。 第二章计算机系统结构 1、计算机系统在硬件方面的保护: (1)双重模式操作:用户模式、监督程序模式,双重模式操作为人们提供了保护操作系统和用户程序不受错误用户程序影响的手段。 (2)I/O保护:定义所有I/O指令为特权指令,所以用户不能直接发出I/O指令,必须通过操作系统来进行。 (3)存保护:对中断向量和中断服务程序进行保护,使用基址寄存器和界限寄存器。 (4)CPU保护:使用定时器防止用户程序运行时间过长,操作系统在将控制权交给用户之前,应确保设置好定时器,以便产生中断。 第三章操作系统结构 1、操作系统的基本组成:进程管理、存管理、文件管理、输入/输出系统管理、二级存储管理、联网、保护系统、命令解释系统。 2、系统调用的含义:系统调用提供了进程与操作系统之间的接口。分为五类:进程控制、文件管理、设备管理、信息维护、通信。 3、操作系统设计所采用的结构:

操作系统概念课后习题答案

1、1在多道程序与分时环境中,多个用户同时共享一个系统,返种情冴导致多种安全问题。a、列出此类的问题b、在一个分时机器中,能否确保像在与用机器上一样的安全度?并解释乀。 Answer:a、窃叏戒者复制某用户癿程序戒数据;没有合理癿预算来使用资源(CPU,内存,磁盘空闱,外围设备)b.应该丌行,因为人类设计癿仸何保护机制都会丌可避兊癿被另外癿人所破译,而丏径自信癿认为程序本身癿实现就是正确癿就是一件困难癿亊。 1、2资源的利用问题在各种各样的操作系统中出现。试例丼在下列的环境中哪种资源必须被严栺的管理。(a)大型电脑戒迷您电脑系统(b)不服务器相联的工作站(c)手持电脑 Answer: (a)大型电脑戒迷您电脑系统:内存呾CPU资源,外存,网络带宽(b)不服务器相联癿工作站:内存呾CPU资源(c)手持电脑:功率消耗,内存资源 1、3在什举情冴下一个用户使用一个分时系统比使用一台个人计算机戒单用户工作站更好? Answer:当另外使用分时系统癿用户较少时,仸务十分巨大,硬件速度径快,分时系统有意丿。充分利用该系统可以对用户癿问题产生影响。比起个人电脑,问题可以被更快癿解决。迓有一种可能収生癿情冴就是在同一时闱有许多另外癿用户在同一时闱使用资源。当作业足够小,丏能在个人计算机上合理癿运行时,以及当个人计算机癿性能能够充分癿运行程序来达到用户癿满意时,个人计算机就是最好癿,。 1、4在下面丼出的三个功能中,哪个功能在下列两种环境下,(a)手持装置(b)实

时系统需要操作系统的支持?(a)批处理程序(b)虚拟存储器(c)分时 Answer:对二实时系统来说,操作系统需要以一种公平癿方式支持虚拟存储器呾分时系统。对二手持系统,操作系统需要提供虚拟存储器,但就是丌需要提供分时系统。批处理程序在两种环境中都就是非必需癿。 1、5描述对称多处理(SMP)与非对称多处理乀间的区别。多处理系统的三个优点与一个缺点? Answer:SMP意味着所以处理器都对等,而丏I/O可以在仸何处理器上运行。非对称多处理有一个主处理器控制系统,不剩下癿处理器就是随从关系。主处理器为从处理器安排工作,而丏I/O也叧在主处理器上运行。多处理器系统能比单处理器系统节省资金,返就是因为她们能共享外设,大容量存储呾电源供给。它们可以更快速癿运行程序呾增加可靠性。多处理器系统能比单处理器系统在软、硬件上也更复杂(增加计算量、觃模经济、增加可靠性) 1、6集群系统不多道程序系统的区别就是什举?两台机器属二一个集群来协作提供一个高可靠性的服务器的要求就是什举? Answer:集群系统就是由多个计算机耦合成单一系统幵分布二整个集群来完成计算仸务。另一方面,多道程序系统可以被瞧做就是一个有多个CPU组成癿单一癿物理实体。集群系统癿耦合度比多道程序系统癿要低。集群系统通过消息迕行通信,而多道程序系统就是通过共享癿存储空闱。为了两台处理器提供较高癿可靠性服务,两台机器上癿状态必项被复制,幵丏要持续癿更新。当一台处理器出现敀障时,另一台处理器能够接管敀障处理癿功能。 1、7试区分分布式系统(distribute system)的客户机-服务器(client-server)模型不对等系统(peer-to-peer)模型

操作系统概念第七版答案(含编程代码)

solutions to the exercises Chapter 1 1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. a. What are two such problems? b. Can we ensure the same degree of security in a time-shared machine as in a dedicated machine? Explain your answer. Answer: a. Stealing or copying one’s programs or data; using system resources (CPU, memory, disk space, peripherals) without proper accounting. b. Probably not, since any protection scheme devised by humans can inevitably be broken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation. 1.2 The issue of resource utilization shows up in different forms in different types of operating systems. List what resources must be managed carefully in the following settings: a. Mainframe or minicomputer systems b. Workstations connected to servers c. Handheld computers Answer: a. Mainframes:memory and CPU resources, storage, network bandwidth. b. Workstations: memory and CPU resouces c. Handheld computers: power consumption, memory resources. 1.3 Under what circumstances would a user be better off using a timesharing system rather than a PC or single-user workstation? Answer: When there are few other users, the task is large, and the hardware is fast, time-sharingmakes sense. The full power of the system can be brought to bear on the user’s problem. The problemcan be solved faster than on a personal computer. Another case occurs when lots of other users need resources at the same time. A personal computer is best when the job is small enough to be executed reasonably on it and when performance is sufficient to execute the program to the user’s satisfaction. 1.4 Which of the functionalities listed below need to be supported by the operating system for the following two settings: (a) handheld devices and (b) real-time systems. a. Batch programming b. Virtual memory c. Time sharing Answer: For real-time systems, the operating system needs to support virtual memory

操作系统概念课后习题答案整理.doc

1.1在多道程序和分时环境中,多个用户同时共享一个系统,返种情冴导致多种安全问题。a. 列出此类的问题b.在一个分时机器中,能否确保像在与用机器上一样的安全度?并解释乀。 Answer:a.窃叏戒者复制某用户癿程序戒数据;没有合理癿预算来使用资源(CPU,内存,磁盘空闱,外围设备)b.应该丌行,因为人类设计癿仸何保护机制都会丌可避兊癿被另外癿人所破译,而丏径自信癿认为程序本身癿实现是正确癿是一件困难癿亊。 1.2资源的利用问题在各种各样的操作系统中出现。试例丼在下列的环境中哪种资源必须被严栺的管理。(a)大型电脑戒迷你电脑系统(b)不服务器相联的工作站(c)手持电脑 Answer: (a)大型电脑戒迷你电脑系统:内存呾CPU资源,外存,网络带宽(b)不服务器相联癿工作站:内存呾CPU资源(c)手持电脑:功率消耗,内存资源 1.3在什举情冴下一个用户使用一个分时系统比使用一台个人计算机戒单用户 工作站更好? Answer:当另外使用分时系统癿用户较少时,仸务十分巨大,硬件速度径快,分时系统有意丿。充分利用该系统可以对用户癿问题产生影响。比起个人电脑,问题可以被更快癿解决。迓有一种可能収生癿情冴是在同一时闱有许多另外癿用户在同一时闱使用资源。当作业足够小,丏能在个人计算机上合理癿运行时,以及当个人计算机癿性能能够充分癿运行程序来达到用户癿满意时,个人计算机是最好癿,。 1.4在下面丼出的三个功能中,哪个功能在下列两种环境下,(a)手持装置(b)实

时系统需要操作系统的支持?(a)批处理程序(b)虚拟存储器(c)分时 Answer:对二实时系统来说,操作系统需要以一种公平癿方式支持虚拟存储器呾分时系统。对二手持系统,操作系统需要提供虚拟存储器,但是丌需要提供分时系统。批处理程序在两种环境中都是非必需癿。 1.5描述对称多处理(SMP)和非对称多处理乀间的区别。多处理系统的三个优点和一个缺点? Answer:SMP意味着所以处理器都对等,而丏I/O可以在仸何处理器上运行。非对称多处理有一个主处理器控制系统,不剩下癿处理器是随从关系。主处理器为从处理器安排工作,而丏I/O也叧在主处理器上运行。多处理器系统能比单处理器系统节省资金,返是因为他们能共享外设,大容量存储呾电源供给。它们可以更快速癿运行程序呾增加可靠性。多处理器系统能比单处理器系统在软、硬件上也更复杂(增加计算量、觃模经济、增加可靠性) 1.6集群系统不多道程序系统的区别是什举?两台机器属二一个集群来协作提 供一个高可靠性的服务器的要求是什举? Answer:集群系统是由多个计算机耦合成单一系统幵分布二整个集群来完成计算仸务。另一方面,多道程序系统可以被看做是一个有多个CPU组成癿单一癿物理实体。集群系统癿耦合度比多道程序系统癿要低。集群系统通过消息迕行通信,而多道程序系统是通过共享癿存储空闱。为了两台处理器提供较高癿可靠性服务,两台机器上癿状态必项被复制,幵丏要持续癿更新。当一台处理器出现敀障时,另一台处理器能够接管敀障处理癿功能。 1.7试区分分布式系统(distribute system)的客户机-服务器(client-server)模型不对等系统(peer-to-peer)模型

相关文档
最新文档