This action might not be possible to undo. Are you sure you want to continue?
They are stacked one on top of another. Each of these heads is attached to an arm. Disk contain one or more platter. . 7200 rpm(rotation per minute). They rotate together round a central spindle. Data is read from and written to these platters using a number of read/write heads. 5400. Each platter contain magnetic coating on both side of its surface. Rotation speed is normally 3600. Disk contain 1 to 8 platter.
The tracks are identified by number. which are used to store a fixed amount of data.Tracks and Sectors Tracks are concentric circular paths written on each side of a platter. Sectors are usually formatted to contain 512 bytes of data . starting with track zero at the outer edge. Normally there are more than thousands on tracks on a single surface Tracks are divided into fixed size blocks called sectors.
. this was called FIXED SECTOR PER TRACK SYSTEM.Zoned Bit Recordings Older hard drive had the same number of sectors in each track. New hard drives vary the number of sectors on each track because as the tracks move towards the outer edge of the platter they are larger so more fit.
Cylinders A cylinder is comprised of a set of tracks that lie at the same distance from the spindle on all sides of all the platters. the set forms the shape of a cylinder. . . For example. track three on every side of every platter is located at the same distance from the spindle. If you imagine these tracks vertically connected.
head(track). sector(angular position number) LBA(logical block addressing) this method identifies sectors by simply specifying the sector number .Addressing CHS(cylinder head sector) This method identifies sectors by simply specifying the cylinder(radius).
Such address is provided to hard disk controller. Once the location is identified.Disk I/O To perform read/write operation OS needs to provide location by using any addressing method(CHS or LBA). Hard disk controller is an interface between OS and disk. Time required for this operation is called seek time. Wait till specified sector is directly comes above/below the read/ write head. Time required for this operation is called rotational latency Read/write the data. . 3 steps are followed Move the disk arm to position read/write head at specified cylinder.
A file is used to store information permanently. Data cannot be written on secondary storage unless it is written on a file. . Stores various kind of information such as text. database tables. which is stored in a secondary storage device.Files ³ A file is a named collection of related information. audio. images. machine code etc. video.
A file has a longer life span. Information stored in files can be shared among different processes users as well as machines. or Machine gets turned off. logs off from the system. users and machines. terminate. Information stored in files remains as it is even when ± A process. . which creates a file. A file is a static/passive entity. owner of the file. User.Files A file is an independent entity from processes.
Provides directories to organize files. Manage all the files in the system.File System ³A part of OS . etc. Manages memory space on secondary storage devices Provides protection mechanism.´ Its responsibility is. Provides efficient access to information stored in files. read & write contents of files. which deals with files. is known as file system or file manager. Provides facilities to create & delete files. .
Why we need files? The data must survive after the termination of the process using it. It must be possible to store very large amount of data. . Multiple processes must be able to access data concurrently. Solution is to store those data in units called files on disks & other media.
15 .File Naming Typical file extensions.
Prog. . Name Combination of alpha numeric & some special characters like (µ_¶) User convenience. Type Used to Identify type of a file.File Attributes A files includes set of other characteristics than just name & an extension.cpp indicates a C++ file. Location (device: location) This is a pointer to the device and location on that device of the file. Identifier (generally a number) It uniquely identifies the file within the file system.
date. write file. last modification. execute file & so on. last access) Usage count This value indicates the number of processes using its that are currently using it. .File Attributes Size Specifies the current size of the file ( in bytes. words or blocks) Protection (rwx) This information determines who can read file. Time. & user identification (creation.
File Attributes 18 .
Delete Remove the file from system freeing up the disk space & directory entry is erased. Open Before using a files must be open. x Directory entry should be made. File attributes & data contents are fetched in memory for faster access. Close when all the access is finished file must be closed.File operations Different system allow operations to store & retrieve data from files. Create Create a new file with no data & initial attributes 2 steps should be followed x Necessary disk space should allocated. Files attributes and data contents are stored back in the disk .
System maintain a read pointer specifying from where to read data. next operation starts from that position . a location is needed to specify from where to start read/write operation This operation reposition the file pointer(read/write pointer) to a specific location in a file. Write after opening a file data can be written to the file. at beginning it points to the starting location of the file. System maintain a write pointer specifying where to write data. Read after opening the file data can be read. After this. at beginning it points to the starting location of the file. After every read operation pointer is automatically updated. Append after opening a file data can be written to the end of the file. Seek for random access files.
Get attributes get the attributes of a file Set attributes set the attributes of a file Rename change the name or extension of the file Truncating a file Erases the content of a file but keeps its attributes .
Three common file structures byte sequence record sequence tree . It represents how data are stored in the file.File structure File structure is the way of storing data contents in a file.
while write operation overwrites or append one byte. It is most flexible form. .Byte sequence Data are stored as an unstructured sequence of bytes. Unix and windows use this approach. Read operation returns one byte. Entire file is treated as an array of bytes.
each record will have it own structure Read operation returns one record.Record sequence Data are stored as a sequence of fixed length records. while write operation overwrites or append one record It is suitable for database related applications .
Records may be of varying length Each record has key in fixed position in record used with large mainframe systems .Tree Data are stored as a tree of records.
.. All bitmap images files will contain µ. Encode type into file data file type can be encoded in file data. eg. In Unix. a magic number is used to identify executable files.g. it contains first few bytes of file data.types Regular files can further be categorized in various types based on their application and data content.bmp¶ as extension Encode type into file attribute Each file contains an attribute called file type. Encode type into file extension same file extensions are used for all the files of same types. For e.Files .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.