From f47656fd8844b0a5a503cfecf3713f81d7ecca06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Fri, 5 Nov 2004 00:57:03 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20modification=20de=20la=20fonction=20veri?= =?UTF-8?q?fsector=20qui=20pr=C3=A9sentait=20de=20nombreux=20bogues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noyau/disque.asm | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/noyau/disque.asm b/noyau/disque.asm index ef7d524..850948f 100644 --- a/noyau/disque.asm +++ b/noyau/disque.asm @@ -168,16 +168,10 @@ execfile: push bp dx mov bp,sp mov dx,ss:[bp+10] - mov ah,0Ah - mov cx,16 - int 47h pushad push ds es fs gs call projfile jc reallyerror - mov ah,0Ah - mov cx,16 - int 47h push es pop gs mov ah,6 @@ -749,10 +743,9 @@ lastoff dw 0 ;===================================================== WriteSector: push ax bx cx dx si es - cmp cs:Lastread,cx - jne nodestruct - mov cs:Lastread,0ffffh -nodestruct: + mov cs:lastseg,0 + mov cs:lastoff,0 + mov cs:LastRead,0FFFFh push ds pop es mov ax,cx @@ -768,7 +761,7 @@ nodestruct: xchg cl,ch shl cl,6 or cl, bl - mov bx,si + mov bx,si mov SI, 4 mov AL,1 TryAgains: @@ -817,25 +810,30 @@ getserial: ;<- Flag Carry si erreur, Flag Equal si secteurs égaux ;===================================================== VerifySector: - push bx cx si di ds es + push ecx si di ds es push cs pop es push cs pop ds - mov bx,offset bufferread - call ReadSector - jc errorverify + mov di,offset bufferread + call ReadSector + mov si,offset bufferread call inverse call WriteSector jc errorverify - mov bx,offset bufferwrite - call ReadSector + + mov di,offset bufferwrite + call ReadSector + mov si,offset bufferwrite call inverse jc errorverify - mov bx,offset bufferread + + mov si,offset bufferread call inverse call WriteSector jc errorverify + + xor ecx,ecx mov cx,cs:myboot.SectorSize shr cx,2 mov si,offset bufferread @@ -843,18 +841,19 @@ VerifySector: cld rep cmpsd errorverify: - pop es ds di si cx bx + pop es ds di si ecx ret Inverse: - mov si,cs:myboot.sectorsize - shr si,2 + push si cx + xor cx,cx invert: - shl si,2 - not dword ptr [bx+si-4] - shr si,2 - dec si - jnz invert + not dword ptr [si] + add si,4 + add cx,4 + cmp cx,cs:myboot.sectorsize + jbe invert + pop cx si ret VerifySector2: @@ -889,6 +888,7 @@ decompression: mov cl,ah xor ah,ah xor ch,ch + cld rep stosb add si,5 sub dx,5