Bab 11 1. List and briefly define three techniques for performing I/O. Answer: Three techniques for performings I/O: a. Programmed I/O: The processor issues an I/O command, on behalf of a process, to an I/O module; that process then busy waits for the operation to be completed before proceeding. b. Interrupt-driven I/O: The processor issues an I/O command on behalf of a process.There process.There are then two possibilities. If the I/O instruction from the process is nonblocking, then the processor continues to execute instructions from the process that issued the I/O command. If the I/O instruction is blocking, then the next instruction that the processor executes is from the OS, which will put the current process in a blocked state and schedule another process.What is the difference between logical I/O and device I/O? c. Direct memory access (DMA): A DMA module controls the exchange of data between main memory and an I/O module. The processor sends a request for the transfer of a block of data to the t he DMA module and is interrupted only after the entire block has been transferred. 2. What is the difference between logical I/O and device I/O? Answer: Logical I/O: The logical I/O module deals with the device as a logical resource and is not concerned with the details of actually controlling the device. The logical I/O module is concerned with managing general I/O functions on behalf of user processes, allowing them to deal with the device in terms of a device identifier and simple commands such as open, close, read, write. Device I/O: The requested operations and data (buffered characters, records, etc.) are converted into appropriate sequences of I/O instructions, channel commands, and controller orders. Buffering techniques may be used to i mprove utilization. 3. What is the difference between block-oriented devices and stream-oriented devices? Give a few examples of each. Answer: A block-oriented device stores information in blocks that are usually of fixed size, and transfers are made one block at a time. It is possible p ossible to reference data by its block number. Disks and USB keys are examples of block-oriented devices. A stream-oriented device transfers data in and out as a stream of bytes,with no block structure. Terminals, printers, communications ports,mouse and other pointing devices, and most other devices that are not n ot secondary storage are stream oriented. 4. Why would you expect improved performance using a double buffer rather than a single buffer for I/O? Answer: Because a double buffer is An improvement over single buffering can be had by assigning two system buffers to the operation. For block-oriented transfer, we can roughly estimate the execution time as max [ C , T ]. ]. It is therefore possible to keep the block-oriented device going at full speed if C <= T .On .On the other hand, if C > T , double buffering ensures that the process will not have to wait on I/O. This
improvement comes at the cost of increased complexity. For stream-oriented input, we again are faced with the two alternative modes of operation. For line-at-a-time I/O, the user process need not be suspended for input i nput or output, unless the process runs ahead of the double buffers. For byte-at-atime operation, the double buffer offers no particular advantage over over a single buffer of twi twice ce the length. 5. What delay elements are involved in a disk read or write? 6. Briefly define the seven RAID levels. l evels. Answer:
7. What is the typical disk sector size? Bab 12 1. What is the difference between a field and a record? Answer: A field is the basic element of data.An individual field contains a single value, such as an employee’s last name, a date, or the value val ue of a sensor reading. It is characterized by its length and data type. fields may be fixed length or variable length. the field often consists of two or three subfields: the actual value to be stored, the name of the field, and, in some cases, the length of the field. the length of the field is indicated by the use of special demarcation symbols between fields. A record is a collection of related fields that can be treated as a unit by some application program. For example, an employee record would contain such fields as name, social security number, job classification, classification, date of hire, and so on. A record will be of variable length if some of its fields are of variable length or if the number of fields may vary. each field is usually accompanied by a field name. 2. What is the difference between a file and a database? Answer: A file is a collection of similar records. The file is treated t reated as a single entity by users and applications and may be referenced by name. Files have file names and may be created and deleted.
A database is a collection of related data. the relationships that exist among elements of data are explicit. The database is designed for use by a number of different applications. A database may contain all of the t he information related to an organization or project, such as a business or a scientific study. The database consists of one or more types of files. Usually, Usuall y, there is a separate database management management system that is is independent independent of the t he operating system, although that system may make use of some file management management programs.
3. What is a file management system? Answer: A file management system is that set of system software that provides services to users and applications in the use of files. The way that a user or application may access files is through the file fil e management system. 4. What criteria are important in choosing a file organization? Answer: In choosing a file organization, several criteria are important: • Short access time • Ease of update • Economy of storage • Simple maintenance • Reliability 5. List and briefly define five file organizations. Answer: The five organizations are: • The pile Data are collected in the order in which they arrive. Records may have different fields, or similar fields in different orders. • The sequential file • The indexed sequential file • The indexed file • The direct, or hashed, file 6. Why is the average search time to find a record in a file less for an indexed i ndexed sequential sequential file than for a sequential file? 7.