:: commit b80fb3674497f4539c19a64d39fc396fb73db4b0

mintsuki <mintsuki@protonmail.com> — 2022-02-09 11:45

parents: bcf01fa39a

misc: Misc Hyper-V related fixes. Closes #150

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
 
tab: 248 wrap: offon