flat assembler
Message board for the users of flat assembler.
Index
> DOS > detecting NVIDIA video card |
Author |
|
CandyMan 29 Aug 2020, 17:29
Does anyone know how to detect NVIDIA video card in dos?
Assembly code is welcome. _________________ smaller is better |
|||
29 Aug 2020, 17:29 |
|
bitRAKE 29 Aug 2020, 21:33
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/pcisleep.html
Includes assembly to read PCI bus from DOS. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
29 Aug 2020, 21:33 |
|
CandyMan 31 Aug 2020, 09:08
Thanks, that's what I meant.
|
|||
31 Aug 2020, 09:08 |
|
sinsi 03 Sep 2020, 05:10
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) |
|||
03 Sep 2020, 05:10 |
|
Laaca 02 Nov 2020, 20:50
PCI scan is not necessary. Besides that - in situation when you have a integrated card + dedicated card is not clear which one is used.
I preffer to look into VideoBIOS segment - segment C000h. Part of my Freepascal code: Code: Function MemB(segm,offs:word):byte;assembler; asm movzx ebx,segm shl ebx,4 movzx eax,offs add ebx,eax mov al,fs:[ebx] end; Function RMString(segm,offs:word;len:byte):string; var a:longint; s:string; begin s:=''; for a:=0 to len-1 do s:=s+char(MemB(segm,offs+a)); RMstring:=s; end; Procedure Get_SVGA(var vendor,device:word); var pci:word; ven,dev:word; begin vendor:=0; device:=0; pci:=word(MemB($C000,$18))+word(MemB($C000,$19))*256; if RMstring($C000,pci,4)='PCIR' then begin vendor:=word(MemB($C000,pci+4))+word(MemB($C000,pci+5))*256; device:=word(MemB($C000,pci+6))+word(MemB($C000,pci+7))*256; end; end; |
|||
02 Nov 2020, 20:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.