diff --git a/elks/arch/i86/drivers/block/directfd.c b/elks/arch/i86/drivers/block/directfd.c index ead1b4679..c77d16d36 100644 --- a/elks/arch/i86/drivers/block/directfd.c +++ b/elks/arch/i86/drivers/block/directfd.c @@ -117,7 +117,7 @@ */ #define USE_IMPLIED_SEEK 0 /* =1 for QEMU with 360k/AT stretch floppies (not real hw) */ -#define CHECK_DIR_REG 0 /* =1 to read and clear DIR DSKCHG when media changed */ +#define CHECK_DIR_REG 1 /* =1 to read and clear DIR DSKCHG when media changed */ #define CHECK_DISK_CHANGE 1 /* =1 to inform kernel of media changed */ //#define DEBUG printk @@ -1084,11 +1084,14 @@ static void DFPROC floppy_ready(void) || (fdc_version >= FDC_TYPE_8272PC_AT && (inb(FD_DIR) & 0x80)) #endif ) { - /* this will discard any queued I/O immediately */ - changed_floppies |= 1 << current_drive; - - printk("df%d: Disk media change detected, suspending I/O\n", current_drive); - current_type[current_drive] = NULL; /* comment out to keep last media format */ + /* first time through the FDC requires recalibrate in order to clear DIR, + * so just recalibrate instead of starting to discard I/O in that case. + */ + if (current_type[current_drive]) { + changed_floppies |= 1 << current_drive; /* this will discard any queued I/O */ + printk("df%d: Disk media change detected, suspending I/O\n", current_drive); + current_type[current_drive] = NULL; /* comment out to keep last media format */ + } if (current_drive == buffer_drive) buffer_track = -1; diff --git a/elks/arch/i86/drivers/char/ntty.c b/elks/arch/i86/drivers/char/ntty.c index 153046e95..0d7f096fd 100644 --- a/elks/arch/i86/drivers/char/ntty.c +++ b/elks/arch/i86/drivers/char/ntty.c @@ -82,7 +82,6 @@ int tty_intcheck(register struct tty *ttyp, unsigned char key) kill_pg(ttyp->pgrp, sig, 1); } } - (void) check_disk_change(0); /* check any floppy media changed */ return sig; }