From: Alan Cox Date: Mon, 22 Dec 2014 11:51:15 +0000 (+0000) Subject: trs80: Set a 2ms seek time on the hard disk X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=15f1cd8c55fd53ade1f249f7d93b3163f3b9749b;p=FUZIX.git trs80: Set a 2ms seek time on the hard disk --- diff --git a/Kernel/platform-trs80/devhd.c b/Kernel/platform-trs80/devhd.c index b1868008..aa9c1966 100644 --- a/Kernel/platform-trs80/devhd.c +++ b/Kernel/platform-trs80/devhd.c @@ -28,6 +28,8 @@ __sfr __at 0xCF hd_cmd; #define HDCMD_INIT 0x60 /* Ditto */ #define HDCMD_SEEK 0x70 +#define RATE_2MS 0x04 /* 2ms step rate for hd (conservative) */ + #define HDCTRL_SOFTRESET 0x10 #define HDCTRL_ENABLE 0x08 #define HDCTRL_WAITENABLE 0x04 @@ -178,7 +180,12 @@ int hd_open(uint8_t minor, uint16_t flag) udata.u_error = ENODEV; return -1; } - + hd_sdh = 0xA0 | (minor << 3); + hd_cmd = HDCMD_RESTORE | RATE_2MS; + if (hd_waitready() & 1) { + if ((hd_err & 0x12) == 0x12) + return -ENODEV; + } return 0; }