flat assembler
Message board for the users of flat assembler.

Index > DOS > detecting NVIDIA video card

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 316
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Does anyone know how to detect NVIDIA video card in dos?
Assembly code is welcome.

_________________
smaller is better
Post 29 Aug 2020, 17:29
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3018
Location: vpcmipstrm
bitRAKE

_________________
¯\(°_o)/¯ unlicense.org
Post 29 Aug 2020, 21:33
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 707
Location: Adelaide
sinsi
Assuming it's a PCI card, scan the PCI configuration space for Nvidia's vendor ID (10DE).
From memory, some code (untested!)
Code:
;bus = 0 to 255, device = 0 to 31, function = 0 to 7, index = 0 to 255
    mov eax,80000000h or (bus shl 16) or (device shl 11) or (function shl 8) or (index) ;we want to read dword at index 0
    mov dx,0cf8h
    out dx,eax
    mov dx 0cfch
    in eax,dx
;EAX low 16 bits = vendor ID, high 16 = device ID
;If vendor is FFFF there is no device there.
    
Post 29 Aug 2020, 21:34
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 316
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
Thanks, that's what I meant.
Post 31 Aug 2020, 09:08
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 707
Location: Adelaide
sinsi
Just to expand a little, if you find the vendor you would then read the dword at index=8.
This has the Class/Subclass/Prog IF/Revision information, a video card would be Class=3.

If you want to check for multiple video adapters you would keep scanning (e.g. SLI)
Post 03 Sep 2020, 05:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.