Presentation is loading. Please wait.

Presentation is loading. Please wait.

File Organizations March 2007R McFadyen ACS - 39021 File Organization Hardware Description of Disk Devices Buffering of Blocks File Records on Disk Review.

Similar presentations


Presentation on theme: "File Organizations March 2007R McFadyen ACS - 39021 File Organization Hardware Description of Disk Devices Buffering of Blocks File Records on Disk Review."— Presentation transcript:

1 File Organizations March 2007R McFadyen ACS - 39021 File Organization Hardware Description of Disk Devices Buffering of Blocks File Records on Disk Review from other courses

2 File Organizations March 2007R McFadyen ACS - 39022 Hardware Description of Disk Devices -Magnetic disks: used for storing data -floppy disk: 400 Kbytes - 1.5 Mbytes -hard disk: hundred Mbytes – Gbytes -single-sided or double-sided -disk pack: disks assembly -track, cylinder, sector

3 File Organizations March 2007R McFadyen ACS - 39023... actuator track cylinder sector (arc of a track)

4 File Organizations March 2007R McFadyen ACS - 39024 - Sector: Each track is divided into sectors by the disk management system. It is hard-coded and cannot be changed. Not all disks have their tracks divided into sectors. - Block: Each track is divided into blocks by the operating system during disk formatting (or initialization). Block size is fixed during formatting and cannot be changed dynamically. Block size: 512 - 4096 bytes. A disk with hard-coded sectors has the sectors subdivided into blocks. Blocks are separated by fixed-size interblock gaps.

5 File Organizations March 2007R McFadyen ACS - 39025 Data Transfer (Read/Write) data transfer unit: a block or a cluster (several contiguous blocks) Buffer: a contiguous area reserved in main memory that holds a block.

6 File Organizations March 2007R McFadyen ACS - 39026 Buffering of Blocks -Several buffers can be reserved in main memory. While one buffer is being read or written, the CPU can process data in the other buffers. -concurrency: interleaved or in parallel time t1t1 t2t2 t3t3 t4t4 A A B B C D

7 File Organizations March 2007R McFadyen ACS - 39027 -Double Buffering The CPU can start processing a block once its transfer to main memory is completed; at the same time the disk I/O processor can be reading and transferring the next block into a different buffer. i fill A i+1 fill B i+2 fill A i+3 fill B i+4 fill A i process A i+1 process B i+2 process A i+3 process B i+4 process A time Disk block: I/O: Disk block: Processing:

8 File Organizations March 2007R McFadyen ACS - 39028 File Records on Disk -Record: a collection of related data values or items, where each value is formed of one or more bytes and corresponds to a particular field of the record. -Record type: a collection of field names and their corresponding data types. A data type, associated with each field, specifies the type of values a field can take. Example: struct employee { char name[30]; char SSN[9]; intsalary; int jobcode; char department[20]; };

9 File Organizations March 2007R McFadyen ACS - 39029 -Fixed-length records and variable-length records Fixed-length records: NameSSN Salary JobCode Department Hire-Date 130 4044 486871 Variable-length records: Smith, John 123456789 xxxx Computer name SSN salary JobCode department 1 1221252937 NAME=Smith, John SSN=123456789 DEPARTMENT=Computer 

10 File Organizations March 2007R McFadyen ACS - 390210 -Record blocking: spanned versus unspanned records The records of a file must be allocated to disk blocks because a block is the unit of data transfer between disk and memory. Unspanned records: record 1 record 2record 3 unused record 4 record 5record 6 Spanned records: block i block i+1 record 1 record 2record 3 block i block i+1 record 4 record 4 ( continued ) record 5record 6 record 7 P


Download ppt "File Organizations March 2007R McFadyen ACS - 39021 File Organization Hardware Description of Disk Devices Buffering of Blocks File Records on Disk Review."

Similar presentations


Ads by Google