feat: reprogrammation en utilisant la librairie video

This commit is contained in:
Nicolas Hordé 2004-11-23 00:43:29 +00:00
parent ccf990b896
commit 263a874d76
3 changed files with 150 additions and 214 deletions

View File

@ -6,54 +6,29 @@ smart
org 0h org 0h
include ..\include\pci.h include ..\include\pci.h
include ..\include\mem.h
start: start:
header exe <,1,0,,,offset imports,,>
realstart:
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 ah,13
int 47h
mov ah,6
int 47h
mov si,offset pcivers
mov ah,13
int 47h
xor edx,edx xor edx,edx
mov dx,bx mov dl,[nbbus]
xchg dl,dh
mov cx,8
mov ah,0Ah
int 47h
mov si,offset poin
mov ah,13
int 47h
shr dx,8
mov ah,0Ah
int 47h
mov si,offset pcivers2
mov ah,13
int 47h
mov ah,6
int 47h
mov si,offset nbbuses
mov ah,13
int 47h
xor edx,edx
mov dl,nbbus
inc dl inc dl
mov ah,08 push edx
int 47h mov dx,[pciversion]
mov ah,06 push edx
int 47h mov dx,[pciversion]
shr dx,8
push edx
push offset msg
call [print]
mov si,offset typesof
mov ah,13
int 47h
mov di,offset types mov di,offset types
mov bx,7 mov bx,7
mov al,pcitype mov al,pcitype
@ -61,89 +36,50 @@ vote:
bt ax,bx bt ax,bx
jnc nowas jnc nowas
shl bx,1 shl bx,1
mov si,[di+bx] push word ptr [di+bx]
mov ah,13 call [print]
int 47h
mov si,offset spac
mov ah,13
int 47h
shr bx,1 shr bx,1
nowas: nowas:
dec bx dec bx
jns vote jns vote
mov ah,6 push offset return
int 47h call [print]
xor ax,ax xor ax,ax
xor cx,cx xor cx,cx
mov di,offset infos mov si,offset infos
search: search:
mov di,si
call Getallfunctionsinfos call Getallfunctionsinfos
jc stopthis jc stopthis
mov dh,[si+pci.subclass]
mov bp,cx mov dl,[si+pci.class]
push cx di ;sousclasse
mov si,offset msg1 mov di,offset subclasse
mov ah,13
int 47h
mov cx,16
xor edx,edx
mov dx,[di+pci.device]
mov ah,0Ah
int 47h
mov si,offset msg2
mov ah,13
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
mov cl,[di+pci.class]
mov ch,[di+pci.subclass]
mov di,offset temp
call getpciclass
mov si,di
mov ah,13
int 47h
mov si,offset poin
mov ah,13
int 47h
mov di,offset temp
call getpcisubclass call getpcisubclass
mov si,di push di
mov ah,13 ;classe
int 47h mov di,offset classe
mov ah,06 call getpciclass
int 47h push di
pop di cx ;fonction
mov dl,ch
push edx
;device
mov dl,cl
push edx
;bus
mov dl,al
push edx
;device
mov dx,[si+pci.device]
push edx
;vendeur
mov dx,[si+pci.vendor]
push edx
push offset msg2
call [print]
inc ch inc ch
cmp ch,7 cmp ch,7
@ -157,31 +93,24 @@ xor cl,cl
inc al inc al
cmp al,16 cmp al,16
jbe search jbe search
db 0CBh retf
msg3 db ' Classe :',0 msg db "COS2000 hardware detecteur V1.6\lBIOS PCI version %hB.%hB a ete detecte !\lNombre de bus : %u\lCaracterisques PCI: ",0
msg1 db 'Peripherique :',0 msg2 db "Peripherique :%hW Constructeur :%hW Id :%hB.%hB.%hB Classe :%0.%0\l",0
msg2 db ' Constructeur :',0 return db "\l",0
msg4 db ' iD :',0 classe db 128 dup (0)
msg db 'COS2000 hardware detecteur V1.6',0 subclasse db 128 dup (0)
pcivers db 'BIOS PCI version ',0
pcivers2 db ' a ete detecte !',0
nbbuses db 'Nombre de bus : ',0
typesof db 'Caracterisques PCI: ',0
poin db '.',0
virg db ', ',0
spac db ' ',0
temp db 128 dup (0)
types dw config1 types dw config1
dw config2 dw config2
dw poin dw null
dw poin dw null
dw config3 dw config3
dw config4 dw config4
dw poin dw null
dw poin dw null
null db 'indefini',0
config1 db 'Config Mechanism 1',0 config1 db 'Config Mechanism 1',0
config2 db 'Config Mechanism 2',0 config2 db 'Config Mechanism 2',0
config3 db 'Special Cycle Mechanism 1',0 config3 db 'Special Cycle Mechanism 1',0
@ -194,12 +123,12 @@ infos db 256 dup (0)
;fonction 0-7 bus 0-255 device 0-31 ;fonction 0-7 bus 0-255 device 0-31
;renvoie en es:di de classe cl ;renvoie en es:di de classe dl
getpciclass: getpciclass:
push ax cx si di ds es push ax cx dx si di ds es
push es push es
push di push di
mov di,cx mov di,dx
and di,0FFh and di,0FFh
shl di,1 shl di,1
mov di,[offset classes+di] mov di,[offset classes+di]
@ -217,27 +146,27 @@ pop ds
pop di pop di
pop es pop es
rep movsb rep movsb
pop es ds di si cx ax pop es ds di si dx cx ax
ret ret
;renvoie en es:di la sous-classe de ch et de classe cl ;renvoie en es:di la sous-classe de dh et de classe dl
getpcisubclass: getpcisubclass:
push ax cx si di ds es push ax cx dx si di ds es
push es push es
push di push di
mov di,cx mov di,dx
and di,0FFh and di,0FFh
shl di,1 shl di,1
mov di,[offset classesd+di] mov di,[offset classesd+di]
xchg ch,cl xchg dh,dl
xor ch,ch xor dh,dh
cmp cx,80h cmp dx,80h
jne suiteac jne suiteac
mov di,offset divers mov di,offset divers
jmp found jmp found
suiteac: suiteac:
shl cx,1 shl dx,1
add di,cx add di,dx
mov di,[di] mov di,[di]
found: found:
mov cx,0FFh mov cx,0FFh
@ -254,7 +183,7 @@ pop ds
pop di pop di
pop es pop es
rep movsb rep movsb
pop es ds di si cx ax pop es ds di si dx cx ax
ret ret
divers db 'divers',0 divers db 'divers',0
@ -539,4 +468,9 @@ pci_type2_detect:
endofdetectiontype2: endofdetectiontype2:
ret ret
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start

View File

@ -9,81 +9,73 @@ include ..\include\mem.h
include ..\include\divers.h include ..\include\divers.h
start: start:
mov si,offset msg header exe <,1,0,,,offset imports,,>
mov ah,13
int 47h realstart:
mov ah,6 push offset msg
int 47h call [print]
mov si,offset menu
mov ah,13
int 47h
mov ah,6
int 47h
xor cx,cx xor cx,cx
listmcb: listmcb:
mov ah,4 mov ah,4
int 49h int 49h
jc fino jc fino
inc cx inc cx
mov ah,18h
int 47h ;placement mémoire
push gs
pop ds
mov bh,0
mov si,MB.Names
mov ah,14h
int 47h
mov bh,15
xor edx,edx
mov dx,ds:[MB.Sizes]
shl edx,4
mov ah,0Fh
int 47h
mov bh,24
cmp ds:[MB.IsResident],true
push cs
pop ds
jne notresident
mov si,offset resident
mov ah,14h
int 47h
jmp suitelistmcb
notresident:
mov si,offset nonresident
mov ah,14h
int 47h
suitelistmcb:
mov bh,30
cmp gs:[MB.Reference],0
je next
cmp gs:[MB.Reference],1000h
jb next
mov ax,gs:[MB.Reference]
dec ax
dec ax
mov ds,ax
mov si,MB.Names
mov ah,14h
int 47h
next:
mov bh,46
xor edx,edx
mov dx,gs mov dx,gs
inc dx inc dx
inc dx inc dx
push cx push edx
mov cx,16
mov ah,11h ;parent
int 47h cmp gs:[MB.Reference],0
pop cx je next
mov ah,6h mov dx,gs:[MB.Reference]
int 47h dec dx
dec dx
push dx
push offset MB.Names
jmp suitemn
next:
push cs
push offset none
suitemn:
;Resident
cmp gs:[MB.IsResident],true
jne notresident
push offset resident
jmp suitelistmcb
notresident:
push offset nonresident
suitelistmcb:
;taille memoire
xor edx,edx
mov dx,gs:[MB.Sizes]
shl edx,4
push 6
push edx
;nom
push gs
push offset MB.Names
push offset line
call [print]
jmp listmcb jmp listmcb
fino: fino:
db 0CBh db 0CBh
resident db 'oui',0 resident db "oui",0
nonresident db 'non',0 nonresident db "non",0
msg db 'Memory manager V1.5',0 line db "%0P\h15%w\h24%0\h30%0P\h46%hW\l",0
menu db 'Nom | Taille | Res | Parent | Mem',0 msg db "Memory manager V1.5\lNom Taille Res Parent Mem\l",0
none db ".",0
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start

View File

@ -5,13 +5,23 @@ smart
org 0h org 0h
include ..\include\mem.h
start: start:
mov si,offset message header exe <,1,0,,,offset imports,,>
mov ah,13
int 47h realstart:
mov ah,2 mov ah,2
int 74h int 74h
db 0CBh push offset message
call [print]
retf
message db 'Activation de la souris',0 message db 'Activation de la souris',0
imports:
db "VIDEO.LIB::print",0
print dd 0
dw 0
end start end start