1. What are the logical organization of a file? Mass Storage 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices Secondary Storage devices - Limited, Volatile, Expensive - Extendible, Persistent, Cheap - Fast (accessed directly from the - Slow (data must be copied to main memory) CPU) - Access time in msec. - Access time in nanoseconds. 3. What are the difference between serial devices and Direct Access Storage Devices? Direct Access Storage Devices (DASDs) - Offer high storage capacity and low cost - Store data as magnetized areas on magnetic platters surfaces - Examples: - Magnetic Disks, Hard Disks, Optical Disks - CD-ROM, DVD-ROM Serial Devices - Magnetic Tapes 4. Describe the physical structure of magnetics disk? Magnetic disks support direct access and It consisted of: Disk blocks Tracks Platters Cylinder
Sectors Disk heads Disk Controller Seek Time and Rotational delay 5. How to calculate disk capacity? Drive capacity = number of cylinders cylinder capacity Number of cylinders = number of tracks in a surface Cylinder capacity = number of surfaces track capacity Track capacity = number of sector per track bytes per sector 6. How many cylinders to store a file with 20,000 fixed length records of 256 bytes each on a disk with 512 bytes per sector, 40 sectors per disk and 11 tracks per cylinder? Answer: - The file is 20,000 * 256 = 5,120,000 bytes - 5,120,000 / 512 = 10,000 sectors - 10,000 / 40 = 250 tracks - 250 / 11 = 22.72 cylinders - If 22.72 physically contiguous cylinders are not available then the file will have to be spread out over the disk (fragmentation) 7. List tow methods used to organize data on magnetic disks? Data can be organized on disk in two different ways: Sectors User defined blocks. 8. How can data organized on magnetic disks using sectors? 1. Physically Placement of sectors
2. Clusters (fixed number of contiguous sectors) The file is viewed as a set of clusters of sectors. 3. Extent The whole file stored on one extent the file stored on more than one extent 9. How can data organized on magnetic disks using Blocks? Disk tracks are divided into user defined blocks with variable size. 10. List at least four disk scheduling algorithms? a. First Come First Served b. Shortest Seek Time First (SSTF) c. SCAN (elevator algorithm) d. CCAN e. C-LOOK
11. Disk requests come into the disk driver for cylinders: 95, 180, 34, 119, 11, 123, 62, 64 in that order. The disk has 200 total cylinders and the disk head is currently positioned over cylinder 50. What is the sequence of reads and total seek time using each of the following algorithms? a. First Come First Served 50-95 + 95-180 + 180-34 + 34-119 + 119-11 + 11-123 + 123-62 + 62-64 Total: 45+85+146+85+108+112+61+2 = 640 Total: 236 b. Shortest Seek Time First (SSTF) Total: 230 c. SCAN d. C-SCAN e. C-Look C-SCAN had a total movement of 187, but this scan (C-LOOK) reduced it down to 157 tracks.
12. Another Example Example: 55, 58, 39, 18, 90, 160, 150, 38, 184 13. See the example in the lecture 14. List Many different types of information may be stored in a file? a. Source programs: sequence of subroutines, functions, declaration and exec statements. b. Object programs: a sequence of bytes organized into blocks understandable by the system s linker. c. Executable programs, a series of code sections that the loader can bring into memory and execute. d. numeric data, e. Text - a sequence of characters organized into lines (and possibly pages). f. payroll records, g. graphic images, h. Sound recordings, and so on. 15. List at least 4 file attributes that identify files? A file s attributes vary from one operating system to another but typically consist of these: a. Name only information kept in human-readable form b. Identifier unique tag (number) identifies file within file system c. Type needed for systems that support different types d. Location pointer to file location on device e. Size current file size f. Protection controls who can do reading, writing, executing g. Time, date, and user identification data for protection, security, and usage monitoring 16. List the different operations that can be applied on a file? a. Create file b. Write to a file c. Read from a file d. Reposition within file (File Seek) e. Delete f. Truncate a file
g. Open(Fi) h. Close (Fi) i. Appending new information to the end of an existing file. j. Renaming an existing file. k. Create a copy of a file to another location l. Get and set file attributes. 17. What are the elements that constitute a File Control Block? 18. List the different methods used for accessing data in a file? a. Serial Access Each record is stored, one after the other, with no logical order. Suited to magnetic tape b. Sequential Access Records are kept in some pre-defined order Suited to magnetic tape c. Random Access or direct access Records are accessed directly.suitable for magnetic disks d. Indexed Sequential Like an index in the back of a book, contains pointers to the various blocks.