Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!seismo!nbires!isis!onecom!wldrdg!n0ano From: n0ano@wldrdg.UUCP Newsgroups: comp.os.minix Subject: Zenith 150 Winchester disk fix Message-ID: <131@wldrdg.UUCP> Date: Mon, 13-Apr-87 12:28:28 EST Article-I.D.: wldrdg.131 Posted: Mon Apr 13 12:28:28 1987 Date-Received: Fri, 17-Apr-87 00:22:57 EST Organization: Wildridge Consulting, Boulder, CO Lines: 56 Having recently installed MINIX on my Zenith 150 I discovered that I had a read-only hard disk. When writing, every few blocks would confuse the driver which would try to reset the disk (a very lengthy process) and would frequently not write out the block. After debugging the Zenith BIOS I came up with the following fix which seems to correct the problem. Using this fix I have copied all of the MINIX source to my hard disk and I've recompiled the kernel about a half-dozen times, all with no errors. The fix is a new version of routine `com_out' for the file `kernel/wini.c'. Just replace `com_out' with this one, recompile the kernel and the hard disk should work. Don Dugger Wildridge Consulting ...nbires!onecom!wldrdg!n0ano PRIVATE com_out(mode) int mode; { /* Output the command block to the winchester controller and return status */ register int i = 0; int r; port_out(WIN_DMA, mode); port_out(WIN_SELECT, mode); for (i=0; i<300; i++) { port_in(WIN_STATUS, &r); if (r & 8) break; } if (i == 300) { w_need_reset = TRUE; return(ERR); } lock(); for (i=0; i<6; i++) { for (;;) { port_in(WIN_STATUS, &r); if (r & 1) break; if ((r & 8) == 0) { w_need_reset = TRUE; unlock(); return(ERR); } } if ((r & 0xe) != 0xc) { w_need_reset = TRUE; unlock(); return(ERR); } port_out(WIN_DATA, command[i]); } unlock(); return(OK); }