From 065e555012bce264b0359da515f8dacbb1d405ae Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Fri, 8 Nov 2024 17:21:19 -0800 Subject: [PATCH] [directfd] Disable track/cylinder cache on 32-bit CPUs --- elks/arch/i86/boot/setup.S | 2 +- elks/arch/i86/drivers/block/directfd.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/elks/arch/i86/boot/setup.S b/elks/arch/i86/boot/setup.S index 93004ec04..dbcde606b 100644 --- a/elks/arch/i86/boot/setup.S +++ b/elks/arch/i86/boot/setup.S @@ -51,7 +51,7 @@ ! 4 = 80188 ! 5 = 80186 ! 6 = 80286 -! 7 = 80386 +! 7 = 32-bit CPU (80386+) ! 8 = 80486 UNUSED ! 9 = Pentium UNUSED ! 10 = Pentium PRO UNUSED diff --git a/elks/arch/i86/drivers/block/directfd.c b/elks/arch/i86/drivers/block/directfd.c index 30fed9a16..5d860b9e5 100644 --- a/elks/arch/i86/drivers/block/directfd.c +++ b/elks/arch/i86/drivers/block/directfd.c @@ -1203,7 +1203,8 @@ static void DFPROC redo_fd_request(void) startsector = sector; numsectors = req->rq_nr_sectors; #ifdef CONFIG_TRACK_CACHE - use_cache = (command == FD_READ) && (req->rq_errors < 4); + use_cache = (command == FD_READ) && (req->rq_errors < 4) + && (SETUP_CPU_TYPE != 7 || running_qemu); /* disable cache on 32-bit systems */ if (use_cache) { /* full track caching only if cache large enough */ if (CACHE_FULL_TRACK && floppy->sect < CACHE_SIZE)