[comp.os.minix] MINIX 1.2 printer-problem

usenet@cps3xx.UUCP (Usenet file owner) (02/15/89)

We are using Zenith-159/3s and EPSON FX86e/850 printers to run MINIX 1.2
(640K_PC) to teach the OS course. We observed that the printer prints
some characters twice and drops the others, randomly. It seems that the
port_out calls with ASSERT_STROBE and NEGATE_STROBE in kernel/printer.c
are reponsible for it. If the strobe stays asserted after the printing
of a character the printer prints it again and if the strobe is negated
before the character is printed the character disappears. The problem
has been fixed by combining the two port_out calls into a single one:

	prt_outn(port_base + 2, ASSERT_STROBE, NEGATE_STROBE)

The files kernel/printer.c and kermel/MINIX/klib88.s have to be patched.
The kernel has to be recompiled to create a new boot disk. The cdiffs
are given below.

-- ishwar rattan (rattan@frith.egr.msu.edu)
-----------------------------------------------------------------------
*** printer.c.old ***
--- printer.c ---

*** 259-262 ***
port_out(port_base,ch);

--- 259-263 ---
port_out(port_base, ch);
/* port_out(port_base + 2, ASSERT_STROBE);
 * port_out(port_base + 2, NEGATE_STROBE); */
prt_outn(port_base + 2, ASSERT_STROBE, NEGATE_STROBE);
offset++;

-----changes in klib88.s

*** klib88.s.old ***
--- klib88.s ---

*** 25 ***
.globl _wreboot, _dma_read, _dma_write

--- 25 ---
.globl _wreboot, _dma_read, _dma_write, _prt_outn

*** 195 **
--- 195 - 216 ---
|*==========================================================
|*		prt_outn
|*==========================================================
|* prt_outn(port, val1, val2) writes 'val1' and 'val2 to I/O port

_prt_outn:
	push bx				| save bx
	mov bx,sp			| index off bx
	push ax				| save ax
	push dx				| save dx
	mov dx,4(bx)			| dx = port
	mov ax,6(bx)			| ax = val1
	out				| output a byte
	mov ax,8(bx)			| ax = val2
	out				| output a byte
	pop dx				| restore dx 
	pop ax				| restore ax
	pop bx				| restore bx
	ret
-------------------------------------------------------------------------