From b80fb3674497f4539c19a64d39fc396fb73db4b0 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Wed, 9 Feb 2022 12:45:55 +0100 Subject: [PATCH] misc: Misc Hyper-V related fixes. Closes #150 --- common/drivers/disk.s2.c | 2 +- common/entry.s2.c | 10 +++++++--- test/limine.cfg | 1 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/drivers/disk.s2.c b/common/drivers/disk.s2.c index 4ddd70c9..b07a2b4c 100644 --- a/common/drivers/disk.s2.c +++ b/common/drivers/disk.s2.c @@ -151,7 +151,7 @@ void disk_create_index(void) { if (r.eflags & EFLAGS_CF) continue; - if (drive_params.lba_count == 0 || drive_params.bytes_per_sect == 0) + if (drive_params.bytes_per_sect == 0) continue; struct volume *block = ext_mem_alloc(sizeof(struct volume)); diff --git a/common/entry.s2.c b/common/entry.s2.c index 46c1dfbf..52e01d4b 100644 --- a/common/entry.s2.c +++ b/common/entry.s2.c @@ -70,9 +70,9 @@ static bool stage3_init(struct volume *part) { } enum { - BOOTED_FROM_HDD, - BOOTED_FROM_PXE, - BOOTED_FROM_CD + BOOTED_FROM_HDD = 0, + BOOTED_FROM_PXE = 1, + BOOTED_FROM_CD = 2 }; noreturn void entry(uint8_t boot_drive, int boot_from) { @@ -101,6 +101,10 @@ noreturn void entry(uint8_t boot_drive, int boot_from) { boot_volume = pxe_bind_volume(); } + if (boot_volume == NULL) { + panic(false, "Could not determine boot drive\n"); + } + volume_iterate_parts(boot_volume, if (stage3_init(_PART)) { break; diff --git a/test/limine.cfg b/test/limine.cfg index ee3e93ff..dc340159 100644 --- a/test/limine.cfg +++ b/test/limine.cfg @@ -11,7 +11,6 @@ THEME_BACKGROUND=50000000 BACKGROUND_PATH=${BACKGROUND_PATH} BACKGROUND_STYLE=stretched BACKDROP_COLOUR=008080 -SERIAL=yes :Stivale2 Test