From 7760347efd4435de4424e63b7a36c544ff73ea95 Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Tue, 12 Sep 2023 17:29:45 -0700 Subject: [PATCH] [kernel] Disable track caching for hard drives --- elks/arch/i86/drivers/block/bioshd.c | 8 +++++--- elks/init/main.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/elks/arch/i86/drivers/block/bioshd.c b/elks/arch/i86/drivers/block/bioshd.c index 69656922b..8efe57b3c 100644 --- a/elks/arch/i86/drivers/block/bioshd.c +++ b/elks/arch/i86/drivers/block/bioshd.c @@ -722,10 +722,12 @@ static void do_bioshd_request(void) buf = req->rq_buffer; while (count > 0) { - int num_sectors; + int num_sectors = 0; #ifdef CONFIG_TRACK_CACHE - /* first try reading track cache*/ - num_sectors = do_cache_read(drivep, start, buf, req->rq_seg, req->rq_cmd); + if (drivep - drive_info >= DRIVE_FD0) { + /* first try reading track cache*/ + num_sectors = do_cache_read(drivep, start, buf, req->rq_seg, req->rq_cmd); + } if (!num_sectors) #endif /* then fallback with retries if required*/ diff --git a/elks/init/main.c b/elks/init/main.c index 8fbda79af..13b76369d 100644 --- a/elks/init/main.c +++ b/elks/init/main.c @@ -180,7 +180,7 @@ static void INITPROC kernel_banner(seg_t start, seg_t end, seg_t init, seg_t ext #endif printk("syscaps %x, %uK base ram\n", sys_caps, SETUP_MEM_KBYTES); - printk("ELKS kernel %s (%u text, %u ftext, %u data, %u bss, %u heap)\n", + printk("ELKS %s (%u text, %u ftext, %u data, %u bss, %u heap)\n", system_utsname.release, (unsigned)_endtext, (unsigned)_endftext, (unsigned)_enddata, (unsigned)_endbss - (unsigned)_enddata, heapsize);