drivers/disk: Add disk_create_index() workaround for optical drive on VMware/BIOS

This commit is contained in:
Mintsuki
2026-04-04 14:37:09 +02:00
parent 4034c13379
commit 3b7c85ff71

View File

@@ -266,6 +266,13 @@ void disk_create_index(void) {
bool is_atapi = (dpte != NULL && (dpte->flags & (1 << 6)));
block->is_optical = is_atapi || (block->sector_size == 2048 && is_removable);
// Ugly workaround for VMware, because it puts the optical drive at 0x9f but does
// not expose DPTE.
if (drive == 0x9f && block->sector_size == 2048) {
is_removable = true;
block->is_optical = true;
}
if (!is_removable && !block->is_optical) {
if (consumed_bda_disks == bda_disk_count) {
pmm_free(block, sizeof(struct volume));