PNP Calls In Protected Mode: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
m Bot: Replace deprecated source tag with syntaxhighlight
 
Line 5: Line 5:
Once you have the [[BIOS32]] service directory (see PCI example routine) you can call it with the PNP Auto Config magic. Note the Inline Assembly again for registers interfacing.
Once you have the [[BIOS32]] service directory (see PCI example routine) you can call it with the PNP Auto Config magic. Note the Inline Assembly again for registers interfacing.


<source lang="C">
<syntaxhighlight lang="C">
void bios32_scan_pnp_entry(void)
void bios32_scan_pnp_entry(void)
{
{
Line 24: Line 24:
/* setup two new selectors of pnp_code32, pnp_data32, etc. */
/* setup two new selectors of pnp_code32, pnp_data32, etc. */
}
}
</syntaxhighlight>
</source>


Once you have determined that PNP BIOS calls exist for pmode applications, you can call the PCI v2.0c+ calls (see INT 0x1A, function 0xB400 to 0xB407 in [http://www.ctyme.com/intr/int-1a.htm RalfBrown's INT List]).
Once you have determined that PNP BIOS calls exist for pmode applications, you can call the PCI v2.0c+ calls (see INT 0x1A, function 0xB400 to 0xB407 in [http://www.ctyme.com/intr/int-1a.htm RalfBrown's INT List]).

Latest revision as of 04:40, 9 June 2024

This page is a stub.
You can help the wiki by accurately adding more contents to it.

Yes, just like PCI bios32 calls you can do PNP calls in pmode.

Once you have the BIOS32 service directory (see PCI example routine) you can call it with the PNP Auto Config magic. Note the Inline Assembly again for registers interfacing.

 void bios32_scan_pnp_entry(void)
 {
    uint32_t cseg_size, offset, base_addr;
 
    /* call the BIOS32 BSD for the PCI address
       BSD calls terminate in RETF not RET */
 
    /* eax is loaded with "$ACF" magic */
    asm("movl	$0x46434124, %%eax\n"
        "lcall _bios32_call\n"
        : "=c" (cseg_size),
          "=d" (offset),
          "=b" (base_addr)
        :
        : "eax", "ebx", "ecx", "edx", "ebp", "memory" );
 
    /* setup two new selectors of pnp_code32, pnp_data32, etc. */
 }

Once you have determined that PNP BIOS calls exist for pmode applications, you can call the PCI v2.0c+ calls (see INT 0x1A, function 0xB400 to 0xB407 in RalfBrown's INT List).

Note, not many BIOS seem to support PNP Bios32 calls, so you may have to resort to using pmode16 calls directly to the PNP bios (requiring a 286 TSS).