Merge tag '1.0.1' into develop

Merge avec develop 1.0.1
This commit is contained in:
Nicolas Hordé 2004-06-12 21:34:04 +00:00
commit 7e71c486c1
2 changed files with 166 additions and 233 deletions

View File

@ -14,13 +14,12 @@ Message db 0Dh,0Ah,'COS 2000 V3.02Fr programme d''installation',0Dh,0AH,'Inserez
Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$' Message2 db 0Dh,0AH,'Creation du secteur de demarrage...',0Dh,0Ah,'$'
Message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$' Message3 db 0Dh,0AH,'Copie des fichiers systeme...',0Dh,0Ah,'$'
Errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$' Errormsg db 0Dh,0AH,'Erreur d''installation, contactez moi a COS2000@MULTIMANIA.COM !',0Dh,0AH,'$'
Ok db 0Dh,0AH,'COS2000 a été correctement installé, veuillez redemarrer votre PC',0Dh,0AH,'$' Ok db 0Dh,0AH,'COS2000 a ete correctement installe, veuillez redemarrer votre PC',0Dh,0AH,'$'
files db '*.*',0 files db '*.*',0
boot db 'boot.bin',0 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
@ -97,11 +96,7 @@ allfile:
mov ah,3ch mov ah,3ch
push cs push cs
pop es pop es
mov si,offset dta+30-3 mov di,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
@ -134,7 +129,7 @@ allfile:
push fs push fs
pop ds pop ds
mov ah,3fh mov ah,3fh
mov cx,000FFh mov cx,0FFFFh
xor dx,dx xor dx,dx
int 21h int 21h
push cs push cs

View File

@ -8,42 +8,52 @@ 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
call showstring0 mov ah,13
call line int 47h
mov ah,6
int 47h
mov si,offset pcivers mov si,offset pcivers
call showstring0 mov ah,13
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
call showhex mov ah,0Ah
int 47h
mov si,offset poin mov si,offset poin
call showstring0 mov ah,13
int 47h
shr dx,8 shr dx,8
call showhex mov ah,0Ah
int 47h
mov si,offset pcivers2 mov si,offset pcivers2
call showstring0 mov ah,13
call line int 47h
mov ah,6
int 47h
mov si,offset nbbuses mov si,offset nbbuses
call showstring0 mov ah,13
int 47h
xor edx,edx xor edx,edx
mov dl,nbbus mov dl,nbbus
inc dl inc dl
call showint mov ah,08
call line int 47h
mov ah,06
int 47h
mov si,offset typesof mov si,offset typesof
call showstring0 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
@ -52,14 +62,17 @@ bt ax,bx
jnc nowas jnc nowas
shl bx,1 shl bx,1
mov si,[di+bx] mov si,[di+bx]
call showstring0 mov ah,13
int 47h
mov si,offset spac mov si,offset spac
call showstring0 mov ah,13
int 47h
shr bx,1 shr bx,1
nowas: nowas:
dec bx dec bx
jns vote jns vote
call line mov ah,6
int 47h
xor ax,ax xor ax,ax
xor cx,cx xor cx,cx
@ -68,36 +81,70 @@ search:
call Getallfunctionsinfos call Getallfunctionsinfos
jc stopthis jc stopthis
mov bp,cx
push cx di push cx di
mov si,offset msg1 mov si,offset msg1
call showstring0 mov ah,13
int 47h
mov cx,16 mov cx,16
xor edx,edx xor edx,edx
mov dx,[di+pci.device] mov dx,[di+pci.device]
call showhex mov ah,0Ah
int 47h
mov si,offset msg2 mov si,offset msg2
call showstring0 mov ah,13
int 47h
mov dx,[di+pci.vendor] mov dx,[di+pci.vendor]
call showhex 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 si,offset msg3
call showstring0 mov ah,13
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
call showstring0 mov ah,13
int 47h
mov si,offset poin mov si,offset poin
call showstring0 mov ah,13
int 47h
mov di,offset temp mov di,offset temp
call getpcisubclass call getpcisubclass
mov si,di mov si,di
call showstring0 mov ah,13
call line int 47h
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
@ -110,11 +157,14 @@ xor cl,cl
inc al inc al
cmp al,16 cmp al,16
jbe search jbe search
ret xor ax,ax
int 16h
db 0CBh
msg3 db ' Classe:',0 msg3 db ' Classe :',0
msg1 db 'Peripherique :',0 msg1 db 'Peripherique :',0
msg2 db ' Constructeur :',0 msg2 db ' Constructeur :',0
msg4 db ' iD :',0
msg db 'COS2000 hardware detecteur V1.1',0 msg db 'COS2000 hardware detecteur V1.1',0
pcivers db 'BIOS PCI version ',0 pcivers db 'BIOS PCI version ',0
pcivers2 db ' a ete detecte !',0 pcivers2 db ' a ete detecte !',0
@ -308,7 +358,7 @@ dw offset subclass67
subclass60 db 'hote',0 subclass60 db 'hote',0
subclass61 db 'isa',0 subclass61 db 'isa',0
subclass62 db 'eisa',0 subclass62 db 'eisa',0
subclass63 db 'mc',0 subclass63 db 'mca',0
subclass64 db 'pci',0 subclass64 db 'pci',0
subclass65 db 'pcmcia',0 subclass65 db 'pcmcia',0
subclass66 db 'nubus',0 subclass66 db 'nubus',0
@ -324,9 +374,9 @@ class8d:
dw offset subclass80 dw offset subclass80
dw offset subclass81 dw offset subclass81
dw offset subclass82 dw offset subclass82
subclass80 db 'pic 8259a',0 subclass80 db 'pic',0
subclass81 db 'dma 8237',0 subclass81 db 'dma',0
subclass82 db 'tim 8254',0 subclass82 db 'timer',0
class9d: class9d:
dw offset subclass90 dw offset subclass90
@ -357,10 +407,12 @@ dw offset subclass120
dw offset subclass121 dw offset subclass121
dw offset subclass122 dw offset subclass122
dw offset subclass123 dw offset subclass123
dw offset subclass124
subclass120 db 'firewire',0 subclass120 db 'firewire',0
subclass121 db 'access',0 subclass121 db 'access',0
subclass122 db 'ssa',0 subclass122 db 'ssa',0
subclass123 db 'usb',0 subclass123 db 'usb',0
subclass124 db 'smbus',0
;bx pci version, cl nbbus, al pci type ;bx pci version, cl nbbus, al pci type
getPciInfos: getPciInfos:
@ -380,29 +432,22 @@ errorpci:
pop dx pop dx
ret 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 ;al=bus cl=deviceid ch=func es:di
Getallfunctionsinfos: Getallfunctionsinfos:
push ax bx dx di 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 xor bl,bl
goinfos: goinfos:
call getfunctioninfo call getfunctioninfo
@ -427,180 +472,73 @@ notexist:
stc stc
pop di dx bx ax pop di dx bx ax
ret ret
; PCI TYPE 1
;*******************************************************************
config1_addr equ 0CF8h
config1_data equ 0CFCh
;=============CLEAR========= pci_type1_detect:
;Efface l'ecran texte mov dx, config1_addr+3
;-> mov al, 01h
;<- out dx,al
;============================= mov dx,config1_addr
cleartext: in eax,dx
push es eax cx di mov ecx,eax
xor di,di mov eax,80000000h
mov ax,0b800h out dx,eax
mov es,ax in eax,dx
mov eax,07200720h cmp eax,80000000h
mov cx,cs:pagesize jne endofdetectiontype1
shr cx,2 mov eax,ecx
cld out dx,eax
rep stosd endofdetectiontype1:
mov cs:xy,0 ret
mov cs:x,0
mov cs:y,0 ;al=bus bl=index cl=deviceid ch=func->dl
pop di cx eax es getfunctioninfo:
ret 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
;==========LINE========= ; PCI TYPE 2
;remet le curseur a la ligne ;*******************************************************************
;-> config2_reg0 equ 0CFBh
;<- config2_reg1 equ 0CF8h
;============================= config2_reg2 equ 0CFAh
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========= pci_type2_detect:
;Change les coordonnées du curseur a X:AH,Y:AL xor ax,ax
;-> AX mov dx,config2_reg0
;<- es di out dx,ax
;============================= mov dx,config2_reg1
setxy: out dx,ax
push ax bx dx mov dx,config2_reg2
mov cs:x,bh out dx,ax
mov cs:y,bl mov ax,config2_reg1
mov al,bl in al,dx
mov bl,bh cmp al,0
xor bh,bh jne endofdetectiontype2
mov di,bx mov ax,config2_reg0
mul cs:columns in al,dx
add di,ax cmp al,0
shl di,1 jne endofdetectiontype2
mov cs:xy,di endofdetectiontype2:
mov ax,0B800h ret
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