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++ 48431 articles. 31 followers. Post

4 Replies
588 Views

Similar Articles

[PageSpeed] 3


  • 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...

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...

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 ...

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 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. ...

C access: accessing ints
Hi All, I have written my first program to access a database from C. However, my manual, "MySQL" by Paul DeBois, only explains how to access varchars and blobs, it doesn't explain how to access, say ints or floats or doubles. My code looks like this (mostly copied straight out of the book): .... if (mysql_query(conn, "select BowlerFirstName, BowlerLastName, BowlerCity" " from Bowlers")) { u_reportError(conn, "mysql_query() failed"); } res_set = mysql_store_result(conn); if (!res_set) { ...

C, C++, Windows Internals
Hi , We have an excellent opening for our below requirement =96 C, C++, Windows Internals developer with one of our clients in Bangalore. This team is into research and development, working on exclusive cutting edge products. Please find below the details: Job Skills Required C, C++, Windows Internals Knowledge of linkers, loaders, debuggers, object file format and compilers. Knowledge of manager (.net) and unmanagerd code, windows internals through, understanding of linkers, shared libraries, debuggers and object file formats and compilers, knowledge of X86 processor arch...

c/c++ compiler on windows
Hello Generally i write my programs in some sort of unix boxes, but now that i got a laptop and i have windows xp running on top of that i was shopping around for a decent c/c++ compiler. I can get visual studio .net 2002, 2003 or plain visual studio 6 free for download from my university but they look pretty much over kill for what i do. I generally code in plain ANSI C/C++ and i dont want to give huge disk space for just a compiler and it's libraries. I would really appreciate if somebody could point me to a c/c++ or even fortran compiler IDE for windows that i can buy/download/...

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...

C++ library access from C
Hi, This is going to be one of those annoyingly stupid questions. I would like to compile a library as a C++ program, but it needs to be able to work with a C program as well. I only want to distribute one ..lib file and an H file. I know that I can call a C library from a C++ program. Is it possible to compile a CPP library that can be called from a C program? For the, "why not just make it a C library and stop wasting our time?" question, I need to handle some OLE/OCP calls, and I'm trying to avoid the pain the arse of doing OLE in C. Thanks in advance, Tom TBass wrote: ...

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 ...

Providing alternate bus master with multiple cycles of bursting access to Local Bus in a Dual Bus System Including a Processor Local Bus and a Device Communications Bus
<http://books.google.com/patents/pdf/Providing_alternate_bus_master_with_mult.pdf?id=csAhAAAAEBAJ&output=pdf&sig=TPyLj2ObwkFike1mqON40hLh4_o> Our beloved 7568 ...

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 ...

PERL windows : "Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item."
Hi, I am getting following error " "Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item." When i tried to pass a list consisting of 300 file names. Scenario: folder F:\Testing\loc\ Contains around 300 files I have to pass these files as parameter to one perl script .pl, where these files are processed( opened and read). Alg: take each file and concatenate them to a list like: while($filename = readdir(DIR)) { $list .= $filename; } At the end, the list contains 300 file names. When I pass this as pa...

Child windows can not access window.opener when multiple child windows are open
I have a parent window that pushes a new window object onto an Array with the following code : OpenChild() { //totalNumWindowsCreated is global totalNumWindowsCreated = totalNumWindowsCreated + 1; childWnds.push(window.open(link, "child" + totalNumWindowsCreated,"dependent")); .. .. .. } This pops up a new window with every call. In the child window I call a parent function onbeforeunload, appClose() : function appClose(){ if (window.opener && !window.opener.closed){ window.opener.CloseChild(getQueryString("application")); } } This is in my frames...

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...

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta >...

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...