PCI Bus access in C++ (Windows)

  • Permalink
  • submit to reddit
  • Email
  • Follow


hi tere,

I'm trying to write an application which should access to the PCI Bus 
headers to get all informations about installed cards.
But I dont know how to access to these informations from windows...

I read lspci.c file from a linux distribution, it seems to be not portable 
to windows without cygwin...

So, where could I find some hint about how to access to these informations 
???

thanks for your help,

best regards,

Michel

-- 
Equipe Pos�idon_____________
http://poseidon.epfl.ch

Helpdesk:
Du Lundi au Jeudi de 11h � 18h
Le vendredi de 11h � 16h
local: CO 050 


0
Reply michel.mengis (2) 3/28/2006 6:48:40 AM

See related articles to this posting


MIchel,
PCI cards installed in the PC using Windows are handled by the PnP
manager (Plug-and-Play).  And accessing PCI configuration headers is
more of a device driver problem that a c++, but anyhow Windows has
already read those headers when the system boots up.
So instead of 'reading' in your own why not try it in the registry?
Information can be found in:
HKEY_LOCAL_MACHINE\Enum\PCI\VEN_<vendorID>&DEV_<deviceID>&SUBSYS_<subsystemID>&REV_<hardwarerevisionID>

Regards,
Krby

0
Reply krbyxtrm (30) 3/28/2006 7:13:16 AM

Krby,
I'm trying to acces to the PCI space cause I want to installed some specific 
applications after windows installation. Applications like: fingerprint 
software on thinkpads laptop...
But I need to know if the device is present or not..

regards,

michel.


"krbyxtrm" <krbyxtrm@gmail.com> wrote in message 
news:1143529996.335742.92220@i39g2000cwa.googlegroups.com...
> MIchel,
> PCI cards installed in the PC using Windows are handled by the PnP
> manager (Plug-and-Play).  And accessing PCI configuration headers is
> more of a device driver problem that a c++, but anyhow Windows has
> already read those headers when the system boots up.
> So instead of 'reading' in your own why not try it in the registry?
> Information can be found in:
> HKEY_LOCAL_MACHINE\Enum\PCI\VEN_<vendorID>&DEV_<deviceID>&SUBSYS_<subsystemID>&REV_<hardwarerevisionID>
>
> Regards,
> Krby
> 


0
Reply michel.mengis (2) 3/28/2006 7:52:04 AM

I see, but are you detecting an specific hardware, or just seeing if
there are installed cards on the PC slots?
In either case, you can use the DevCon sample found in Windows DDK. The
sample shows how to enumerate devices such as PCI.

BTW, you can download  the ddk free of charge from Microsoft.

Regards,
Krby

0
Reply krbyxtrm (30) 3/28/2006 8:54:32 AM

Michel Mengis wrote:
> Krby,
> I'm trying to acces to the PCI space cause I want to installed some specific 
> applications after windows installation. Applications like: fingerprint 
> software on thinkpads laptop...
> But I need to know if the device is present or not..

I suspect that will be much easier looking at the enumerated devices in 
the registry, rather than poking around at the data on the bus.

Equally for linux... except perhaps I'd grep lspci output...

Anyway, this is pretty OS specific, there is no way to do it with just 
C++, so you'd do better to ask in an OS specific newsgroup.

Ben Pope
-- 
I'm not just a number. To many, I'm known as a string...
0
Reply benpope81_REMOVE_ (372) 3/28/2006 9:08:39 AM
comp.lang.c++ 48323 articles. 29 followers. Post

4 Replies
512 Views

Similar Articles

[PageSpeed] 46


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

access MS-Access database in C# Windows Application
Hi, I am trying to access the MS Access database on my local machine in C# Windows Application in Visual Studio.NET. But it seems that it does not work. I use the Microsoft Application Blocks to access the database. I have tried 2 possible connection strings. ----------------------------------------- str_1 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + DBFilePath; str_2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBFilePath; //SqlHelper is the class in the Microsoft Application Blocks SqlHelper.ExecuteNonQuery( str_1, CommandType.Text, SQL_str); --------...

Q: read/write on PCI bus from C/C++
Hi all, On a standard PC, using VC++ 6.0, how do I read/write on the PCI bus ? What data transfer rate can I expect ? Can someone point me to some documentation ? TIA --- http://5.d.free.fr/dow.htm JCR wrote: > Hi all, > > On a standard PC, using VC++ 6.0, > how do I read/write on the PCI bus ? > What data transfer rate can I expect ? > Can someone point me to some documentation ? > > TIA > --- > http://5.d.free.fr/dow.htm You can't. The Operating System limits your program to using virtual addresses. You can't acc...

Problem accessing PCI Bus FF
OS: RH Linux Advanced Server 2.1 HW: IA-64 Hi, I have a problem accessing Bus # FF on my machine. When I give a command lspci -n I cannot see any devices on Bus FF When I give a command lspci -s FF: It says lspci: -f: Invalid bus number Can Any one please let me know why this is happening? I had to write my own functions to read and write from the Bus. They are successful. Also do I need to implement any locking mechanism as my HW is multiprocessor. Thanks in Advance, Jitesh ...

Accessing hardware using the PCI BUS
I want to try to access my APCI in my Southbridge located at PCI:0:7:3 (BUS:DEV:FUNC) get the data from it and store it and return a pointer to it and use it in C++. I use nasm(latest) to compile the assembly source and gcc v3.0.4 (g++) to the C++ source, and it compiles and link fine without any problems, but somehow my test example creates a segmentation fault. gdb has traced the fault to the function I have written in asm (included below, along with the part of the c++ code that calls the function). The OS I use is a Debian GNU/Linux 3.0r1 (kernel 2.4.26) on a dual AMD Athlon MP system. ...

HOwto access different devices on pCI bus
Hello, I am very new to MAC system. I have G5 system with MAC OS 10.3 loaded in it. I want to develop a aaplication to access the different devices on the PCI bus, I am basically interested in accessing video device. i want to get Vendor ID, Device ID , base address of the device. Please let me know are there any API's provided by mac to access HArdware? we can access io port in LINUX with inb() .. outb() .. system API Are there any similiar API for MAC also? Same task we can carry out in windows with Inport/outport API. Please let me know if I have to post this question ...

Printing reports in MS Access from a C# Windows app
I was wondering if it is possible to take a canned report ( on an Access database (Access XP version), and then be able to write a C# application that will make a call to the canned report in Access and print it (just as you would print the report while in Access)? If so, could you give me an example so I could follow the syntax. Printing from a C# application isn't as graceful as going into Access and just running the report and printing it. Any ideas on how to make this work so the users don't have to learn how to open the report in Access and print it? Just trying to make users ...

Open ACCESS Application thru C# Application on windows 7
Hi all, Some background: we have a windows application (c#) that locate in the system try. that simple application is a basically shortcuts manger for other application and messaging between the workers. one of the application is an Access 2007 application (connected to sqlserver) - the client works with ACCESS Runtime 2007 (latest version) THE problem is that we can not launch the Access application correctly from the C# application. THE problem is only on windows 7 (we don't have vista) - [on XP OS everything works fine) "correctly" - meaning that the Access...

accessing PCI 1602F using Turbo C 3.0
hi i have data acquisition board PCI-1602F. I am using windows-XP. I am using Turbo c 3.0 for accessing the card. I have copied the header H file and the LIB files in the library and include directory C:\TC\LIB and C:\TC\INCLUDE. The program compiles without error but gives Linking error. Please help. Thanks for your support regards vivek -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 vivekmay12@gmail.com wrote: > hi > i have data acquisition board PCI-1602F. I am using windows-XP. I am > using Turbo c 3.0 for accessing the card. I'm sorry, but we cannot he...

accessing PCI 1602F using Turbo C 3.0 #3
hi i have data acquisition board PCI-1602F. I am using windows-XP. I am using Turbo c 3.0 for accessing the card. I have copied the header H file and the LIB files in the library and include directory C:\TC\LIB and C:\TC\INCLUDE. The program compiles without error but gives Linking error. Please help. Thanks for your support regards vivek ...

accessing PCI 1602F using Turbo C 3.0 #2
hi i have data acquisition board PCI-1602F. I am using windows-XP. I am using Turbo c 3.0 for accessing the card. I have copied the header H file and the LIB files in the library and include directory C:\TC\LIB and C:\TC\INCLUDE. The program compiles without error but gives Linking error. Please help. Thanks for your support regards vivek ...

cannot access the file 'C:\WINDOWS\TEMP' VB ASP IIS
I have a ASP, VB and excel application running on 116.0 on OS 2003 Server. In the VB dll I have a following piece of code: Dim xl As New Excel.Application Set xl =3D CreateObject("excel.application") xl.Workbooks.Open "D:\template2.xls", , True, , , , True, , , , False --- -- xl.Quit Set xl =3D Nothing After the above code is compiled into dll, the dll is called from asp page. The above code runs totally fine under Integrated mode as I pass my administrative windows credentials to the server. But using the anonymous access (which will be required), I am facing some ...

Can't access C drive from Windows Xp boot disk
How do I make a Win Xp boot disk that will recoginize a 16 gig hard disk and allow access from the command prompt? I made a boot disk using the A: format options, but I can't get to the C drive when it boots from the floppy. Is there a driver I can add to the boot disk that will allow access to the hard drive? -Bill Probably the best option is to boot from your XP CD as it has all the necessary drivers & files. WT <wrongaddress@att.net> wrote in message news:1105426149.407196.62100@c13g2000cwb.googlegroups.com... > How do I make a Win Xp boot disk that will recogini...

Linux and Windows compatible Serial Com Port access utility code in C++
Is there any Linux and Windows compatible Serial Com Port access utility code (class library etc) in C++ ? >Is there any Linux and Windows compatible Serial Com Port access utility >code (class library etc) in C++ ? Not really, but you can use http://beyondlogic.org/ as a guide and use inportb, outportb (DOS) _inp, _outp (Win32) inb, outb (Linux) for the port access, though a real device driver is recommended so that the COM port cannot be used at the same time by two apps who do not know of the existance of each other. Jan Engelhardt -- Somebody set me up th...

the specified System directory L"C:\\windows\\SYSTEM" is not accessible
I'm using wine-20040914-1fc2winehq.src.rpm on Fedora Core 2. It was able to run excel and word from a win98 partition, but now I'm trying to get it to work off of a windows 2000 partition. When I run wine I get the error Warning: the specified System directory L"C:\\windows\\SYSTEM" is not accessible. but my .wine/config file reads as follows: .... [Drive C] "Path" = "/hansel" "Type" = "hd" "Filesystem" = "vfat" .... [wine] "windows" = "C:\\winnt" "system" = "...

How do I use windows HID API interface to access USB device(newbie C++ programmer)
i am trying to create an application to send/recieve data from standard HID device. i wrote a simple code but i cant even get it to compile. this is the error i recieve: fatal error C1083: Cannot open include file: 'hid.h': No such file or directory. so what am i missing out?? i am using visual C++ 2008 and have windows DDK 6001.18000 installed. do i need to add directory to the hid.h file or add linkage to the hid.lib file or something?? #include "stdafx.h" #include <wtypes.h> #include <setupapi.h> #include <windows.h> #include <d...

WebSphere JVM Access Violation Problem running Java program that calls methods in a Windows C++ DLL via a JNI wrapper.......
Greetings, Am having a problem running an Eclipse Java program in the IDE on Windows XP that calls Windows C++ methods in a Windows DLL via JNI. The JNI wrapper was developed using the SUN JVM. When we run the java program using the SUN JVM it all works well; when we attempt this using the JVM available with IBM Websphere 6.0.2.5 we have the following problem when we attempted to make the first C++ init method call: JVMDG217: Dump Handler is Processing Signal 11 - Please Wait. JVMDG303: JVM Requesting Java core file JVMDG304: Java core file written to C:\EclipseWorkspace\AppName\javacore.200...

Accessing C++ from C
in the September issue of C/C++ Users Journal, there was a technique mentioned in "Conversations" which suggested how to provide generic access to C++ classes from C by wrapping your C++ in C. My problem is that I can't figure otu how this is done. My gcc linker keeps complaining that it can't find object code for the STL library members. Has anyone else tried to do this and gotten it to work? if so, could you let me know how? Thanks, Evan Carew Evan Carew wrote: > in the September issue of C/C++ Users Journal, there was a technique > mentioned in "Conver...

portable C, posix C and windows C
what is the difference between portable C, posix C and windows C ??? On Oct 7, 10:34=A0pm, asit <lipu...@gmail.com> wrote: > what is the difference between portable C, posix C and windows C ??? Portable means that it will compile on many platforms. To accomplish this, you need some kind of a standard. The ANSI/ISO C standard creates one kind of portability for C programs. Posix is another kind of standard. It allows some additional fascilities to be standardized that will not work without the Posix assumption. http://en.wikipedia.org/wiki/POSIX There is no such thing as Windows ...

OpenGL Window using Windows Forms and Managed C++ (not C#)
Hi, I'm wondering if anyone can help provide instructions on how to create a simple OpenGL enabled Window in Windows Forms using Managed C++ (not C#). An example would be great if you have one. Its not the OpenGL thats the problem, I'd just love to know how Windows Forms does it, any ideas please ? Takura_Z@hotmail.com (Takura) wrote in message news:<a33991d8.0401160144.5f270c41@posting.google.com>... > Hi, I'm wondering if anyone can help provide instructions on how to > create a simple OpenGL enabled Window in Windows Forms using Managed > C++ (not C#). An example...

ACCESS accessibility from a C++ process launched from an ACCESS form
Here is my problem. From an ACCESS form, I run a C++ process reaching the same database in read/write mode via the ODBC driver. An error occurs: " The database has been placed by an unknown user in a state preventing it from being opened either locked. SQLSetConnectAttr failure of the pilot " (Nota : translated approximatively from the french error message). However, if I have used an another form before (eg. to modify a table), or if I have modified myself a record of any table, there is no problem. It seems that the database is in a state " read-only " by default until th...

question about PCI/PCI-64/PCI-X bus sharing
I am getting a new motherboard that has an integrated PCI-X Ultra320 controller built in (Adaptec 7902). Unfortunately the version of the Adaptec controller used in this mobo is not the version that natively supports RAID, so I am looking into a zero-channel RAID card to provide that feature. The motherboard doesn't have PCI-X slots but it does have two PCI 64-bit x 66 MHz slots. Companies like Adaptec that sell zero-channel RAID solutions say that this won't be a bottleneck to the SCSI and RAID performance, but how can that be? If the controller itself is PCI-X, then when it ac...

Searching for an SIP softphone in c++,c, c# or java for Windows
Hello group I'm doing my midterm project on IP-telephony, therefore I'm looking for an open source implementation of a SIP softphone for windows, in c++, c, c# or Java. Can anybody help? Thanks /Thomas Skype has softphone for PDA'a running Win OS which I believe is written in Java. It's still beta and free to download. Regards, Martin Martin� wrote: > Skype has softphone for PDA'a running Win OS which I believe is written in > Java. > It's still beta and free to download. > Regards, > Martin > > Skype is not exa...

question about PCI/PCI-64/PCI-X bus sharing
I am getting a new motherboard that has an integrated PCI-X Ultra320 controller built in (Adaptec 7902). Unfortunately the version of the Adaptec controller used in this mobo is not the version that natively supports RAID, so I am looking into a zero-channel RAID card to provide that feature. The motherboard doesn't have PCI-X slots but it does have two PCI 64-bit x 66 MHz slots. Companies like Adaptec that sell zero-channel RAID solutions say that this won't be a bottleneck to the SCSI and RAID performance, but how can that be? If the controller itself is PCI-X, then wh...

Accessing mexw32 from C/C++
A lot of stuff is written about how to access mexw32 files from MatLab/Simulink. However I haven't found anything about accessing mexw32 (created by RTW) from C/C++. A simple try already failed at the LoadLibrary function. Has anybody done this before? Thanks Markus Hi Markus, If you are referring to MEX-functions generated by the EMLMEX command, then these are not designed to be used outside the MATLAB environment. If you have a Real-Time Workshop license you can use EMLC with the -T RTW:lib to generate a standalone library. This can be linked into your application however y...