Operating system exercises and answers-Chapter 6 Equipment Management

Operating System Chapter 6 Equipment Management Practice Questions

1. Multiple choice questions
1. In the operating system, users usually use (B) when using I/O devices.
A. Physical device name B. Logical device name
C. Virtual device name D. Device brand
2. The purpose of using buffer technology in the operating system is to enhance the capability of the system (D).
A. Serial operation B. Control operation C. Re-execution operation D. Parallel operation
3. The operating system adopts buffering technology, which can reduce the number of CPU (A) times, thereby improving resource utilization.
A. Interrupt B. Access C. Control D. Dependence
4. The speed of CPU output data is much higher than the printing speed of the printer. In order to solve this contradiction, (C) can be used.
A. Parallel technology B. Channel technology C. Buffer technology D. Virtual memory technology
5. Buffer technology is used for (A).
A. Improve the speed of information exchange between the host and the device.
B. Provide the main and auxiliary memory interfaces.
C. Improve the utilization of the device.
D. Expand the relative address space.
6. The channel is one type (C).
AI/O port B. Data channel CI/O dedicated processor D. Software tool
7. One of the main programs of device management is the device allocation program. When the process requests to transfer information between memory and peripherals, the device allocation program allocates The process of equipment is usually (A).
A. Assign the device first, then the controller, finally assign channel
B, first assign the controller, then assign the device, finally assign channel
C, assign the channel first, then assign the device, finally assign the controller
D, assign the channel first, then assign Controller, the device is finally allocated.
8. In the following description, the function that is not device management is (C).
A. Realize the allocation and recycling of peripheral equipment B. Buffer management and address translation
C. Realize access by name D. Realize I/O operation
9. The program compiled by the user has nothing to do with the physical equipment actually used and is realized by the function (D).
A. Equipment allocation B. Device driver C. Virtual device D. Equipment independence
10. SPOOLing technology is used in (D).
A. Peripheral concept B. Virtual device concept
C. Tape concept D. Storage concept
11. The purpose of using SPOOLing technology is (A).
A. Improve the utilization of exclusive equipment B. Improve the efficiency of the host
C. Reduce the burden of user programming D. Improve the running speed of the program
12. The purpose of adopting spooling technology is (A).
A. Improve the utilization of peripherals and the host. B. Improve the efficiency of memory and host.
C. Reduce the burden of user programming. D. Improve the running speed of the program.
13. Spooling technology is generally not applicable (A).
A. Time-sharing system B, multi-channel batch processing system
C, network operating system D, multi-processor system
2.
Fill in the blanks 1. Storage devices are also called (internal) devices; input/output devices are also called (external) devices .
2. From the perspective of resource allocation, devices can be divided into (exclusive devices), (shared devices) and (virtual devices).
3. Virtual device is to use (virtual) technology to turn (exclusive) device into a device that can be (shared) by several users.
4. The commonly used equipment allocation algorithms are (first come, first served algorithm) and (high priority priority service algorithm).
5. The (device driver) is the core module that controls the actions of the device, such as opening, closing, reading, writing, etc., to control the transmission of data on the device.
6. SPOOLing system is generally divided into four parts: input storage, (input process), (output process) and output. The middle two parts are responsible for the management of input wells and output wells.

3. Short answer questions
1. Briefly describe the structure of the I/O system.
The hierarchical structure of I/O is: user-level softwaredevice independence softwaredevice driverinterrupt handlerhardware①user-
level I/O software. User interaction interface, the user can directly call the library functions related to I/O operation provided by this layer to operate the device;
②The equipment independence software is used to realize the unified interface and equipment between the user program and the equipment. Naming, protection of equipment, allocation and release of equipment, etc., while providing necessary storage space for equipment management and data transmission;
③Device driver, directly related to the hardware, used to implement the operating instructions issued by the system to the equipment, and drive I /O device working driver;
④Interrupt handler, used to protect the CPU environment of the interrupted process, transfer to the corresponding interrupt handler for processing, and restore the scene of the interrupted process after the processing is completed, then return to the interrupted process .
2. Briefly describe the control method of I/O equipment
①The programmable I/O method using polling;
②The programmable I/O method using interrupt
;
③Direct memory access method; ④I/O channel method.
3. Why should we introduce buffer technology?
①Relieve the contradiction between CPU and I/O equipment speed mismatch;
②Reduce the number of interrupts to the CPU;
③Improve the parallelism between CPU and I/O equipment.
4. What are the main functions of the device driver?
①Accept the user's I/O request;
②Remove the head of the request from the request queue and assign the corresponding device to it;
③Start the device to complete the specified I/O operation;
④Process the interrupt from the device.
5. Briefly describe the data structure and allocation process used in the allocation of exclusive equipment.
The data structures used are: process control block (PCB), device control table (DCT), controller control table (COCT), channel control table (CHCT), system device table (SDT);
allocation process: allocation device  allocation Controller  Allocation Channel
IV. Calculation problem
1. Assuming that the head is currently located on track 105 and is moving in the direction of increasing track number. The existing track access request sequence is 35, 45, 12, 68, 110, 180, 170, 195, respectively, using SSTF scheduling algorithm (shortest seek time priority scheduling) and SCAN scheduling algorithm (elevator scheduling) to calculate the average moving track Count and compare the pros and cons.
Answer: SSTF scheduling algorithm: Seek order: 10511068453512170180195 The
number of moving tracks are: 5422310231581015
average search Track length=35.75
SCAN scheduling algorithm: 10511017018019568453512 The
number of moving tracks are: 5601015127231023
average seek length =34.125
Because 34.125<35.75, the SCAN scheduling algorithm is better than the SSTF scheduling algorithm in this sequence.
2. Assuming that the current head is located on track 100, the sequence of requests for tracks by the process is 55, 58, 39, 18, 90, 160, 150, 38, and 180.
When using first-come, first-served and shortest seek time first algorithms, what is the total number of tracks moved? (Please give the seek order and the number of moving tracks per step)
Answer: FCFS scheduling algorithm:
Seek order: 100555839189016015038180 The
number of moving tracks are: 45 31921727010112142
Total number of moving tracks=494
SSTF scheduling algorithm:
Seek order: 100905855393818150160180 The
number of moving tracks is: 10323161 201321020
total number of moving tracks=244

Guess you like

Origin blog.csdn.net/weixin_44145894/article/details/106123416