int 13h overlapping sectors

Programming, for all ages and all languages.
Post Reply
User avatar
norfavrell
Posts: 6
Joined: Fri Jan 28, 2011 11:38 am

int 13h overlapping sectors

Post by norfavrell »

Hey.
Let's say that we want to read 5 segments. The first of those segments is on absolute track 1 and absolute segment 16. Would int 13h automatically increment register CH to read 2 segments from track 1 and 3 from track 2? Or do i need to take care of that in the code?
Also what would happen if segments were overlapping to second head?

Thanks in advance,
Bart
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: int 13h overlapping sectors

Post by Chandra »

norfavrell wrote:Hey.
Let's say that we want to read 5 segments. The first of those segments is on absolute track 1 and absolute segment 16. Would int 13h automatically increment register CH to read 2 segments from track 1 and 3 from track 2? Or do i need to take care of that in the code?
Also what would happen if segments were overlapping to second head?

Thanks in advance,
Bart
Segments or sectors?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
norfavrell
Posts: 6
Joined: Fri Jan 28, 2011 11:38 am

Re: int 13h overlapping sectors

Post by norfavrell »

Sectors sorry. It was very late when i wrote it and I was quite tired.

Let's suppose that i want to read 5 sectors from floppy drive starting with sector 16 on track 1. Would int 13h automatically change to track 2 to read remaining 3 sectors or do i need to do it myself?

I am aware that if data doesn't fit into the segment some BIOSes will fail to read floppy.

Thanks,
Bart
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: int 13h overlapping sectors

Post by Chandra »

Ralf Brown's Interrupt List wrote: INT 13 - DISK - READ SECTOR(S) INTO MEMORY
AH = 02h
AL = number of sectors to read (must be nonzero)
CH = low eight bits of cylinder number
CL = sector number 1-63 (bits 0-5)
high two bits of cylinder (bits 6-7, hard disk only)
DH = head number
DL = drive number (bit 7 set for hard disk)
ES:BX -> data buffer
Return: CF set on error
if AH = 11h (corrected ECC error), AL = burst length
CF clear if successful
AH = status (see #00234)
AL = number of sectors transferred (only valid if CF set for some
BIOSes)
Notes: errors on a floppy may be due to the motor failing to spin up quickly
enough; the read should be retried at least three times, resetting
the disk with AH=00h between attempts
most BIOSes support "multitrack" reads, where the value in AL
exceeds the number of sectors remaining on the track, in which
case any additional sectors are read beginning at sector 1 on
the following head in the same cylinder;
the MSDOS CONFIG.SYS command
MULTITRACK (or the Novell DOS DEBLOCK=) can be used to force DOS to
split disk accesses which would wrap across a track boundary into two
separate calls
I think you were talking about this. As being said, "most" BIOSes support 'multitrack' reads but not "all". So I would recommend you do this job by yourself.

Best Regards,
Chandra
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
norfavrell
Posts: 6
Joined: Fri Jan 28, 2011 11:38 am

Re: int 13h overlapping sectors

Post by norfavrell »

Thank you a lot will implement it myself :)

Thanks,
Bart
Post Reply