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;
