flat assembler
Message board for the users of flat assembler.

Index > OS Construction > ATA Write Sectors

Author
Thread Post new topic Reply to topic
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 13 Aug 2011, 19:19
I've written multiple Read Commands which work, however the Write versions don't appear to work (or atleast they don't trigger an interrupt).

Does anyone know what, if anything, needs to be done differently in a Write Sectors command (as compared with a Read Sectors Command)?

I'm testing with VMware Player and VirtualBox with both producing the same effect.
Post 13 Aug 2011, 19:19
View user's profile Send private message Visit poster's website Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239 13 Aug 2011, 19:53
BAiC wrote:
I've written multiple Read Commands which work, however the Write versions don't appear to work (or atleast they don't trigger an interrupt).

Does anyone know what, if anything, needs to be done differently in a Write Sectors command (as compared with a Read Sectors Command)?

I'm testing with VMware Player and VirtualBox with both producing the same effect.
No, if you are using BIOS interrupt 13h then the read and write (ah = 02, 03 respectively) there should be no difference in the syntax.
Post 13 Aug 2011, 19:53
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 13 Aug 2011, 21:45
I'm referring to ATA Commands. as in 0x20 (Read Sectors) 0x30 (Write Sectors).

[Edit By Loco]Inappropriate content for OS Construction forum has been split to here.
Post 13 Aug 2011, 21:45
View user's profile Send private message Visit poster's website Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 14 Aug 2011, 16:06
BAiC wrote:
Does anyone know what, if anything, needs to be done differently in a Write Sectors command (as compared with a Read Sectors Command)?


The interrupt occurs "later".

When reading, you send the 20h command and then you're waiting for the IRQ, while when writing, you'll have to send the 30h command, then wait for "device ready" (bit 3), then output your data ( usually a "rep outsw/d" ), and finally you'll receive the IRQ.
Post 14 Aug 2011, 16:06
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 15 Aug 2011, 00:31
ok, it explains many things.....
Post 15 Aug 2011, 00:31
View user's profile Send private message Visit poster's website Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 04 Sep 2011, 01:58
Thanks Japheth.

filling its' buffer first is how it needs to be done. I use "rep outsw". outsd won't work as the Data Port is a WORD not a DWORD.
Post 04 Sep 2011, 01:58
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 05 Sep 2011, 00:58
> [Edit By Loco]Inappropriate content for OS Construction forum has been split to here.

Better link: http://t13.org/documents/UploadedDocuments/docs2009/d2015r1a-ATAATAPI_Command_Set_-_2_ACS-2.pdf
Post 05 Sep 2011, 00:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.