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
retu db 0Dh,0AH,'$'
dta db 43 dup (0)
nom db 25 dup (0)
copycos:
mov ah,9
@ -96,7 +97,11 @@ allfile:
mov ah,3ch
push cs
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 byte ptr [di+2],"\"
xor cx,cx

View File

@ -8,52 +8,42 @@ org 0100h
include ..\include\pci.h
start:
call cleartext
call getpciinfos
mov pciversion,bx
mov nbbus,cl
mov pcitype,al
mov si,offset msg
mov ah,13
int 47h
mov ah,6
int 47h
call showstring0
call line
mov si,offset pcivers
mov ah,13
int 47h
call showstring0
xor edx,edx
mov dx,bx
xchg dl,dh
mov cx,8
mov ah,0Ah
int 47h
call showhex
mov si,offset poin
mov ah,13
int 47h
call showstring0
shr dx,8
mov ah,0Ah
int 47h
call showhex
mov si,offset pcivers2
mov ah,13
int 47h
mov ah,6
int 47h
call showstring0
call line
mov si,offset nbbuses
mov ah,13
int 47h
call showstring0
xor edx,edx
mov dl,nbbus
inc dl
mov ah,08
int 47h
mov ah,06
int 47h
call showint
call line
mov si,offset typesof
mov ah,13
int 47h
call showstring0
mov di,offset types
mov bx,7
mov al,pcitype
@ -62,17 +52,14 @@ bt ax,bx
jnc nowas
shl bx,1
mov si,[di+bx]
mov ah,13
int 47h
call showstring0
mov si,offset spac
mov ah,13
int 47h
call showstring0
shr bx,1
nowas:
dec bx
jns vote
mov ah,6
int 47h
call line
xor ax,ax
xor cx,cx
@ -83,41 +70,34 @@ jc stopthis
push cx di
mov si,offset msg1
mov ah,13
int 47h
call showstring0
mov cx,16
xor edx,edx
mov dx,[di+pci.device]
mov ah,0Ah
int 47h
call showhex
mov si,offset msg2
mov ah,13
int 47h
call showstring0
mov dx,[di+pci.vendor]
mov ah,0Ah
int 47h
call showhex
mov si,offset msg3
mov ah,13
int 47h
call showstring0
mov cl,[di+pci.class]
mov ch,[di+pci.subclass]
mov di,offset temp
call getpciclass
mov si,di
mov ah,13
int 47h
call showstring0
mov si,offset poin
mov ah,13
int 47h
call showstring0
mov di,offset temp
call getpcisubclass
mov si,di
mov ah,13
int 47h
mov ah,06
int 47h
call showstring0
call line
pop di cx
jmp noerror
noerror:
inc ch
cmp ch,7
jbe search
@ -130,9 +110,7 @@ xor cl,cl
inc al
cmp al,16
jbe search
xor ax,ax
int 16h
db 0CBh
ret
msg3 db ' Classe:',0
msg1 db 'Peripherique :',0
@ -450,4 +428,179 @@ notexist:
pop di dx bx ax
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