flat assembler
Message board for the users of flat assembler.

Index > OS Construction > where does BIOS store PATA/SATA drives info?

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
Hi all,
BIOS issues identify device for PATA/SATA drives. Does it save this information somewhere? Is it possible to retrieve information about disk drives from BIOS rather than check if drive is present on the bus and then issue IDENTIFY DEVICE to each of them?
What I need is to get vendor information (model, etc.) for available hard disks.
Thanks in advance.
Post 24 Mar 2010, 00:26
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
Int 0x13 Fn 0x25 - Identify Device.
DL = drive number (80h,81h)
ES:BX - 512 byte buffer for reply packet

but this function is optional... will try it if it works on my PCs when i arrive home, and also if it works for all drive numbers, not only 0x80 and 0x81

edit: seems like EDD-4 defines this function as mandatory
Post 24 Mar 2010, 14:34
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
this function didn't work on all pcs i tried. moreover, function 48h doesn't return extended information (above offset 30 in the Resul Buffer as specified in EDD spec.). bios doesn't assign a number to optical drives unless user boots from cd in no-emulation mode... my verdict - bios sucks!
Post 04 Apr 2010, 18:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17669
Location: In your JS exploiting you and your system
revolution
zhak: I think you are expecting too much from the BIOS. The 'B' really does mean what the letter stands for. Wink

Once you have you boot code loaded and running the job of the BIOS is mostly done. From that point on your code is expected to find devices and things on its own.
Post 04 Apr 2010, 18:46
View user's profile Send private message Visit poster's website Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
@revolution: You got it right. In order to get the proper information one needs
to use low level methods.

Regards
Mac2004
Post 20 Sep 2010, 15:37
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
I'm in the process of adding scanning for basic devices to my loader stage and found that BIOS', in general, will only return hard disks mapped to PATA ports.

I came across the EDD a while ago too and found that some BIOS' would only fill either the EDD or the xPath information - you can reconstruct one from the other in some cases.

If your OS is going to run 32/64bit protected mode, you might as well write as much of it yourself as possible for reuse.
Post 20 Sep 2010, 17:21
View user's profile Send private message Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
zhak wrote:
function 48h doesn't return extended information (above offset 30 in the Resul Buffer as specified in EDD spec.).

It does but only for new PCs. DPTE was introduced in v2. You can get port numbers from it, scan PCI for IDE controllers and check BARs of both channels.

_________________
If you have seen bad English in my words, tell me what's wrong, please.
Post 20 Sep 2010, 19:27
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.