From 3702060f695a248b29d807fe1ac69d99af0ab26e Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 24 Apr 2021 22:59:03 +0200 Subject: [PATCH] disk: Limit the range of hard drives and optical drives scanned in BIOS --- stage23/drivers/disk.s2.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stage23/drivers/disk.s2.c b/stage23/drivers/disk.s2.c index a5ca3d7f..c20ec9b8 100644 --- a/stage23/drivers/disk.s2.c +++ b/stage23/drivers/disk.s2.c @@ -78,7 +78,12 @@ bool disk_read_sectors(struct volume *volume, void *buf, uint64_t block, size_t void disk_create_index(void) { size_t volume_count = 0; - for (uint8_t drive = 0x80; drive; drive++) { + for (uint8_t drive = 0x80; ; drive++) { + if (drive == 0x90) + drive = 0xe0; + else if (drive == 0xf0) + break; + struct rm_regs r = {0}; struct bios_drive_params drive_params; @@ -132,7 +137,12 @@ void disk_create_index(void) { volume_index = ext_mem_alloc(sizeof(struct volume) * volume_count); - for (uint8_t drive = 0x80; drive; drive++) { + for (uint8_t drive = 0x80; ; drive++) { + if (drive == 0x90) + drive = 0xe0; + else if (drive == 0xf0) + break; + struct rm_regs r = {0}; struct bios_drive_params drive_params;