summaryrefslogtreecommitdiff
path: root/Kernel/BlkDev
diff options
context:
space:
mode:
authorHarley Travis <harleytravis123@outlook.com>2026-06-04 23:36:37 -0500
committerHarley Travis <harleytravis123@outlook.com>2026-06-04 23:36:37 -0500
commit82db93b2732e88cb76f0506e549f5549b8750bc6 (patch)
tree2eb8b304948e03dfb51b0650293e119f00c6d3e4 /Kernel/BlkDev
parent5e53c1971116cbc78082575fd52da3fa77615a90 (diff)
downloadtempleos-floppy-driver-82db93b2732e88cb76f0506e549f5549b8750bc6.tar.gz
Update DskFDC.HC
I moved the version check into the drive-0-only code; it wouldn't make sense to check the version each time a drive gets initialized.
Diffstat (limited to 'Kernel/BlkDev')
-rw-r--r--Kernel/BlkDev/DskFDC.HC17
1 files changed, 9 insertions, 8 deletions
diff --git a/Kernel/BlkDev/DskFDC.HC b/Kernel/BlkDev/DskFDC.HC
index c7ea0e3..5b5105d 100644
--- a/Kernel/BlkDev/DskFDC.HC
+++ b/Kernel/BlkDev/DskFDC.HC
@@ -176,21 +176,22 @@ U0 FDCSelDrv(CBlkDev *bd)
Bool FDCInit(CBlkDev *bd)
{
- // Initialize the FDC assigned to this blkdev
+ // Recalibrate the drive and (on the first drive) initialize the FDC
U8 ver,st0,pcn;
Bool unlock=BlkDevLock(bd),okay=FALSE;
- // Check if the controller is 82077AA-compatible
- FDCSendByte(bd,FDC_VERSION);
- ver=FDCReadByte(bd);
+ // If this drv is unit 0, do initialization
+ if (!bd->unit) {
+ // Check if the controller is 82077AA-compatible
+ FDCSendByte(bd,FDC_VERSION);
+ ver=FDCReadByte(bd);
- if (ver==0x90)
- okay=TRUE;
+ if (ver==0x90)
+ okay=TRUE;
- // If this drv is unit 0, do a reset
- if (!bd->unit)
FDCReset(bd);
+ }
recalibrate:
// Recalibrate this drive