johnc@rtmvax.UUCP (John Connin) (12/05/88)
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. # 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<BLOCK_SIZE/SECTOR_SIZE; i++) { X receive(HARDWARE, &w_mess); X /* old_state = lock(); */ X dma_read((unsigned)(usr_buf >> 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; i<MAX_WIN_RETRY && (r&8) == 0; i++) X--- 213,247 ---- X if (wn->wn_opcode == DISK_READ) { X for (i=0; i<BLOCK_SIZE/SECTOR_SIZE; i++) { X receive(HARDWARE, &w_mess); X+ if (win_results() != OK) { /* added by jhs */ X+ w_need_reset = TRUE; /* added by jhs */ X+ return(ERR); /* added by jhs */ X+ } /* added by jhs */ X /* old_state = lock(); */ X dma_read((unsigned)(usr_buf >> 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<MAX_WIN_RETRY && (r&8) == 0; i++) / echo x - printer.c.cdif sed '/^X/s///' > 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 */ /