From e497c1d7f466635b35c6ef6517525a1310bff8e4 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 22 Aug 2021 17:20:22 +0200 Subject: [PATCH] disk: Fix bugs introduced by previous commit --- stage23/drivers/disk.s2.c | 6 +++--- stage23/lib/part.s2.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stage23/drivers/disk.s2.c b/stage23/drivers/disk.s2.c index 29407211..4a199385 100644 --- a/stage23/drivers/disk.s2.c +++ b/stage23/drivers/disk.s2.c @@ -433,13 +433,13 @@ void disk_create_index(void) { block->sect_count = drive->Media->LastBlock + 1; block->max_partition = -1; + // TODO: get fastest xfer size also for UEFI? + block->fastest_xfer_size = 8; + if (gpt_get_guid(&block->guid, block)) { block->guid_valid = true; } - // TODO: get fastest xfer size also for UEFI? - block->fastest_xfer_size = 8; - volume_index[volume_index_i++] = block; for (int part = 0; ; part++) { diff --git a/stage23/lib/part.s2.c b/stage23/lib/part.s2.c index 23e346cf..b207f0ab 100644 --- a/stage23/lib/part.s2.c +++ b/stage23/lib/part.s2.c @@ -152,8 +152,8 @@ static int gpt_get_part(struct volume *ret, struct volume *volume, int partition ret->efi_handle = volume->efi_handle; #elif bios == 1 ret->drive = volume->drive; - ret->fastest_xfer_size = volume->fastest_xfer_size; #endif + ret->fastest_xfer_size = volume->fastest_xfer_size; ret->index = volume->index; ret->is_optical = volume->is_optical; ret->partition = partition + 1; @@ -213,8 +213,8 @@ static int mbr_get_logical_part(struct volume *ret, struct volume *extended_part ret->efi_handle = extended_part->efi_handle; #elif bios == 1 ret->drive = extended_part->drive; - ret->fastest_xfer_size = extended_part->fastest_xfer_size; #endif + ret->fastest_xfer_size = extended_part->fastest_xfer_size; ret->index = extended_part->index; ret->is_optical = extended_part->is_optical; ret->partition = partition + 4 + 1; @@ -292,8 +292,8 @@ static int mbr_get_part(struct volume *ret, struct volume *volume, int partition extended_part.efi_handle = volume->efi_handle; #elif bios == 1 extended_part.drive = volume->drive; - extended_part.fastest_xfer_size = volume->fastest_xfer_size; #endif + extended_part.fastest_xfer_size = volume->fastest_xfer_size; extended_part.index = volume->index; extended_part.is_optical = volume->is_optical; extended_part.partition = i + 1; @@ -319,8 +319,8 @@ static int mbr_get_part(struct volume *ret, struct volume *volume, int partition ret->efi_handle = volume->efi_handle; #elif bios == 1 ret->drive = volume->drive; - ret->fastest_xfer_size = volume->fastest_xfer_size; #endif + ret->fastest_xfer_size = volume->fastest_xfer_size; ret->index = volume->index; ret->is_optical = volume->is_optical; ret->partition = partition + 1;