Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: Obtaining P...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 4560 of 4710
Post > Topic >>

Re: Obtaining PCI ROM addresses and sizes?

by "Benjamin David Lunt" <spamtrap@[EMAIL PROTECTED] > Mar 7, 2008 at 11:56 PM

"Alex Buell" <spamtrap@[EMAIL PROTECTED]
> wrote in message 
news:20080307130311.d3665415.alex.buell@[EMAIL PROTECTED]
> On Fri, 07 Mar 2008 05:32:13 GMT, I waved a wand and this message
> magically appears in front of Tim Roberts:
>
>> >I've been trying to obtain the addresses of PCI extension ROM and
>> >their sizes on 16 bit MSDOS, whether they're enabled or not. Does
>> >anyone have example sources on how to do this? The examples I've
>> >seen only works in protected mode. Thanks!
>>
>> Few PCI cards have ROMs any more.  Your graphics card is just about
>> the only one left.
>>
>> The only way to get this information authoritatively is to enumerate
>> through the configuration space of all of the devices on your PCI
>> bus.  You can do that using the PCI BIOS interrupt, INT 1A.  The
>> expansion ROM base address is in the configuration space at offset
>> 30h.
>
> I can enumerate through the configuration space via 0x1A. The only
> problem I'm having now with getting the ROM addresses is that I'm
> unable to get the size of the i/o, mem or ROM address spaces. I've
> tried writing 0xFF into the base register addresses/extension ROM
> address registers but that doesn't seem to work!
>

>From the FYSOS source:

// returns the memory range in bytes of the pci card
bit16u pci_mem_range(struct S_PCI_DEV *pci, bit8u ****t, bit8u size) {
 bit32u org, range;

 // read the original value
 org = read_pci(pci->bus, pci->dev, pci->func, ****t, size);
  if (org & 1) {
   // write 0xFFFFFFFF
   write_pci(pci->bus, pci->dev, pci->func, ****t, size, 0xFFFFFFFF);
   // read it back.
   range = read_pci(pci->bus, pci->dev, pci->func, ****t, size);
   // write back the original value (minus the read only bits)
   write_pci(pci->bus, pci->dev, pci->func, 0x14, size, org);

   // return the range
   return (bit16u) ((~(range & ~0x3)) + 1);
  }
  return 0;
}

Is this what you wanted?  i.e.: you want to know how many ****ts
(in bytes) that a specified PCI device uses?
e.g: from 0x1F0 to 0x1F7 = 8 bytes?

Ben

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Forever Young Software
http://www.frontiernet.net/~fys/index.htm
To reply by email, please remove the zzzzzz's

Batteries not included, some assembly required.
 




 7 Posts in Topic:
Obtaining PCI ROM addresses and sizes?
Alex Buell <spamtrap@  2008-03-06 21:13:34 
Re: Obtaining PCI ROM addresses and sizes?
Tim Roberts <spamtrap  2008-03-07 05:32:13 
Re: Obtaining PCI ROM addresses and sizes?
Dirk Wolfgang Glomp <  2008-03-07 09:07:29 
Re: Obtaining PCI ROM addresses and sizes?
"H. Peter Anvin"  2008-03-24 11:56:52 
Re: Obtaining PCI ROM addresses and sizes?
Alex Buell <spamtrap@  2008-03-07 13:03:11 
Re: Obtaining PCI ROM addresses and sizes?
"Benjamin David Lunt  2008-03-07 23:56:10 
Re: Obtaining PCI ROM addresses and sizes?
Tim Roberts <spamtrap  2008-03-09 00:49:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 19:46:16 CDT 2008.