flat assembler
Message board for the users of flat assembler.

Index > OS Construction > ATA

Author
Thread Post new topic Reply to topic
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 06 Aug 2011, 16:49
Hi everyone!
I've just made ATA PIO driver, it worked fine Very Happy
I need to know what drive have I booted from to load some modules
How do I find out???

_________________
_______________________________
NSOS
Post 06 Aug 2011, 16:49
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 06 Aug 2011, 17:28
At boot, dl is loaded with the BIOS drive identifier. You can use this, along with EDD v2+ (see int 0x13 ah = 0x41,0x48) to determine which drive it is, either by port or by location (bus/device).
Post 06 Aug 2011, 17:28
View user's profile Send private message Reply with quote
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 08 Aug 2011, 06:53
cod3b453 wrote:
At boot, dl is loaded with the BIOS drive identifier. You can use this, along with EDD v2+ (see int 0x13 ah = 0x41,0x48) to determine which drive it is, either by port or by location (bus/device).

Thanks!

Is there any difference between reading hdd and CD in ATA PIO mode except that I have to recieve more data from 1F0h???

_________________
_______________________________
NSOS
Post 08 Aug 2011, 06:53
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 08 Aug 2011, 16:52
AFAIK using ATA is the same for both but the port base depends on the device location on the controller (it may be 0x01F0 or 0x0170) but, yes, the sector sizes are the only difference I know of.
Post 08 Aug 2011, 16:52
View user's profile Send private message Reply with quote
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 09 Aug 2011, 12:08
Also how do I get information about channel of drive I've booted from cuz I couldnt find about channel in int 13h 48h
Or it's just located on another PCI device???

_________________
_______________________________
NSOS
Post 09 Aug 2011, 12:08
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 09 Aug 2011, 17:40
The DPTE (v2+) and DPath (v3+) entries will give you the IOBase and channel/device values respectively. So program the structure in si with the v3 size and then check the value remains the same. You can then use these values in the device select/command registers for PIO.
Post 09 Aug 2011, 17:40
View user's profile Send private message Reply with quote
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 16 Aug 2011, 12:07
Is that Possible that there 2 different IDE controllers on same machine or they will conflict???

_________________
_______________________________
NSOS
Post 16 Aug 2011, 12:07
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 16 Aug 2011, 17:15
Yes, you can have multiple IDE (or any other controller) on a single board and, if you are able to boot from a device, there should not be an issue, as the controllers should have a different IO base [this is how the device is booted afaik].
Post 16 Aug 2011, 17:15
View user's profile Send private message Reply with quote
BOTOKILLER



Joined: 07 Jan 2011
Posts: 154
Location: Ukraine
BOTOKILLER 08 Sep 2011, 11:47
I wrote an ATA driver, It sends command 20h to drive and reads sector. It worked fine for HDD but when I ran that code for CD it wouldn't work, why???
Post 08 Sep 2011, 11:47
View user's profile Send private message Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos 08 Sep 2011, 13:43
Use ATAPI command "Read CD" (0xBE).
Post 08 Sep 2011, 13:43
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 08 Sep 2011, 17:23
Did you change you sector size to 2048 bytes for CD?
Post 08 Sep 2011, 17:23
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.