INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

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.
Post Reply
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

Hi, when I use INT13 - Extensions - GET DRIVE PARAMETERS and I have and IDE CD in VirtualBox it is showing ISA.
I thought it would be PCI.
24h 4 BYTEs ASCIZ name of host bus ("ISA" or "PCI")

Am i wrong?

Code: Select all

Format of IBM/MS INT 13 Extensions drive parameters:

Offset  Size    Description     (Table 00273)
00h    WORD    (call) size of buffer
(001Ah for v1.x, 001Eh for v2.x, 42h for v3.0)
(ret) size of returned data
02h    WORD    information flags (see #00274)
04h    DWORD   number of physical cylinders on drive
08h    DWORD   number of physical heads on drive
0Ch    DWORD   number of physical sectors per track
10h    QWORD   total number of sectors on drive
18h    WORD    bytes per sector
---v2.0+ ---
1Ah    DWORD   -> EDD configuration parameters (see #00278)
FFFFh:FFFFh if not available
---v3.0 ---
1Eh    WORD    signature BEDDh to indicate presence of Device Path info
20h    BYTE    length of Device Path information, including signature and this
byte (24h for v3.0)
21h  3 BYTEs   reserved (0)
24h  4 BYTEs   ASCIZ name of host bus ("ISA" or "PCI")
28h  8 BYTEs   ASCIZ name of interface type
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

I am after the PCI details

Code: Select all

Format of EDD v3.0 Interface Path:

Offset  Size    Description     (Table 00275)
---ISA---
00h    WORD    16-bit base address
02h  6 BYTEs   reserved (0)
---PCI---
00h    BYTE    PCI bus number
01h    BYTE    PCI device number
02h    BYTE    PCI function number
03h  5 BYTEs   reserved (0)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by Brendan »

Hii,
tsdnz wrote:Hi, when I use INT13 - Extensions - GET DRIVE PARAMETERS and I have and IDE CD in VirtualBox it is showing ISA.
I thought it would be PCI.
It's likely that:
  • The PCI disk controller is emulating a legacy ISA disk controller
  • The firmware assumes legacy ISA disk controller for historical and/or compatibility purposes

Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

Right, thanks

How can I read sectors using 16-bit base addresss?

Code: Select all

Format of EDD v3.0 Interface Path:

Offset  Size    Description     (Table 00275)
---ISA---
00h    WORD    16-bit base address
02h  6 BYTEs   reserved (0)
---PCI---
00h    BYTE    PCI bus number
01h    BYTE    PCI device number
02h    BYTE    PCI function number
03h  5 BYTEs   reserved (0)
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

On the PCI Bus I find it so it seams weird that it is reported as ISA??

Not sure why?
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

I have read articles about finding the correct boot device, this is what I am doing.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by Brendan »

Hi,
tsdnz wrote:How can I read sectors using 16-bit base addresss?

Code: Select all

Format of EDD v3.0 Interface Path:

Offset  Size    Description     (Table 00275)
---ISA---
00h    WORD    16-bit base address
02h  6 BYTEs   reserved (0)
I'd assume that the "16-bit base address" tells you the first IO port for the group of IO ports that the disk controller uses.(e.g. 0x01F0 to 0x01F7 for the primary IDE controller, 0x0170 to 0x0177 for the secondary IDE controller, etc).
tsdnz wrote:On the PCI Bus I find it so it seams weird that it is reported as ISA??

Not sure why?
It's a standard backward compatibility feature designed into the hardware. Just because the PCI device is emulating a legacy ISA device doesn't mean it ceases to exist as a PCI device.

The "programming interface" sub-field of the PCI device's class code (in PCI configuration space) will tell you if the device is operating in "compatibility mode" (emulating legacy ISA) or if it's operating in "native PCI mode"; and if the device can be switched to the other mode or not.

This means that if EDD returns "16-bit base address = 0x01F0" (primary IDE controller for legacy ISA) and bit 0 of a PCI disk controller's "programming interface" sub-field is clear (primary IDE channel operating in "compatibility mode") then you've found the PCI device that's responsible for emulating the ISA controller. In the same way, if EDD returns "16-bit base address = 0x0170" (secondary IDE controller for legacy ISA) and bit 2 of a PCI disk controller's "programming interface" sub-field is clear (secondary IDE channel operating in "compatibility mode") you've found it.

If it's neither of those cases, then there's another disk controller somewhere (possibly a different PCI device, and possibly an actual ISA device).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

Great thanks, was just writing the code, good to see I was on the right path.
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

Re: INT 13h - Extensions - GET DRIVE PARAMETERS - IDE CD/DVD

Post by tsdnz »

Brendan: Do you have a really good memory and/or a great library of information?

Would love to get a copy of both?

Alistair.
Post Reply