Page 1 of 1

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

Posted: Sat Apr 19, 2014 9:55 pm
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

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

Posted: Sat Apr 19, 2014 9:57 pm
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)

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

Posted: Sat Apr 19, 2014 10:08 pm
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

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

Posted: Sat Apr 19, 2014 10:22 pm
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)

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

Posted: Sat Apr 19, 2014 10:28 pm
by tsdnz
On the PCI Bus I find it so it seams weird that it is reported as ISA??

Not sure why?

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

Posted: Sat Apr 19, 2014 10:29 pm
by tsdnz
I have read articles about finding the correct boot device, this is what I am doing.

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

Posted: Sat Apr 19, 2014 11:25 pm
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

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

Posted: Sat Apr 19, 2014 11:42 pm
by tsdnz
Great thanks, was just writing the code, good to see I was on the right path.

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

Posted: Sat Apr 19, 2014 11:56 pm
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.