From b4d0aca25a59006b365a4c73552c04a96be362f1 Mon Sep 17 00:00:00 2001 From: Brian Palmer Date: Tue, 15 Apr 2003 02:15:54 +0000 Subject: [PATCH] Changes in v1.8.6 (4/14/2003) (brianp) - Fixed a bug in fathelp.asm where is wasn't adding the hidden sector count before performing a subtraction. svn path=/trunk/; revision=4539 --- freeldr/freeldr/CHANGELOG | 5 +++++ freeldr/freeldr/arch/i386/fathelp.asm | 32 ++++++++++++++------------- freeldr/freeldr/include/version.h | 4 ++-- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/freeldr/freeldr/CHANGELOG b/freeldr/freeldr/CHANGELOG index 573f64bd025..571a9744525 100644 --- a/freeldr/freeldr/CHANGELOG +++ b/freeldr/freeldr/CHANGELOG @@ -1,3 +1,8 @@ +Changes in v1.8.6 (4/14/2003) (brianp) + +- Fixed a bug in fathelp.asm where is wasn't adding the hidden sector + count before performing a subtraction. + Changes in v1.8.5 (4/10/2003) (ekohl) - Added support for binary system hive. diff --git a/freeldr/freeldr/arch/i386/fathelp.asm b/freeldr/freeldr/arch/i386/fathelp.asm index 9aedb925046..d3e09ee13b5 100644 --- a/freeldr/freeldr/arch/i386/fathelp.asm +++ b/freeldr/freeldr/arch/i386/fathelp.asm @@ -1,6 +1,6 @@ ; FATHELP.ASM ; FAT12/16 Boot Sector Helper Code -; Copyright (c) 1998, 2001, 2002 Brian Palmer +; Copyright (c) 1998, 2001, 2002, 2003 Brian Palmer @@ -195,28 +195,30 @@ GetFatEntry12_Done: ; Otherwise CF = 0 for FAT16 IsFat12: - mov bx,[BYTE bp-DataAreaStartLow] - mov cx,[BYTE bp-DataAreaStartHigh] - ; CX:BX now has the number of the starting sector of the data area + mov ebx,DWORD [BYTE bp-DataAreaStartLow] + ; EBX now has the number of the starting sector of the data area + ; starting from the beginning of the disk, so subtrace hidden sectors + sub ebx,DWORD [BYTE bp+HiddenSectors] - xor dx,dx + + xor eax,eax mov ax,WORD [BYTE bp+TotalSectors] cmp ax,byte 0 jnz IsFat12_2 - mov ax,WORD [BYTE bp+TotalSectorsBig] - mov dx,WORD [BYTE bp+TotalSectorsBig+2] + mov eax,DWORD [BYTE bp+TotalSectorsBig] + + ; EAX now contains the number of sectors on the volume - ; DX:AX now contains the number of sectors on the volume IsFat12_2: - sub ax,bx ; Subtract data area start sector - sub dx,cx ; from total sectors of volume + sub eax,ebx ; Subtract data area start sector + xor edx,edx ; from total sectors of volume - ; DX:AX now contains the number of data sectors on the volume - movzx bx,BYTE [BYTE bp+SectsPerCluster] - div bx - ; AX now has the number of clusters on the volume + ; EDX:EAX now contains the number of data sectors on the volume + movzx ebx,BYTE [BYTE bp+SectsPerCluster] + div ebx + ; EAX now has the number of clusters on the volume stc - cmp ax,4085 + cmp eax,4085 jb IsFat12_Done clc diff --git a/freeldr/freeldr/include/version.h b/freeldr/freeldr/include/version.h index 6f268219128..3df9f4e5d5e 100644 --- a/freeldr/freeldr/include/version.h +++ b/freeldr/freeldr/include/version.h @@ -22,7 +22,7 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.8.5" +#define VERSION "FreeLoader v1.8.6" #define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer " #define AUTHOR_EMAIL "" #define BY_AUTHOR "by Brian Palmer" @@ -36,7 +36,7 @@ // #define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MINOR_VERSION 8 -#define FREELOADER_PATCH_VERSION 5 +#define FREELOADER_PATCH_VERSION 6 PUCHAR GetFreeLoaderVersionString(VOID);