Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!samsung!aplcen!haven!uvaarpa!mcnc!unccvax!cs00chs From: cs00chs@unccvax.UUCP (charles spell) Newsgroups: comp.os.minix Subject: Compaq Deskpro and portable III patch (v 1.3d) Keywords: at_wini.c printer.c hard,fixed drives Message-ID: <1719@unccvax.UUCP> Date: 12 Nov 89 08:27:42 GMT Organization: Univ. of NC at Charlotte, Charlotte, NC Lines: 109 A few articles back I mentioned a fix for the Compaq Deskpro (originally written to patch the Compaq portable III hard disk controller). I am re-posting it on ast's request. There is only a brief description of how it works in the comment lines below. Read the patch code for details. This article can be obtained via anonymous ftp bugs.nosc.mil(128.49.16.1): cd /pub/Minix/articles; mget 2025* The original article follows this line. It is a shar containing two patches. The follow fixes for a Compaq were previously reported but were not incorporated in the 1.3 update. I suspect the at_wini.c fix may be helpful to other troublesome hardware as well. ----cut here---------------cut here---------------------cut here------------- #!/bin/sh # This is a shell archive (shar). # Here are the changes to make MINIX v1.3d run on a Compaq Portable III. # Only two files are involved, both in the kernel directory, at_wini.c # and printer.c. Context diff files are included for both files. The # changes are minor: (a) the P III's video mimics color but it uses the # mono printer port address, (b) The disk controller (if it has been given # a command that will generate a hardware interrupt) doesn't like for its # status to be checked until after the hardware interrupt has occurred. # The change to at_wini.c has also been tested and found to work on an # AT-Clone with a WD controller. # Jim Smith, Orlando Technical RBBS, 407/647-1147 (USA) echo x - at_wini.c.cdif sed '/^X/s///' > at_wini.c.cdif << '/' X*** at_wini.c Sat Nov 26 18:10:47 1988 X--- wini.c Tue Nov 29 13:59:21 1988 X*************** X*** 213,227 **** X if (wn->wn_opcode == DISK_READ) { X for (i=0; i> 4), (unsigned)(usr_buf & 0x0F)); X /* restore(old_state); */ X usr_buf += 0x200; X if (win_results() != OK) { X w_need_reset = TRUE; X return(ERR); X } X! } X r = OK; X } else { X for (i=0; iwn_opcode == DISK_READ) { X for (i=0; i> 4), (unsigned)(usr_buf & 0x0F)); X /* restore(old_state); */ X usr_buf += 0x200; X+ } /* moved from below next statement by jhs */ X+ X+ /* The next statement originally sampled status of the disk controller */ X+ /* after the first sector of a block was read, before the HARDWARE int */ X+ /* for the 2nd sector. On a Compaq Portable III, reading status be- */ X+ /* fore the HARDWARE int occurs clears the controller's HARDWARE int */ X+ /* and it never occurs, leaving the wini task blocked, waiting for a */ X+ /* HARDWARE interrupt! I moved the "win_results()" test up so that it */ X+ /* immediately follows the HARDWARE int at the beginning of the DISK- */ X+ /* READ for-loop. This change has been found to work properly on */ X+ /* an AT-Clone with WD controller, as well as with the Compaq P III. */ X+ /* I'm not sure the "win_results()" test is required after reading the */ X+ /* last sector of a block. It works, however, if we again check */ X+ /* win_results() here, so I left it in. */ X+ /* Jim Smith, Orlando Technical RBBS 407/647-1147 (USA) */ X+ X if (win_results() != OK) { X w_need_reset = TRUE; X return(ERR); X } X! /* } */ /* moved up above previous statement by jhs */ X r = OK; X } else { X for (i=0; i printer.c.cdif << '/' X*** printer.c.orig Tue Nov 29 12:55:52 1988 X--- printer.c Tue Nov 29 14:05:33 1988 X*************** X*** 39,46 **** X #define NO_PAPER 0x20 /* status bit saying that paper is up */ X #define OFF_LINE 0x10 /* status bit saying that printer not online*/ X #define PR_ERROR 0x08 /* something is wrong with the printer */ X! #define PR_COLOR_BASE 0x378 /* printer port when color display used */ X! #define PR_MONO_BASE 0x3BC /* printer port when mono display used */ X #define LOW_FOUR 0xF /* mask for low-order 4 bits */ X #define CANCELED -999 /* indicates that command has been killed */ X #define DELAY_COUNT 100 /* regulates delay between characters */ X--- 39,48 ---- X #define NO_PAPER 0x20 /* status bit saying that paper is up */ X #define OFF_LINE 0x10 /* status bit saying that printer not online*/ X #define PR_ERROR 0x08 /* something is wrong with the printer */ X! /* #define PR_COLOR_BASE 0x378 *//* printer port when color display used */ X! /* #define PR_MONO_BASE 0x3BC *//* printer port when mono display used */ X! #define PR_COLOR_BASE 0x3BC /* printer port when color display used */ X! #define PR_MONO_BASE 0x378 /* printer port when mono display used */ X #define LOW_FOUR 0xF /* mask for low-order 4 bits */ X #define CANCELED -999 /* indicates that command has been killed */ X #define DELAY_COUNT 100 /* regulates delay between characters */ /