fix: correction de l'installation et de la detection

BREAKING CHANGE: attention modification majeure du code
This commit is contained in:
Nicolas Hordé 2004-06-12 22:13:38 +00:00
parent db731a84de
commit 0424cbbab8
2 changed files with 210 additions and 52 deletions

View File

@ -20,6 +20,7 @@ boot db 'boot.bin',0
dat db 'data',0 dat db 'data',0
retu db 0Dh,0AH,'$' retu db 0Dh,0AH,'$'
dta db 43 dup (0) dta db 43 dup (0)
nom db 25 dup (0)
copycos: copycos:
mov ah,9 mov ah,9
@ -96,7 +97,11 @@ allfile:
mov ah,3ch mov ah,3ch
push cs push cs
pop es pop es
mov di,offset dta+30-3 mov si,offset dta+30-3
mov di,offset nom
mov cx,25
rep movsb
mov di,offset nom
mov word ptr [di],":a" mov word ptr [di],":a"
mov byte ptr [di+2],"\" mov byte ptr [di+2],"\"
xor cx,cx xor cx,cx

View File

@ -8,52 +8,42 @@ org 0100h
include ..\include\pci.h include ..\include\pci.h
start: start:
call cleartext
call getpciinfos call getpciinfos
mov pciversion,bx mov pciversion,bx
mov nbbus,cl mov nbbus,cl
mov pcitype,al mov pcitype,al
mov si,offset msg mov si,offset msg
mov ah,13 call showstring0
int 47h call line
mov ah,6
int 47h
mov si,offset pcivers mov si,offset pcivers
mov ah,13 call showstring0
int 47h
xor edx,edx xor edx,edx
mov dx,bx mov dx,bx
xchg dl,dh xchg dl,dh
mov cx,8 mov cx,8
mov ah,0Ah call showhex
int 47h
mov si,offset poin mov si,offset poin
mov ah,13 call showstring0
int 47h
shr dx,8 shr dx,8
mov ah,0Ah call showhex
int 47h
mov si,offset pcivers2 mov si,offset pcivers2
mov ah,13 call showstring0
int 47h call line
mov ah,6
int 47h
mov si,offset nbbuses mov si,offset nbbuses
mov ah,13 call showstring0
int 47h
xor edx,edx xor edx,edx
mov dl,nbbus mov dl,nbbus
inc dl inc dl
mov ah,08 call showint
int 47h call line
mov ah,06
int 47h
mov si,offset typesof mov si,offset typesof
mov ah,13 call showstring0
int 47h
mov di,offset types mov di,offset types
mov bx,7 mov bx,7
mov al,pcitype mov al,pcitype
@ -62,17 +52,14 @@ bt ax,bx
jnc nowas jnc nowas
shl bx,1 shl bx,1
mov si,[di+bx] mov si,[di+bx]
mov ah,13 call showstring0
int 47h
mov si,offset spac mov si,offset spac
mov ah,13 call showstring0
int 47h
shr bx,1 shr bx,1
nowas: nowas:
dec bx dec bx
jns vote jns vote
mov ah,6 call line
int 47h
xor ax,ax xor ax,ax
xor cx,cx xor cx,cx
@ -83,41 +70,34 @@ jc stopthis
push cx di push cx di
mov si,offset msg1 mov si,offset msg1
mov ah,13 call showstring0
int 47h
mov cx,16 mov cx,16
xor edx,edx xor edx,edx
mov dx,[di+pci.device] mov dx,[di+pci.device]
mov ah,0Ah call showhex
int 47h
mov si,offset msg2 mov si,offset msg2
mov ah,13 call showstring0
int 47h
mov dx,[di+pci.vendor] mov dx,[di+pci.vendor]
mov ah,0Ah call showhex
int 47h
mov si,offset msg3 mov si,offset msg3
mov ah,13 call showstring0
int 47h
mov cl,[di+pci.class] mov cl,[di+pci.class]
mov ch,[di+pci.subclass] mov ch,[di+pci.subclass]
mov di,offset temp mov di,offset temp
call getpciclass call getpciclass
mov si,di mov si,di
mov ah,13 call showstring0
int 47h
mov si,offset poin mov si,offset poin
mov ah,13 call showstring0
int 47h
mov di,offset temp mov di,offset temp
call getpcisubclass call getpcisubclass
mov si,di mov si,di
mov ah,13 call showstring0
int 47h call line
mov ah,06
int 47h
pop di cx pop di cx
jmp noerror
noerror:
inc ch inc ch
cmp ch,7 cmp ch,7
jbe search jbe search
@ -130,9 +110,7 @@ xor cl,cl
inc al inc al
cmp al,16 cmp al,16
jbe search jbe search
xor ax,ax ret
int 16h
db 0CBh
msg3 db ' Classe:',0 msg3 db ' Classe:',0
msg1 db 'Peripherique :',0 msg1 db 'Peripherique :',0
@ -450,4 +428,179 @@ notexist:
pop di dx bx ax pop di dx bx ax
ret ret
;=============CLEAR=========
;Efface l'ecran texte
;->
;<-
;=============================
cleartext:
push es eax cx di
xor di,di
mov ax,0b800h
mov es,ax
mov eax,07200720h
mov cx,cs:pagesize
shr cx,2
cld
rep stosd
mov cs:xy,0
mov cs:x,0
mov cs:y,0
pop di cx eax es
ret
;==========LINE=========
;remet le curseur a la ligne
;->
;<-
;=============================
line:
push bx cx di es
mov bh,cs:x
mov bl,cs:y
xor bh,bh
mov cl,cs:lines
dec cl
dec cl
cmp bl,cl
jne scro
dec bl
mov cl,1
call scrolldown
scro:
inc bl
call setxy
pop es di cx bx
ret
;==========SETXY=========
;Change les coordonnées du curseur a X:AH,Y:AL
;-> AX
;<- es di
;=============================
setxy:
push ax bx dx
mov cs:x,bh
mov cs:y,bl
mov al,bl
mov bl,bh
xor bh,bh
mov di,bx
mul cs:columns
add di,ax
shl di,1
mov cs:xy,di
mov ax,0B800h
mov es,ax
pop dx bx ax
ret
;==========SCROLLDOWN=========
;defile de cx lines vers le bas
;-> CX
;<-
;=============================
scrolldown:
push ax cx dx si di ds es
mov si,0B800h
mov es,si
mov ds,si
mov ax,cx
mul cs:columns
shl ax,1
mov si,ax
mov cx,cs:pagesize
sub cx,si
xor di,di
cld
rep movsb
pop es ds di si dx cx ax
ret
;===================================Afficher un int EDX a l'cran en ah,al================
ShowInt:
push eax bx cx edx esi di es ds
mov di,cs:xy
mov cx,0B800h
mov es,cx
xor cx,cx
mov eax,edx
mov esi,10
mov bx,offset showbuffer+27
decint3:
xor edx,edx
div esi
add dl,'0'
mov dh,7
sub bx,2
add cx,2
mov cs:[bx],dx
cmp ax,0
jne decint3
mov si,bx
push cs
pop ds
cld
rep movsb
mov cs:xy,di
pop ds es di esi edx cx bx eax
ret
;================Affiche la chaine 0 de caractŠre contenue dans ds:si
showstring0:
push es cx si di
mov di,cs:xy
mov cx,0B800h
mov es,cx
mov ch,cs:colors
strinaize0:
mov cl,[si]
cmp cl,0
je no0
mov es:[di],cx
add di,2
inc si
jmp strinaize0
no0:
mov cs:xy,di
pop di si cx es
ret
;==============================Affiche le nombre nb hexa en EDX==============
ShowHex:
push es ax bx cx edx di
mov di,cs:xy
mov bx,0B800h
mov es,bx
mov ax,cx
sub cx,32
neg cx
shl edx,cl
mov ch,cs:colors
shr ax,2
Hexaize:
rol edx,4
mov bx,dx
and bx,0fh
mov cl,cs:[bx+offset Tab]
mov es:[di],cx
add di,2
dec al
jnz Hexaize
mov cs:xy,di
pop di edx cx bx ax es
ret
Tab db '0123456789ABCDEF'
x db 0
y db 0
xy dw 0
pagesize dw 80*25*2
lines db 25
columns db 80
colors db 7
showbuffer db 35 dup (0FFh)
end start end start