diff --git a/freeldr/CHANGELOG b/freeldr/CHANGELOG new file mode 100644 index 00000000000..fcf7242f819 --- /dev/null +++ b/freeldr/CHANGELOG @@ -0,0 +1,20 @@ +Changes in v1.01 (4/28/2002) + +- Fixed FAT short file name buffer overflow that was causing + some long filenames not to work correctly. + +Changes in v1.0 (4/24/2002) + +- FreeLoader version 1.0! +- Supports booting ReactOS +- Supports booting Linux bzImage kernels +- No initrd support (yet) +- No zImage support (yet) +- No ext2 file system support (yet) +- Supports FAT & ISO-9660 file systems +- Forward slashes '/' as well as backslashes '\' can be used + for path names in FAT & ISO-9600 +- Fixed bug in LBA code where it was only reading one sector + even if you asked for more +- Fixed bug in FAT code, was also present in ISO-9660 code where + it wasn't incrementing the buffer address correctly diff --git a/freeldr/FREELDR.INI b/freeldr/FREELDR.INI index a4bf43d643a..9ef6a20536a 100644 --- a/freeldr/FREELDR.INI +++ b/freeldr/FREELDR.INI @@ -102,7 +102,6 @@ SelectedTextColor=Black SelectedColor=Gray ; Load ReactOS from harddisk (drive C:) -; - does not work on large harddisks [ReactOS (HD)] Name="ReactOS (HardDrive)" BootType=ReactOS @@ -136,10 +135,10 @@ Driver=\reactos\VFATFS.SYS [Linux] Name="Debian Linux 2.2.17" -BootType=Partition +BootType=Linux BootDrive=0 Kernel=/vmlinuz -CommandLine=root=/dev/sdb1 +CommandLine="root=/dev/sdb1" [3« Floppy (A:)] Name="3« Floppy (A:)" diff --git a/freeldr/freeldr/debug.c b/freeldr/freeldr/debug.c index e623a7c57a1..7b51ca6871c 100644 --- a/freeldr/freeldr/debug.c +++ b/freeldr/freeldr/debug.c @@ -27,8 +27,8 @@ //ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | // DPRINT_UI | DPRINT_DISK | DPRINT_CACHE | DPRINT_REACTOS | // DPRINT_LINUX; -ULONG DebugPrintMask = DPRINT_WARNING | /*DPRINT_FILESYSTEM | - DPRINT_CACHE |*/ DPRINT_LINUX; +ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_FILESYSTEM | + /*DPRINT_CACHE |*/ DPRINT_LINUX; //ULONG DebugPrintMask = DPRINT_INIFILE; #define SCREEN 0 diff --git a/freeldr/freeldr/freeldr.h b/freeldr/freeldr/freeldr.h index b8b9529bd4a..5e12af6cdc0 100644 --- a/freeldr/freeldr/freeldr.h +++ b/freeldr/freeldr/freeldr.h @@ -22,11 +22,11 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.0" +#define VERSION "FreeLoader v1.01" #define COPYRIGHT "Copyright (C) 1998-2002 Brian Palmer " #define ROSLDR_MAJOR_VERSION 1 -#define ROSLDR_MINOR_VERSION 0 +#define ROSLDR_MINOR_VERSION 01 #define ROSLDR_PATCH_VERSION 0 #define size_t unsigned int diff --git a/freeldr/freeldr/fs/fat.c b/freeldr/freeldr/fs/fat.c index 88fc00b544a..6d0d28b367a 100644 --- a/freeldr/freeldr/fs/fat.c +++ b/freeldr/freeldr/fs/fat.c @@ -356,8 +356,8 @@ BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, UINT32 EntryCount, P ULONG CurrentEntry; PDIRENTRY DirEntry; PLFN_DIRENTRY LfnDirEntry; - UCHAR LfnNameBuffer[261]; - UCHAR ShortNameBuffer[13]; + UCHAR LfnNameBuffer[265]; + UCHAR ShortNameBuffer[20]; UINT32 StartCluster; DbgPrint((DPRINT_FILESYSTEM, "FatSearchDirectoryBufferForFile() DirectoryBuffer = 0x%x EntryCount = %d FileName = %s\n", DirectoryBuffer, EntryCount, FileName)); @@ -370,6 +370,9 @@ BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, UINT32 EntryCount, P DirEntry = (PDIRENTRY)(DirectoryBuffer + (CurrentEntry * 32) ); LfnDirEntry = (PLFN_DIRENTRY)DirEntry; + //DbgPrint((DPRINT_FILESYSTEM, "Dumping directory entry %d:\n", CurrentEntry)); + //DbgDumpBuffer(DPRINT_FILESYSTEM, DirEntry, sizeof(DIRENTRY)); + // // Check if this is the last file in the directory // If DirEntry[0] == 0x00 then that means all the @@ -468,6 +471,9 @@ BOOL FatSearchDirectoryBufferForFile(PVOID DirectoryBuffer, UINT32 EntryCount, P LfnNameBuffer[12 + (LfnDirEntry->SequenceNumber * 13)] = (UCHAR)LfnDirEntry->Name11_12[1]; } + //DbgPrint((DPRINT_FILESYSTEM, "Dumping long name buffer:\n")); + //DbgDumpBuffer(DPRINT_FILESYSTEM, LfnNameBuffer, 260); + continue; } @@ -707,6 +713,7 @@ void FatParseShortFileName(PUCHAR Buffer, PDIRENTRY DirEntry) ULONG Idx; Idx = 0; + RtlZeroMemory(Buffer, 13); // // Fixup first character @@ -741,11 +748,6 @@ void FatParseShortFileName(PUCHAR Buffer, PDIRENTRY DirEntry) Buffer[Idx++] = (DirEntry->FileName[10] == ' ') ? '\0' : DirEntry->FileName[10]; } - // - // Null-Terminate string - // - Buffer[Idx + 4] = '\0'; - DbgPrint((DPRINT_FILESYSTEM, "FatParseShortFileName() ShortName = %s\n", Buffer)); } diff --git a/freeldr/freeldr/linux.c b/freeldr/freeldr/linux.c index 9d30594a764..71eef492bc5 100644 --- a/freeldr/freeldr/linux.c +++ b/freeldr/freeldr/linux.c @@ -28,6 +28,7 @@ #include "debug.h" #include "mm.h" #include "inifile.h" +#include "oslist.h" // For RemoveQuotes() PLINUX_BOOTSECTOR LinuxBootSector = NULL; PLINUX_SETUPSECTOR LinuxSetupSector = NULL; @@ -176,6 +177,7 @@ BOOL LinuxParseIniSection(PUCHAR OperatingSystemName) // Get the command line if (IniReadSettingByName(SectionId, "CommandLine", LinuxCommandLine, 260)) { + RemoveQuotes(LinuxCommandLine); LinuxCommandLineSize = strlen(LinuxCommandLine) + 1; } diff --git a/freeldr/freeldr/miscboot.c b/freeldr/freeldr/miscboot.c index 019aea3319b..a6623b78881 100644 --- a/freeldr/freeldr/miscboot.c +++ b/freeldr/freeldr/miscboot.c @@ -84,7 +84,6 @@ VOID LoadAndBootBootSector(PUCHAR OperatingSystemName) // Read boot sector if (!ReadFile(FilePointer, 512, &BytesRead, (void*)0x7c00) || (BytesRead != 512)) { - DiskError("Disk read error."); return; }