flat assembler
Message board for the users of flat assembler.

Index > Main > PCI Programming/Graphics card polling

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Hey! It's me again... (been a while) But yeah, I'm trying to find info on how to program PCI ports. More or less I'm interested in trying to poll my gfx card port to see what all can be done with it and whawt ports I'd write to so I can integrate direct GPU programming into my projects.
Post 12 Mar 2007, 20:30
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
This link may help http://homepage.swissonline.ch/tinyasm/v3.htm
I think "3dmon.zip" is the one you want.
Post 13 Mar 2007, 00:55
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks Dex. I'm intending on making a .INC file that can be generic for any OS. I have studied a lot more math to gain more understanding about 3D (and just for fun) and I have recently called NVidia for info about programming their GPUs, which they told me to send an email, which I did, and then they referred me to join their developer groups, which you need to be apart of a big business to join... So it looks like I'm alone with figuring this out.
Post 13 Mar 2007, 02:49
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Actually, I believe that still is a bit too much to go into (as I'm re-acquainting myself with low-level ASM programming), if anyone has a simple PCI programming tutorial that would be great to work with at first.

Thanks for the help!
Post 13 Mar 2007, 03:13
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I wrote some info here: http://board.flatassembler.net/topic.php?t=2353&start=0
Goto the ASHLEY4 posts (Note: that was my name then).
The post is for sound cards, but its the same for all devicers.
Post 13 Mar 2007, 16:21
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks. PCI control is easier than I thought it would be.

One quick question, though. How did you know where to find the PCI bus at?
Post 14 Mar 2007, 00:05
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
We started at the default 80000000h and scanned through them, once we find vendor/device ID, we get base etc.
Post 14 Mar 2007, 00:42
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks, and how do you know the size of the PCI bus? (Sorry if I sound like I am asking stupid questions but PCI programming is a very new concept to me)
Post 14 Mar 2007, 00:56
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
It OK thats how you learn, 0xfff8.
So you start at 0x80000000, test for vendor/device id, If not found, add 0x100, test for 0x80fff800, if = end, if not test for vendor/device id and loop again till you find id or get to the end (eg: 0x80fff800).
Post 14 Mar 2007, 15:54
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks. From what I've heard, most graphics cards are developed the same way (as they're hard to develop from a different standard) and thus I think that most of the functions will be mostly the same, give or take a few.
Also, I was looking at that V3 graphics programming site you suggested, downloaded the thing, and realized they were using a PCI Bios interrupt for PCI as opposed to writing to the ports directly (which they could get away with 'cause they were using 32-bit DOS mode).
Post 14 Mar 2007, 20:24
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Get your device/vendor ID for your card from here: http://www.pcidatabase.com/
and add it to this simple program i made, you can run it from MiniDos if you do not have dos.


Last edited by Dex4u on 15 Mar 2007, 16:53; edited 1 time in total
Post 14 Mar 2007, 23:35
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
How do you want me to load in the vendor & device IDs? A simple addition of the two? Also, I got an error when it tried to add 80*10^6h and 40*10^6h (My apologies, scientific notation comes in handy at times like that) and move them into EAX.
Post 15 Mar 2007, 04:13
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I up loaded a fix and tested pci.asm, down load it again and try.
Vendor/device can be added like this:
Code:
        mov   ax,24c5h     ; put your device id here        shl   eax,16        mov   ax,8086h      ; put your vendor id here    


Description:
Download
Filename: pci.asm
Filesize: 4.6 KB
Downloaded: 159 Time(s)

Post 15 Mar 2007, 16:52
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks! It's working, but I have the right card info and it's saying it's not being found.

What I have is an nVidia GeForce FX 5200 (that's all the device manager says it is), and according to the pcidatabase website, this was the info:

GeForce FX 5200 Device-ID: 0x0322
NVIDIA Vendor-ID: 0x10DE

EDIT - I just checked under Settings/Control Panel/System/Hardware/Device Manager/Display Adaptors/ then right clicked my chip and hit properties then went under the Details tab and it had the exact same settings as that website. So I tried my modem, and it didn't find it either. Is it 'cause Windows is blocking it?
Post 15 Mar 2007, 22:21
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Are you running that from Windows? I think that it could not work and you need to use BIOS instead or run it from DOS or MiniDOS as Dex suggested.
Post 15 Mar 2007, 23:39
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Okay, let me try that. Where can I get MiniDOS?
Post 15 Mar 2007, 23:41
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Forget using BIOS, http://www.cs.cmu.edu/~ralf/pub-files/rbpci119.zip didn't worked for me on XP SP2, "PCICFG.EXE *" displays nothing... Same problem skipping BIOS.

Quote:
Where can I get MiniDOS?

http://board.flatassembler.net/topic.php?t=5275
Post 15 Mar 2007, 23:49
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Thanks.
Post 15 Mar 2007, 23:54
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat
Strange... I'm trying to run MiniDOS on my PC I'm trying to do the test on, and it doesn't boot off the floppy. Yet I put the floppy in another older system and it gets read. Any ideas as to why this is happening?

Thanks!

-Rhyno
Post 16 Mar 2007, 00:35
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
First as to why miniDos does not boot on, that PC i do not know it boots fine on all my test PC (over 20).
Also i try running the program in win98 and it worked, are you sure you got the id the right way round and try you sound card ID as i have only test it on sound cards.
Post 16 Mar 2007, 01:32
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.