From e61b3f010d202be7bf13ee156384b50ddd7ae556 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Tue, 2 Apr 2013 14:55:10 +0000 Subject: [PATCH] fix RamdiskDelete+FloppyDelete, they worked incorrectly since their introduction in r171 git-svn-id: svn://kolibrios.org@3442 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/rd.inc | 6 ++++-- kernel/trunk/fs/fat12.inc | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/blkdev/rd.inc b/kernel/trunk/blkdev/rd.inc index 32d7dbfa1e..69ebe5c7f1 100644 --- a/kernel/trunk/blkdev/rd.inc +++ b/kernel/trunk/blkdev/rd.inc @@ -2257,8 +2257,10 @@ fs_RamdiskDelete: jmp .lfndel .lfndone: ; delete FAT chain - test eax, eax - jz .done + cmp eax, 2 + jb .done + cmp eax, 0xFF8 + jae .done lea eax, [RAMDISK_FAT + eax*2] push dword [eax] and word [eax], 0 diff --git a/kernel/trunk/fs/fat12.inc b/kernel/trunk/fs/fat12.inc index 380cd8e4e3..7aabfe83fb 100644 --- a/kernel/trunk/fs/fat12.inc +++ b/kernel/trunk/fs/fat12.inc @@ -2257,15 +2257,17 @@ fs_FloppyDelete: popa ; delete FAT chain pop eax - test eax, eax - jz .done @@: + cmp eax, 2 + jb .done + cmp eax, 0xFF8 + jae .done lea eax, [FLOPPY_FAT + eax*2] push dword [eax] and word [eax], 0 pop eax and eax, 0xFFF - jnz @b + jmp @b .done: call save_flp_fat pop edi