[comp.os.minix] Fast/Slow routines for 'turbo' XT clones

nsmith@well.UUCP (04/08/87)

Well, THOSE DISKS finally arrived a couple of days ago.  I'm working on
bringing MINIX up on a turbo XT clone.  So far, few problems.  The first
thing I wrote was the code at the end of this article -- MINIX doesn't 
appear to understand turbo boards. Raising the speed to 8 MHz makes a
noticeable difference in response.  The following code is really quite
trivial, and probably will eventually end up in my boot routine.  For
now, I'm just putting the binary for 'fast' in /etc/rc.

Has anyone gotten MINIX to run on a 2,7 RLL controller like the
Adaptec 2070A?  I'm waiting for the tech manual from Adaptec
before I dive into xt_wini.c...until then, I'm back to floppies.

What follows is a shar of three files to implement 'fast' and 'slow'.

                neil
-----
Neil Smith      
nsmith@well.UUCP -or- ...!ihnp4!lll-lcc!well!nsmith

----------------- Cut here ---------------------------
echo x - fast.c
gres '^X' '' > fast.c << '/'
X/*
X *     speed shifter (up) for turbo type pc/xt clones
X *     Neil Smith (nsmith@well.UUCP)
X *     7 april 1987
X *
X *     To compile, use:
X *             cc -o fast fast.c io.s
X */
X
X#define        TSENSE  0x61            /* turbo bit sense/set port number */
X
Xmain()
X{
X       int     turbo;
X
X       turbo = port_in(TSENSE);
X       turbo |= 0x04;
X       port_out(TSENSE, turbo);
X}
X
/
echo x - slow.c
gres '^X' '' > slow.c << '/'
X/*
X *     speed shifter (down) for turbo type pc/xt clones
X *     Neil Smith (nsmith@well.UUCP)
X *     7 april 1987
X *
X *     To compile, use:
X *     cc -o slow slow.c io.s
X */
X
X#define        TSENSE  0x61            /* turbo bit sense/set port number */
X
Xmain()
X{
X       int     turbo;
X
X       turbo = port_in(TSENSE);
X       turbo &= 0xFB;
X       port_out(TSENSE, turbo);
X}
X
/
echo x - io.s
gres '^X' '' > io.s << '/'
X|
X|      io.s - port i/o routines taken from usenet
X|      lifted from Martin C. Atkin (martin@minster.UUCP)'s rddate shar
X|      posted on the net a few weeks ago...similar to routines in klib88.s
X|
X       .globl  _port_in, _port_out
X
X|
X|      i = port_in(port)
X|
X_port_in:
X       push    bx
X       mov     bx, sp
X       push    dx
X       mov     dx, 4(bx)
X       in
X       xorb    ah, ah
X       pop     dx
X       pop     bx
X       ret
X
X|
X|      port_out(port, data)
X|
X_port_out:
X       push    bx
X       mov     bx, sp
X       push    ax
X       push    dx
X       mov     dx, 4(bx)
X       mov     ax, 6(bx)
X       out
X       pop     dx
X       pop     ax
X       pop     bx
X       ret
X
/

-- 
----------------------------------------------------------
Neil Smith
AT&T: (415) 644-3943
UUCP: ...!ihnp4!lll-lcc!well!nsmith