Lecture 26.

Slides:



Advertisements
Similar presentations
DAT2343 File Storage and Access © Alan T. Pinck / Algonquin College; 2003.
Advertisements

COEN 252 Computer Forensics Hard Drive Geometry. Drive Geometry Basic Definitions: Track Sector Floppy.
1 Computer Science, University of Warwick Accessing Irregularly Distributed Arrays Process 0’s data arrayProcess 1’s data arrayProcess 2’s data array Process.
Chapter 4 : File Systems What is a file system?
Computer System Basics 2 Hard Drive Storage & File Partitions Computer Forensics BACS 371.
Flow Diagram: Push flags, CS, IP Pop IP,CS,flags Push AX,BX,CX,DX,ES,DS,SI,DI,BP POP BP,DI,SI,DS,ES,DX,CX,BX,AX.
Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.
CS4432: Database Systems II Data Storage - Lecture 2 (Sections 13.1 – 13.3) Elke A. Rundensteiner.
EET 450 – Advanced Digital Chapter 10 Hard Disk Drives.
11/13/01CS-550 Presentation - Overview of Microsoft disk operating system. 1 An Overview of Microsoft Disk Operating System.
Managing Your Hard Disk and Operating System 23,26 March :30pm - 4:00pm.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Ceng Operating Systems
CS4432: Database Systems II Lecture 2 Timothy Sutherland.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 5 Disks CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
Avishai Wool lecture Introduction to Systems Programming Lecture 9 Input-Output Devices.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Disk drives. Hard drives Geometry: heads, tracks (sectors) and cylindercylinder Physical construction: an exampleexample Detailed description Detailed.
DISK STORAGE INDEX STRUCTURES FOR FILES Lecture 12.
Files & Partitions BACS 371 Computer Forensics. Data Hierarchy Computer Hard Disk Drive Partition File Physical File Logical File Cluster Sector Word.
1 Chapter Overview CD-ROM and DVD Drives Advanced Hard Disk Drives SCSI Drives.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 8 Understanding and Installing Hard Drives.
Tel : 同济大学软件学院 UEFI 与固件程序设计.
Unix File System Internal Structures By C. Shing ITEC Dept Radford University.
CS 6560 Operating System Design Lecture 13 Finish File Systems Block I/O Layer.
Lecture 9: The FAT and VFAT Filesystems 6/16/2003 CSCE 590 Summer 2003.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
SIMULATED UNIX FILE SYSTEM Implementation in C Tarek Youssef Bipanjit Sihra.
Introduction to Hard Drives Chapter 6 - Key Terms Information Compiled by Diane Ferris, Michele Henderson & Vicki Kertz.
PC Maintenance: Preparing for A+ Certification Chapter 10: Introduction to Disk Storage.
Chapter 11 Indexing & Hashing. 2 n Sophisticated database access methods n Basic concerns: access/insertion/deletion time, space overhead n Indexing 
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
Hard disk drives It is a non volatile mass storage device. It consists of platters made of aluminum alloy or glass ceramic composite material. Platters.
Chapter 13 Disk Storage, Basic File Structures, and Hashing. Copyright © 2004 Pearson Education, Inc.
COEN 252 Computer Forensics Hard Drive Geometry. Drive Geometry Basic Definitions: Track Sector Floppy.
Computer Foundations Dr. John P. Abraham Professor UTPA.
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
Writing and Reading Files Methods for processing disk files File Control Blocks (FCBs) –Supported by DOS –Can address drives and filenames.
1 Lab 1. C Introduction  C: –Developed by Bell lab. in –a procedure-oriented programming language.  Developing environments: –Editing –Preprocessing.
Lecture 27. Extended Read Service used for extended read is int 13h/42h On Entry AH=42H DL=drive # DS:SI= far address of Disk address packet On Exit If.
Disk Basics CS Introduction to Operating Systems.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
Chapter 7 Volume versus Partition. Cylinder, Head, and Sector (CHS) Hard or fixed disks store information on a revolving platter of metal or glass coated.
11 PART 2 ARRAYS. 22 PROCESSING ARRAY ELEMENTS Reassigning Array Reference Variables The third statement in the segment below copies the address stored.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
 To arrange the data on the disk surface, the disk surface is divided in to different sections called :-  Slides or heads  Tracks  Sectors  Cylinders.
Division of a process into Pages public class Misc { public static int add(int a, int b) {return a+b; } public static int fact(int x) {int f= 1; if (x.
Review ATA - IDE Project name : ATA – IDE Training Engineer : Minh Nguyen.
Lecture 25. #include char st[2048]="hello u whats up?\0asnfdnflmflsmfldf"; char st1[2048]="xyz"; unsigned long int temp; unsigned int i; void main (void)
Query Processing Part 1: Managing Disks 1.
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Computer Science 210 Computer Organization
8086 Microprocessor.
9/12/2018.
CS-401 Computer Architecture Assembly Language Programming
Defining Types of data expression Dn [name] expression Dn [name]
I/O Systems Chapter 15 11/7/2018 Crowley OS Chap. 15.
The slides must be understood in Lecture 5
Lecture 22.
CS-401 Computer Architecture & Assembly Language Programming
Disk storage Index structures for files
Symbolic Instruction and Addressing
CS-401 Computer Architecture & Assembly Language Programming
Chapter 6 –Symbolic Instruction and Addressing
Internal Representation of Files
Lecture 20: Representing Data Elements
Presentation transcript:

Lecture 26

Reading/Writing a physical Block BiosDisk(int cmd, int drive, int head, int track, int sector, int nsects, void * buffer); Cmd 0 = disk reset 1 = disk status (status of last disk operation) 2 = disk read 3 = disk write 4 = disk verify 5 = disk format

Reading Writing a physical Block Drive 0x80 = first fixed disk (physcial drive) 0x81 = second fixed disk 0x82 = third fixed disks …. …. 0x00 = first removable disk 0x01 = second removable disk …. ….

Reading Writing a physical Block #include <bios.h> #include <dos.h> FILE *fp; unsigned char buf[512]; unsigned char st[60]; unsigned char headno[10]; unsigned char secno[10]; unsigned char trackno[10]; void main (void) { int i ; for (i=0;i<512;i++) buf[i]=0;

Cont… gets(st); fp=fopen(st,"wb"); printf("Head "); gets(headno); puts (headno); printf("\nsector "); gets(secno); puts(secno); printf("\ntrack "); gets(trackno); puts(trackno);

Cont… i = biosdisk(2,0x80,atoi(headno), atoi(trackno),atoi(secno),1,buf) ; if (*(((char *)(&i))+1)==0) { fwrite(buf,1,512,fp); fclose(fp); } else printf("Cannot Read Error# = %x",i);

Limitation of biosdisk Biosdisk() calls int 13H/0/1/2/3/4/5 Details of 13H services used by Biosdisk() On Entry AH = service # AL=No. of sectors BX = offset address of data buffer CH = track # CL = sector # DH = head/side # DL = Drive # ES = Segment Address of buffer.

Limitation of biosdisk() Large sized disk are available now with thousands of tracks But this BIOS routine only is capable of accessing a max. of 1024 tracks. Hence if a large disk is being used not whole of the disk can be accessed using this routine.

Extended BIOS functions Extended BIOS functions of int 13h can be used for operations on higher tracks As discussed later usual BIOS functions can access a maximum of 504MB of disk approx.

Extended BIOS functions IDE Limit Max Sec 63 255 Max heads 256 16 Max Capacity 1024 65536

Highest biosdisk() capacity Hence the highest capacity of disk can be accessed using bios functions is 63x16x1024x512= 504 MB approx.

Highest IDE capacity Hence highest physical capacity of the disk according to the IDE interface is 255x16x65536x512 = 127GB Extended BIOS functions allow to access disk with sizes greater than 504 MB through LBA translation.

LBA Translation Method Each unique combination of three parameters is assigned a unique index as shown below Firstly all the sectors of a cylinder are indexed for head=0, then when whole track has been indexed the sector in the track of same cylinder with head =1 are indexed and so on up till the end of all heads When done with one cylinder the same is repeated for the next cylinder till the end of cylinders

LBA Translation method Cylinder head sec 0 0 1 = 0 0 0 2 = 1 0 0 3 = 2 …. …. … …. 0 0 63 = 62 0 1 1 = 63 0 1 2 = 64 …. …. … …. 0 2 1 = 126

Mathematical Notation for LBA translation LBA address = (C * H’ +H)* S’ + S – 1 Where C = Selected cylinder number H’ = No. of heads H = Selected head number S’=Maximum Sector number S= Selected Sector number

LBA to CHS translation Conversely LBA address can be translated into CHS address cylinder = LBA / (heads_per_cylinder * sectors_per_track) temp = LBA % (heads_per_cylinder * sectors_per_track) head = temp / sectors_per_track sector = temp % sectors_per_track + 1

Disk Address Packet Offset Size Description Byte Byte Size, Should not be less than 16 1 Reserved 2 No. of blocks to transfer, Max value no greater than 7FH 3 4 Double Word Far address of buffer 8 Quad word LBA address