Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Obtaining PCI ROM addresses and sizes?
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!

--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-06-08 11:59 PM


Re: Obtaining PCI ROM addresses and sizes?
Alex Buell  <spamtrap@crayne.org> wrote:
>
>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.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.


Report this thread to moderator Post Follow-up to this message
Old Post
Tim Roberts
03-07-08 08:59 AM


Re: Obtaining PCI ROM addresses and sizes?
Am Fri, 07 Mar 2008 05:32:13 GMT schrieb Tim Roberts:

> Alex Buell  <spamtrap@crayne.org> wrote: 
>
> 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.  Yo
u
> can do that using the PCI BIOS interrupt, INT 1A.  The expansion ROM base
> address is in the configuration space at offset 30h.

Ralf Browns RBdualVGA(dual093s.zip) shows the handling of two PCI-bus
SuperVGA cards.

Dirk


Report this thread to moderator Post Follow-up to this message
Old Post
Dirk Wolfgang Glomp
03-07-08 08:59 AM


Re: Obtaining PCI ROM addresses and sizes?
On Fri, 07 Mar 2008 05:32:13 GMT, I waved a wand and this message
magically appears in front of Tim Roberts:
 
>
> 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!

Thanks for any additional help given...
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-07-08 11:59 PM


Re: Obtaining PCI ROM addresses and sizes?
"Alex Buell" <spamtrap@crayne.org> wrote in message
news:20080307130311.d3665415.alex.buell@munted.org.uk...
> On Fri, 07 Mar 2008 05:32:13 GMT, I waved a wand and this message
> magically appears in front of Tim Roberts:
> 
>
> 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 port, bit8u size) {
bit32u org, range;

// read the original value
org = read_pci(pci->bus, pci->dev, pci->func, port, size);
if (org & 1) {
// write 0xFFFFFFFF
write_pci(pci->bus, pci->dev, pci->func, port, size, 0xFFFFFFFF);
// read it back.
range = read_pci(pci->bus, pci->dev, pci->func, port, 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 ports
(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.


Report this thread to moderator Post Follow-up to this message
Old Post
Benjamin David Lunt
03-07-08 11:59 PM


Re: Obtaining PCI ROM addresses and sizes?
Alex Buell  <spamtrap@crayne.org> wrote:
>
>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!

That's how you do it.  Post your code, and we'll try to figure out where
you went wrong.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.


Report this thread to moderator Post Follow-up to this message
Old Post
Tim Roberts
03-09-08 04:03 AM


Re: Obtaining PCI ROM addresses and sizes?
Tim Roberts wrote:
> Alex Buell  <spamtrap@crayne.org> wrote: 
>
> Few PCI cards have ROMs any more.  Your graphics card is just about the
> only one left.
>

Nonsense.  Most network cards do, and nearly all storage cards do.

> The only way to get this information authoritatively is to enumerate
> through the configuration space of all of the devices on your PCI bus.  Yo
u
> can do that using the PCI BIOS interrupt, INT 1A.  The expansion ROM base
> address is in the configuration space at offset 30h.

Indeed.

-hpa


Report this thread to moderator Post Follow-up to this message
Old Post
H. Peter Anvin
03-25-08 03:04 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

A86 Assembler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:51 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.