fix: correction du bogue concernant la detection des ressources PCI : affiche uniquement les sous fonction lorsqu'il en existe Rajout de l'identifiant PCI

This commit is contained in:
Nicolas Hordé 2004-10-28 15:47:34 +00:00
parent 0b373cda0d
commit f4f42eea75
1 changed files with 116 additions and 25 deletions

View File

@ -81,6 +81,7 @@ search:
call Getallfunctionsinfos
jc stopthis
mov bp,cx
push cx di
mov si,offset msg1
mov ah,13
@ -96,6 +97,32 @@ int 47h
mov dx,[di+pci.vendor]
mov ah,0Ah
int 47h
mov si,offset msg4
mov ah,13
int 47h
xor dx,dx
mov dl,al
mov cx,8
mov ah,0Ah
int 47h
mov ah,07
mov dl,'.'
int 47h
mov dx,bp
xor dh,dh
mov cx,8
mov ah,0Ah
int 47h
mov ah,07
mov dl,'.'
int 47h
mov dx,bp
shr dx,8
mov cx,8
mov ah,0Ah
int 47h
mov ah,05h
int 47h
mov si,offset msg3
mov ah,13
int 47h
@ -134,9 +161,10 @@ xor ax,ax
int 16h
db 0CBh
msg3 db ' Classe:',0
msg3 db ' Classe :',0
msg1 db 'Peripherique :',0
msg2 db ' Constructeur :',0
msg4 db ' iD :',0
msg db 'COS2000 hardware detecteur V1.1',0
pcivers db 'BIOS PCI version ',0
pcivers2 db ' a ete detecte !',0
@ -330,7 +358,7 @@ dw offset subclass67
subclass60 db 'hote',0
subclass61 db 'isa',0
subclass62 db 'eisa',0
subclass63 db 'mc',0
subclass63 db 'mca',0
subclass64 db 'pci',0
subclass65 db 'pcmcia',0
subclass66 db 'nubus',0
@ -346,9 +374,9 @@ class8d:
dw offset subclass80
dw offset subclass81
dw offset subclass82
subclass80 db 'pic 8259a',0
subclass81 db 'dma 8237',0
subclass82 db 'tim 8254',0
subclass80 db 'pic',0
subclass81 db 'dma',0
subclass82 db 'timer',0
class9d:
dw offset subclass90
@ -379,10 +407,12 @@ dw offset subclass120
dw offset subclass121
dw offset subclass122
dw offset subclass123
dw offset subclass124
subclass120 db 'firewire',0
subclass121 db 'access',0
subclass122 db 'ssa',0
subclass123 db 'usb',0
subclass124 db 'smbus',0
;bx pci version, cl nbbus, al pci type
getPciInfos:
@ -402,29 +432,22 @@ errorpci:
pop dx
ret
;al=bus bl=index cl=deviceid ch=func->dl
getfunctioninfo:
push eax bx cx
mov ah,80h
shl eax,16
mov ah,cl
shl ah,3
or ah,ch
mov al,bl
and al,0fch
mov dx,0cf8h
out dx,eax
mov dx,0CFCh
and bl,3
or dl,bl
in al,dx
mov dl,al
pop cx bx eax
ret
;al=bus cl=deviceid ch=func es:di
Getallfunctionsinfos:
push ax bx dx di
cmp ch,0
je amultiorfirst
mov bl,0Eh
push cx
xor ch,ch
call getfunctioninfo
pop cx
and dl,80h
cmp dl,0
jne amultiorfirst
mov word ptr [di],0000h
jmp notexist
amultiorfirst:
xor bl,bl
goinfos:
call getfunctioninfo
@ -449,5 +472,73 @@ notexist:
stc
pop di dx bx ax
ret
; PCI TYPE 1
;*******************************************************************
config1_addr equ 0CF8h
config1_data equ 0CFCh
pci_type1_detect:
mov dx, config1_addr+3
mov al, 01h
out dx,al
mov dx,config1_addr
in eax,dx
mov ecx,eax
mov eax,80000000h
out dx,eax
in eax,dx
cmp eax,80000000h
jne endofdetectiontype1
mov eax,ecx
out dx,eax
endofdetectiontype1:
ret
;al=bus bl=index cl=deviceid ch=func->dl
getfunctioninfo:
push eax bx cx
mov ah,80h
shl eax,16
mov ah,cl
shl ah,3
or ah,ch
mov al,bl
and al,0fch
mov dx,0cf8h
out dx,eax
mov dx,0CFCh
and bl,3
or dl,bl
in al,dx
mov dl,al
pop cx bx eax
ret
; PCI TYPE 2
;*******************************************************************
config2_reg0 equ 0CFBh
config2_reg1 equ 0CF8h
config2_reg2 equ 0CFAh
pci_type2_detect:
xor ax,ax
mov dx,config2_reg0
out dx,ax
mov dx,config2_reg1
out dx,ax
mov dx,config2_reg2
out dx,ax
mov ax,config2_reg1
in al,dx
cmp al,0
jne endofdetectiontype2
mov ax,config2_reg0
in al,dx
cmp al,0
jne endofdetectiontype2
endofdetectiontype2:
ret
end start