Skip to content

Commit

Permalink
[FREELDR] Support drives with 4k sector size
Browse files Browse the repository at this point in the history
  • Loading branch information
alula authored and DarkFire01 committed Oct 1, 2023
1 parent 00bd507 commit 3ee2c78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion boot/freeldr/freeldr/arch/uefi/uefidisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ UefiSetupBlockDevices(VOID)
if (EFI_ERROR(Status) ||
bio == NULL ||
bio->Media->BlockSize == 0 ||
bio->Media->BlockSize > 2048)
bio->Media->BlockSize > 4096)
{
TRACE("UefiSetupBlockDevices: UEFI has found a block device that failed, skipping\n");
continue;
Expand Down
6 changes: 3 additions & 3 deletions boot/freeldr/freeldr/lib/fs/fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ BOOLEAN FatReadVolumeSectors(PFAT_VOLUME_INFO Volume, ULONG SectorNumber, ULONG
//
// Seek to right position
//
Position.QuadPart = (ULONGLONG)SectorNumber * 512;
Position.QuadPart = (ULONGLONG)SectorNumber * Volume->BytesPerSector;
Status = ArcSeek(Volume->DeviceId, &Position, SeekAbsolute);
if (Status != ESUCCESS)
{
Expand All @@ -1380,8 +1380,8 @@ BOOLEAN FatReadVolumeSectors(PFAT_VOLUME_INFO Volume, ULONG SectorNumber, ULONG
//
// Read data
//
Status = ArcRead(Volume->DeviceId, Buffer, SectorCount * 512, &Count);
if (Status != ESUCCESS || Count != SectorCount * 512)
Status = ArcRead(Volume->DeviceId, Buffer, SectorCount * Volume->BytesPerSector, &Count);
if (Status != ESUCCESS || Count != SectorCount * Volume->BytesPerSector)
{
TRACE("FatReadVolumeSectors() Failed to read\n");
return FALSE;
Expand Down

0 comments on commit 3ee2c78

Please sign in to comment.