HD with more than 1023 cylinder

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

HD with more than 1023 cylinder

Post 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?
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: HD with more than 1023 cylinder

Post 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)?
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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 ?
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: HD with more than 1023 cylinder

Post 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
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: HD with more than 1023 cylinder

Post by Griwes »

Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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?
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: HD with more than 1023 cylinder

Post by Griwes »

Could you *please* post that code of yours that happens to result in error? I've lost my crystal ball somewhere.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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:
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: HD with more than 1023 cylinder

Post by djmauretto »

Griwes wrote:Where is the error at the code above?
The Numbers are decimal instead of Hexadecimal :lol:
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: HD with more than 1023 cylinder

Post by Griwes »

No, to be hexadecimal, they would have to have 0x prefix, or h suffix :D
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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:
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: HD with more than 1023 cylinder

Post 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?
JamesBond
Posts: 10
Joined: Thu Aug 23, 2012 2:19 am

Re: HD with more than 1023 cylinder

Post 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!
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: HD with more than 1023 cylinder

Post 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.
Locked