SlideShare a Scribd company logo
DISK
STRUCTURES
&
FILE HANDLING
FLOPPY
DISK
3 ½ INCH
5 ¼ INCH
HARD DISK
FILE ALLOCATION
DISK STRUCTURES:
Tracks, sectors, and
cylinders.
Disk partitions.
Disk capacity.
DISK STRUCTURES
Coal presentationt
FILE
FILE HANDLING
FILE HANDLE
FILE ERRORS
FILE POINTER
OPERATIONS OF
FILE
• 3CH
• 3DH
• 3EH
• 3FH
• 40H
• 41H
• 42H
FILE HANDLING
DISK STRUCTURES
The actual physical details of disk
FLOPPY DISK
1)Internal parts of a 3½-inch floppy disk.
2)A hole that indicates a high-capacity disk.
3)The hub that engages with the drive motor.
4)A shutter that protects the surface when
removed from the drive.
5)The plastic housing.
6)A polyester sheet reducing friction against the
disk media as it rotates within the housing.
7)The magnetic coated plastic disk.
8)A schematic representation of one sector of
data on the disk; the tracks and sectors are
not visible on actual disks.
9)The write protection tab (unlabeled) is upper
left.
 3 ½ INCH
 5 ¼ INCH
HARD DISK
1) Actuator that moves the
read-write arm.
2) Read-write arm swings
read-write head back and
forth across platter.
3) Central spindle allows
platter to rotate at high
speed.
4) Magnetic platter stores
information in binary form.
5) Plug connections link hard
drive to circuit board in
personal computer.
6) Read-write head is a tiny
magnet on the end of the
read-write arm.
7) Circuit board on underside
controls the flow of data to
and from the platter.
8) Flexible connector carries
data from circuit board to
read-write head and platter.
9) Small spindle allows read-
write arm to swing across
platter.
WORKING OF HARD DISK
STRUCTURE OF
DISK
Coal presentationt
CAPACITY OF THE 5 ¼ INCH DOUBLE
DENSITY FLOPPY DISK
CAPACITY OF HARD DISK
FILE ALLOCATION
To keep the track of data stored on a disk, DOS uses
a directory structure. The first tracks and sectors of a
disk contain information about the disk’s file
structure.
Coal presentationt
FILE DIRECTORY:
ATTRIBUTE BYTE
Cluster
“A fixed number of sector (depends on the kind of
disk) is called cluster”
(File Allocation Table):
“A table that the operating system uses to
locate files on a disk. Due to fragmentation, a file
may be divided into many sections that are
scattered around the disk. The FAT keeps track of all
these pieces.”
F
A
T
DOS
HOW DOS READ A FILE?
• DOS gets the starting
cluster number from
directory.
• DOS read that particular
cluster number from disk
and stored in DTA (Data
Transfer Area). The
program that initiated the
read retrieves data from
HOW DOS STORES A FILE?
• DOS locates an unused
directory entry and stores
the filename, attribute,
creation time and date.
• DOS searches the FAT for
the first entry indicating
unused cluster (000 means
unused) and stores the
starting cluster number in
the directory. Let’s suppose
FILE HANDLING
FILE
FILE HANDLING
FILE HANDLE
FILE ERRORS
FILE POINTER
OPERATIONS OF
FILE
• 3CH
• 3DH
• 3EH
• 3FH
• 40H
• 41H
• 42H
FILE HANDLING
File ?
File Handling ?
A file is an object on a computer that stores data, information, settings, or commands
that are used with a computer program.
Through file handling, one can perform operations like create, modify , delete etc
on File.
File Create Write Rename Delete
FILE HANDLES
When file is created or open in a
program, DOS assign it a unique
number called file handle.
Coal presentationt
FILE ERRORS
Coal presentationt
OPERATIONS OF FLE
3CH
3DH
3EH
3FH40H
41H
42H
3CH
42H
3EH3DH
40H 41H3FH
OPEN A NEW FILE /
REWRITE A NEW FILE
MOVE A FILE POINTER
DELETE A FILEWRITE A FILEREAD A FILE
CLOSE A FILE
OPEN AN
EXISTING A FILE
Creating File & Writing
FILE DB "c:example_newhello.txt",0
TEXT DB "HELLO I AM TEXT",0
TEXT_SIZE = $ - OFFSET TEXT
HANDLE DW ?
System Call AH BX CX DX
File Open 3CH 0 Offset Filename
File Write 40H Handle Text Size Offset Text
File Close 3EH Handle
Handle ?
Handle is some resources/memory to store temporary data , used in file operation
Create File Operation
MOV CX,0
MOV DX, OFFSET FILE ; FILENAME
MOV AH, 3CH ; 3CH FOR CREATING FILE
INT 21H
Write into File
MOV HANDLE, AX ; MAKE RESOURCES HANDLE
MOV AH, 40H ; 40H FOR WRITING INTO FILE
MOV BX, HANDLE ; COPY RESOURCES HANDLE
MOV DX, OFFSET TEXT ; TEXT TO WRITE
MOV CX, TEXT_SIZE ; TEXT SIZE
INT 21H;
Close File
MOV AH, 3EH ; 3EH FOR CLOSE FILE
MOV BX, HANDLE ; COPY RESOURCES HANDLE
INT 21H
Delete File
.DATA
FILE DB "C:EXAMPLE_NEWWORLD.TXT",0
.CODE
MOV DX, OFFSET FILE ; OLD FILENAME
MOV AH, 41H ; 41H FOR DELETE FILE
INT 21H
System Call AH BX CX DX
File Delete 41H Offset OldFilename
File pointer
 The file pointer is used to locate a position in the file.
 File is opened – file pointer is at the beginning of file.
 After read operation – it the next byte to be read.
 After writing – file pointer at end of file.
File pointer
Move File pointer
INT 21H, FUNCTION 42H
INPUT AH = 42H
AL = MOVEMENT CODE:
• 0 MOVE RELATIVE TO BEGINNIG
• 1 MOVE RELATIVE TO CUUERENT POINTER LOCATION
• 2 MOVE RELATIVE TO THE EOF
BX = FILE HANDLE
CX:DX = NUMBER OF BYTES TO MOVE
OUTPUT DX:AX = NEW POINTER LOCATION IN BYTES FROM THE BEGNNING OF FILE.
IF CF = 1 ERROR CODE IN AX (1,6).
System Call AH BX CX:DX
File pointer 42H File
handle
Number of
byte to
move
Caption

More Related Content

PPT
Disk management
PPTX
Storage memory
PPT
Disk structure
PPTX
Mass storage device
PPTX
Mass Storage Structure
PPTX
Disk Management
PPTX
Disk scheduling & Disk management
PPT
Hard disk
Disk management
Storage memory
Disk structure
Mass storage device
Mass Storage Structure
Disk Management
Disk scheduling & Disk management
Hard disk

What's hot (20)

PDF
Mass Storage Devices
PPTX
Secondary storage structure
PPT
Chap2 hdd2
PPTX
Mass storage systemsos
PPTX
Massstorage
PPSX
Hard drive partitions
PDF
Asif Jamal disk (it)
PPTX
Disk formatting
PPT
Chapter 12 - Mass Storage Systems
PPTX
Unit3 ppt3 hard drive
PPTX
Fat 32 file system
PPTX
Operating Systems: Device Management
PPT
Partitioning a Hard Drive
PPTX
Overview of physical storage media
PPTX
Types of secondary storage devices ppt
PPT
Ch10
PPTX
Introduction to Storage technologies
PPT
storage and file structure
PPT
Mass Storage Devices
Secondary storage structure
Chap2 hdd2
Mass storage systemsos
Massstorage
Hard drive partitions
Asif Jamal disk (it)
Disk formatting
Chapter 12 - Mass Storage Systems
Unit3 ppt3 hard drive
Fat 32 file system
Operating Systems: Device Management
Partitioning a Hard Drive
Overview of physical storage media
Types of secondary storage devices ppt
Ch10
Introduction to Storage technologies
storage and file structure
Ad

Viewers also liked (20)

PPTX
Disk structure & File Handling
PPTX
Cs419 lec10 left recursion and left factoring
PPTX
Hard Disk
PPT
Hard Disk 2.0
PPT
20160902 DW Debate:Aproblemática Das Crianças E Adolescente Vivendo Nas Ruas ...
PPTX
Storage devices
PPTX
Materi Pembelajaran TIK Kelas 9 BAB 6
PPTX
Disco duro
PPTX
Disk drives
PPTX
Pace IT - Storage Devices (part 1)
PPS
Harddisk
PPTX
Partes internas de la computadora
PPTX
Arquitectura controlador sata
PPTX
Disco duro jancel
PPTX
Storage networks
PPT
OakTableWorld 2013: Ultimate Exadata IO monitoring – Flash, HardDisk , & Writ...
PPT
Storage Networks
PDF
Marvell FMS Preso
PPT
What is storage from Qsan Technology
PPTX
Storage (Hard disk drive)
Disk structure & File Handling
Cs419 lec10 left recursion and left factoring
Hard Disk
Hard Disk 2.0
20160902 DW Debate:Aproblemática Das Crianças E Adolescente Vivendo Nas Ruas ...
Storage devices
Materi Pembelajaran TIK Kelas 9 BAB 6
Disco duro
Disk drives
Pace IT - Storage Devices (part 1)
Harddisk
Partes internas de la computadora
Arquitectura controlador sata
Disco duro jancel
Storage networks
OakTableWorld 2013: Ultimate Exadata IO monitoring – Flash, HardDisk , & Writ...
Storage Networks
Marvell FMS Preso
What is storage from Qsan Technology
Storage (Hard disk drive)
Ad

Similar to Coal presentationt (20)

PPT
Assembly Language Programming Basics
PPT
Working with Windows and DOS Systems (1).ppt
PPTX
Working of Volatile and Non-Volatile memory
PPTX
File and fat
PPT
PDF
Database management system chapter thirt
PPTX
Elmasri Navathe Primary Files database A
PPTX
File and fat 2
PPT
CF_Unit5_WorkingWithWindowsAndDOS23052021.ppt
PDF
filesystem-120405093921-phpapp02 (1).pdf
PPT
Chaptnkihgvjjfder05 File Organization.ppt
PPTX
Disk and file operation
PPTX
Ch 17 disk storage, basic files structure, and hashing
PPTX
Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPT
Windows Forensics- Introduction and Analysis
PPT
File system
PDF
Physical Database Design for database student-1.pdf
PPT
Working with Windows and DOS Systems.ppt
PPT
File system
Assembly Language Programming Basics
Working with Windows and DOS Systems (1).ppt
Working of Volatile and Non-Volatile memory
File and fat
Database management system chapter thirt
Elmasri Navathe Primary Files database A
File and fat 2
CF_Unit5_WorkingWithWindowsAndDOS23052021.ppt
filesystem-120405093921-phpapp02 (1).pdf
Chaptnkihgvjjfder05 File Organization.ppt
Disk and file operation
Ch 17 disk storage, basic files structure, and hashing
Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Windows Forensics- Introduction and Analysis
File system
Physical Database Design for database student-1.pdf
Working with Windows and DOS Systems.ppt
File system

More from fika sweety (20)

PPTX
Query optimization and performance
PPT
Program design techniques
PPT
PPT
Shift rotate
PPTX
Graphss
PPT
Modeling and simulation ch 1
PPTX
Macros...presentation
PPT
Pseudocode algorithim flowchart
PPT
Diversity (HRM)
PPT
Howtowriteamemo 090920105907-phpapp02
PPTX
1 Computer Architecture
PPTX
3 Pipelining
PPT
19 primkruskal
PPT
Warehouse chapter3
PPT
Quick sort
PPTX
Query optimization and performance
PDF
Master theorem
PPT
Database security copy
PPT
Programming
Query optimization and performance
Program design techniques
Shift rotate
Graphss
Modeling and simulation ch 1
Macros...presentation
Pseudocode algorithim flowchart
Diversity (HRM)
Howtowriteamemo 090920105907-phpapp02
1 Computer Architecture
3 Pipelining
19 primkruskal
Warehouse chapter3
Quick sort
Query optimization and performance
Master theorem
Database security copy
Programming

Recently uploaded (20)

PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
737-MAX_SRG.pdf student reference guides
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
introduction to high performance computing
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
Artificial Intelligence
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
Current and future trends in Computer Vision.pptx
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
introduction to datamining and warehousing
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Total quality management ppt for engineering students
Exploratory_Data_Analysis_Fundamentals.pdf
737-MAX_SRG.pdf student reference guides
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
introduction to high performance computing
Information Storage and Retrieval Techniques Unit III
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Artificial Intelligence
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Current and future trends in Computer Vision.pptx
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
introduction to datamining and warehousing
Abrasive, erosive and cavitation wear.pdf
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
UNIT 4 Total Quality Management .pptx
Total quality management ppt for engineering students

Coal presentationt

  • 2. FLOPPY DISK 3 ½ INCH 5 ¼ INCH HARD DISK FILE ALLOCATION DISK STRUCTURES: Tracks, sectors, and cylinders. Disk partitions. Disk capacity. DISK STRUCTURES
  • 4. FILE FILE HANDLING FILE HANDLE FILE ERRORS FILE POINTER OPERATIONS OF FILE • 3CH • 3DH • 3EH • 3FH • 40H • 41H • 42H FILE HANDLING
  • 5. DISK STRUCTURES The actual physical details of disk
  • 7. 1)Internal parts of a 3½-inch floppy disk. 2)A hole that indicates a high-capacity disk. 3)The hub that engages with the drive motor. 4)A shutter that protects the surface when removed from the drive. 5)The plastic housing. 6)A polyester sheet reducing friction against the disk media as it rotates within the housing. 7)The magnetic coated plastic disk. 8)A schematic representation of one sector of data on the disk; the tracks and sectors are not visible on actual disks. 9)The write protection tab (unlabeled) is upper left.
  • 8.  3 ½ INCH  5 ¼ INCH
  • 10. 1) Actuator that moves the read-write arm. 2) Read-write arm swings read-write head back and forth across platter. 3) Central spindle allows platter to rotate at high speed. 4) Magnetic platter stores information in binary form. 5) Plug connections link hard drive to circuit board in personal computer. 6) Read-write head is a tiny magnet on the end of the read-write arm. 7) Circuit board on underside controls the flow of data to and from the platter. 8) Flexible connector carries data from circuit board to read-write head and platter. 9) Small spindle allows read- write arm to swing across platter.
  • 14. CAPACITY OF THE 5 ¼ INCH DOUBLE DENSITY FLOPPY DISK
  • 16. FILE ALLOCATION To keep the track of data stored on a disk, DOS uses a directory structure. The first tracks and sectors of a disk contain information about the disk’s file structure.
  • 20. Cluster “A fixed number of sector (depends on the kind of disk) is called cluster”
  • 21. (File Allocation Table): “A table that the operating system uses to locate files on a disk. Due to fragmentation, a file may be divided into many sections that are scattered around the disk. The FAT keeps track of all these pieces.” F A T
  • 22. DOS HOW DOS READ A FILE? • DOS gets the starting cluster number from directory. • DOS read that particular cluster number from disk and stored in DTA (Data Transfer Area). The program that initiated the read retrieves data from HOW DOS STORES A FILE? • DOS locates an unused directory entry and stores the filename, attribute, creation time and date. • DOS searches the FAT for the first entry indicating unused cluster (000 means unused) and stores the starting cluster number in the directory. Let’s suppose
  • 24. FILE FILE HANDLING FILE HANDLE FILE ERRORS FILE POINTER OPERATIONS OF FILE • 3CH • 3DH • 3EH • 3FH • 40H • 41H • 42H FILE HANDLING
  • 25. File ? File Handling ? A file is an object on a computer that stores data, information, settings, or commands that are used with a computer program. Through file handling, one can perform operations like create, modify , delete etc on File. File Create Write Rename Delete
  • 26. FILE HANDLES When file is created or open in a program, DOS assign it a unique number called file handle.
  • 32. 3CH 42H 3EH3DH 40H 41H3FH OPEN A NEW FILE / REWRITE A NEW FILE MOVE A FILE POINTER DELETE A FILEWRITE A FILEREAD A FILE CLOSE A FILE OPEN AN EXISTING A FILE
  • 33. Creating File & Writing FILE DB "c:example_newhello.txt",0 TEXT DB "HELLO I AM TEXT",0 TEXT_SIZE = $ - OFFSET TEXT HANDLE DW ? System Call AH BX CX DX File Open 3CH 0 Offset Filename File Write 40H Handle Text Size Offset Text File Close 3EH Handle Handle ? Handle is some resources/memory to store temporary data , used in file operation
  • 34. Create File Operation MOV CX,0 MOV DX, OFFSET FILE ; FILENAME MOV AH, 3CH ; 3CH FOR CREATING FILE INT 21H Write into File MOV HANDLE, AX ; MAKE RESOURCES HANDLE MOV AH, 40H ; 40H FOR WRITING INTO FILE MOV BX, HANDLE ; COPY RESOURCES HANDLE MOV DX, OFFSET TEXT ; TEXT TO WRITE MOV CX, TEXT_SIZE ; TEXT SIZE INT 21H;
  • 35. Close File MOV AH, 3EH ; 3EH FOR CLOSE FILE MOV BX, HANDLE ; COPY RESOURCES HANDLE INT 21H
  • 36. Delete File .DATA FILE DB "C:EXAMPLE_NEWWORLD.TXT",0 .CODE MOV DX, OFFSET FILE ; OLD FILENAME MOV AH, 41H ; 41H FOR DELETE FILE INT 21H System Call AH BX CX DX File Delete 41H Offset OldFilename
  • 37. File pointer  The file pointer is used to locate a position in the file.  File is opened – file pointer is at the beginning of file.  After read operation – it the next byte to be read.  After writing – file pointer at end of file.
  • 38. File pointer Move File pointer INT 21H, FUNCTION 42H INPUT AH = 42H AL = MOVEMENT CODE: • 0 MOVE RELATIVE TO BEGINNIG • 1 MOVE RELATIVE TO CUUERENT POINTER LOCATION • 2 MOVE RELATIVE TO THE EOF BX = FILE HANDLE CX:DX = NUMBER OF BYTES TO MOVE OUTPUT DX:AX = NEW POINTER LOCATION IN BYTES FROM THE BEGNNING OF FILE. IF CF = 1 ERROR CODE IN AX (1,6). System Call AH BX CX:DX File pointer 42H File handle Number of byte to move