Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Lecture 27

2 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 CF=0 AH=0= Success If CF=1 AH= Error code

3 Extended Write Service used for extended read is int 13h/42h On Entry AH=43H AL=0,1 write with verify off 2 write with verify on DL=drive # DS:SI= far address of Disk address packet On Exit If CF=0 AH=0= Success If CF=1 AH= Error code

4 Reading a LBA block #include struct DAP { unsigned char size; unsigned char reserved1; unsigned char blocks; unsigned char reserved2; unsigned char far *buffer; unsigned long int lbalod; unsigned long int lbahid; } dap; char st[80]; unsigned char buf[512]; FILE *fptr;

5 void main (void) { puts ("enter the lba low double word: "); gets (st); dap.lbalod=atol(st); puts ("enter the lba high double word: "); gets (st); dap.lbahid=atol(st); dap.size=16; dap.reserved1=0; dap.blocks=1; dap.reserved2=0; dap.buffer = (unsigned char far *)MK_FP(_DS,buf);

6 _AH=0x42; _DL=0x80; _SI=(unsigned int)&dap; geninterrupt(0x13); puts ("enter the path: "); gets (st); fptr = fopen(st,"wb"); fwrite(buf,512,1,fptr); fclose (fptr); }

7 Disk Partitioning Partition Table contains information pertaining to disk partitions. Partition Table is the first physical sector Head = 0 Track/Cylinder = 0 Sec = 1 or LBA = 0 Partition Table at CHS = 001 is also called MBR (Master Boot Record).

8 Structure of Partitioning Table Total size of Partition Table is 512 bytes. First 446 bytes contains code which loads the boot block of active partition and is executed at Boot Time. Rest of the 66 bytes is the Data part. Last two bytes of the Data part is the Partition table signature.

9 File System for Each O.S. On a single disk there can be 4 different file systems and hence 4 different O.S. Each O.S. will have its individual partition on disk. Data related to each partition is stored in a 16- bytes chunk within the Data Part of Partition Table.

10 Structure of Data Part of P.T. SizeDescription 16 BytesPartition into of 1 st partition. 16 BytesPartition into of 2 nd partition. 16 BytesPartition into of 3 rd partition. 16 BytesPartition into of 4 th partition. 02 BytesSignature

11 SizeDescription Byte80H if Bootable, 0 if Not ByteHead # for first block in the partition Byte0 – 5 bits are sector # for first block within the partition and bits 6 -7 are higher bits of cylinder # ByteLow 8-bits of cylinder # for last block within the partition.. ByteFile System ID

12 SizeDescription ByteHead # for last block in the partition Byte0 – 5 bits are sector # for last block within the partition and bits 6 -7 are higher bits of cylinder # ByteLow 8-bits of cylinder # for last block within the partition. Double Word Relative address of the boot record for the partition with respect to the first block in partition in terms of LBA address. Double Word Count of total blocks within the partition.

13 File System ID Bit #Description 00Empty 01DOS 12-bit partition 02Xenix root 03Xenix/usr 04MS-DOS 16-bits < 32MB 05MS-DOS extended partition can manage disks of sizes up to 8.4 GB 0 ~ FF for various O.S.

14 06MS-DOS 16-bits FAT >= 32MB 07OS/2, 1FS = Installable file system Advanced Unix Windows NT NTFS 08AIX Boot partitions 09AIX Data partitions 0AOS/2 Boot Manager 0BWin 95 FAT 32 0CWin 95 FAT 32 LBA Mapped 0EWin 95 FAT 16 LBA Mapped 0FExtended partitions LBA Mapped

15 Primary Partition Partition defined in the MBR (Master Boot Record) are primary partition. Each Primary Partition contains information about its respective O.S. However if only one O.S. is to be installed then extended partitions.

16 Extended Partitions MBR Primary Partition Extended Partition


Download ppt "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."

Similar presentations


Ads by Google