Page 1 of 2

HD with more than 1023 cylinder

Posted: Thu Aug 23, 2012 2:48 am
by JamesBond
I am trying to use teh INT 13 AH=42 to read a sector of a hard disk that have more than 1023 cylinders but this service
returns an error at AH=01 and don't read the sectors! What can i make?

Re: HD with more than 1023 cylinder

Posted: Thu Aug 23, 2012 3:10 am
by turdus
JamesBond wrote:I am trying to use teh INT 13 AH=42 to read a sector of a hard disk that have more than 1023 cylinders but this service
returns an error at AH=01 and don't read the sectors! What can i make?
??? The function INT 13h/AH=42h does not use cylinders, it's for LBA addressing mode. Besides, error code 1 (returned AH=1) is:
01h invalid function in AH or invalid parameter
Have you checked that your drive supports extended read function? Do you provide a valid pointer in DS:SI? Does your disk address packet contain valid values (number of sectors reasonable and buffer pointer valid)?

Re: HD with more than 1023 cylinder

Posted: Thu Aug 23, 2012 4:38 am
by JamesBond
turdus wrote:
JamesBond wrote:I am trying to use teh INT 13 AH=42 to read a sector of a hard disk that have more than 1023 cylinders but this service
returns an error at AH=01 and don't read the sectors! What can i make?
Have you checked that your drive supports extended read function? Do you provide a valid pointer in DS:SI? Does your disk address packet contain valid values (number of sectors reasonable and buffer pointer valid)?
I think that address pack may have an error but how check if teh drive support INT 13h AH=42h ?

Re: HD with more than 1023 cylinder

Posted: Thu Aug 23, 2012 5:57 am
by djmauretto
JamesBond wrote: I think that address pack may have an error but how check if teh drive support INT 13h AH=42h ?

Code: Select all

	MOV	AX,4100H		; EDD INSTALLATION CHECK
	MOV	BX,55AAH
	MOV	DL,[Boot_Drive]
	INT	13H
	JC	@Not_Supported

	CMP	BX,0AA55H
	JNZ	@Not_Supported

	TEST	CX,1
	JZ	@Not_Supported

Re: HD with more than 1023 cylinder

Posted: Thu Aug 23, 2012 9:50 am
by Griwes

Re: HD with more than 1023 cylinder

Posted: Fri Aug 24, 2012 2:53 am
by JamesBond
I already check if the drive supports extended read function and the drive supports extended read function but the INT 13 extended read function still return an error! How to read/write disk sectors without use interrupts only using I/O ports?

Re: HD with more than 1023 cylinder

Posted: Fri Aug 24, 2012 3:43 am
by Griwes
Could you *please* post that code of yours that happens to result in error? I've lost my crystal ball somewhere.

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 2:18 am
by JamesBond
:x here is part of the code:

Code: Select all

mov ah,42
mov dl,80
mov si,200
INT 13
disk address packet = 1000010300100000000000
Where is the error at the code above?
:evil:

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 2:40 am
by djmauretto
Griwes wrote:Where is the error at the code above?
The Numbers are decimal instead of Hexadecimal :lol:

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 2:46 am
by JamesBond
djmauretto wrote:
Griwes wrote:Where is the error at the code above?
The Numbers are decimal instead of Hexadecimal :lol:
No! All the numbers are hexadecimal

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 3:22 am
by Griwes
No, to be hexadecimal, they would have to have 0x prefix, or h suffix :D

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 3:56 am
by JamesBond
Griwes wrote:No, to be hexadecimal, they would have to have 0x prefix, or h suffix :D
:x No! No! No! because my assembler don't need the h suffix not even teh 0x prefix :evil:

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 4:15 am
by iansjack
Which assembler would that be? It seems to use a non-standard syntax.

And how do you tell it when you do want to specify a decimal number?

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 4:18 am
by JamesBond
iansjack wrote:Which assembler would that be? It seems to use a non-standard syntax.

And how do you tell it when you do want to specify a decimal number?
The assembler is created by me! This assembler use only hexadecimal numbers!

Re: HD with more than 1023 cylinder

Posted: Sat Aug 25, 2012 4:26 am
by iansjack
JamesBond wrote:The assembler is created by me!
You've probably pinpointed your problem there. Try comparing the generated code with that from a mainline assembler.

You might also want to check that DAP. It looks all wrong to me; for starters, the first byte shouldn't be zero.