*BSD News Article 16462


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!sol.ctr.columbia.edu!hamblin.math.byu.edu!news.byu.edu!cwis.isu.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: SCSI and > 16Mb.
Message-ID: <1993May24.210920.21129@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <BDC.93May17123556@transit.ai.mit.edu> <DERAADT.93May17153355@newt.fsa.ca> <C7IvKM.J3s@cat-ufg.de>
Date: Mon, 24 May 93 21:09:20 GMT
Lines: 76

In article <C7IvKM.J3s@cat-ufg.de> wis@happy.cat-ufg.de (Bernd Wiserner) writes:
>In article <DERAADT.93May17153355@newt.fsa.ca>, deraadt@fsa.ca (Theo de Raadt) writes:
>|> In article <BDC.93May17123556@transit.ai.mit.edu> bdc@ai.mit.edu (Brian D. Carlstrom) writes:
>|>    In article <C76Ftw.MJA@cat-ufg.de> wis@olly.cat-ufg.de (Bernd Wiserner) writes:
>|> 
>|>       My question is if I can use more than 16 Mb of mem. in NetBSD
>|>       with Julian's scsi-driver ?
>|> 
>|> 
>|>    good question. i dont know for sure, but my system had a lot of scsi
>|>    disk problems til i took the memory above 16 out. is this being looked
>|>    at fixed? is there already a crude hack somewhere?
>|> 
>|> There's a crude hack out there, but no generic solution.
>|> --
>|> 
>|> This space not left unintentionally unblank.		deraadt@fsa.ca
>
>
>I don't care how crude it is . where is it ??

It's probably my crude hack he was talking about; it's irrelevant unless you
have my WD7000-FASST2 driver, and I'm not releasing the driver until I can
either beat the snot out of the probe or not compile in the wd device and
still have a floppy driver; by then, I expect someone else will have written
one or 0.2 will be out and have a vm86() based driver that uses the BIOS and
will work with any controller (although slowly).

The two problems are the buffer addresses being in excess of 16M (ISA DMA
doesn't work right with addresses above 16M) and cache coherency with DMA
to a memory address that lives in the cache already.

The first you get around by allocating bounce buffers and then using them
in the driver.  The apporpriate code is in the following files:

	/sys/i386/pmap.c 
	/sys/isa/isa.c

With *some* minor example code in /sys/stand/fd.c (really not applicable).

The second problem is resolved by setting the "noncacheable" bit on the
pages allocated for buffers.  If you don't want to rewrite that portion
of VM to handle setting the flags on allocate (it's fairly easy, since
the low level vm stuff supports any flags on the page you think you need),
or if your cache chip set sucks (because it ignores this bit), then you
can use a "BINVD" to invalidate the cache for each buffer before using the
data in it (I believe Julians driver already does this -- haven't checked
lately; I bought an AHA1742 and have been ignoring the WD7000 and ISA
specific bugs ever since).

The bounce buffer code requires a hack because the memory area used for
bounce buffers is used by the original 0.1 install (according to Bill, one
of the reasons it wasn't released), and as such, you either have to do a
binary hack to the install or hack the heck out of the code to make it work
(which means that the hack will only work on an installed system, and an
installed system wouldn't need the hack -- if you can install, you don't
have a problem, and if you can't, you can't use the fix for the problem
during install -- catch 22: if you need it, you can't install, and if you
can install, you don't need it).

Anyway, I didn't make specific changes to the AHA drivers to support the
hack, and that's what you need to change.  Disable yourself down to 16M
until an official (and working) fix can be released, or so you can
install and do the hack yourself... if you *do* hack it, be aware that
you can't boot and mount from the fixit disk unless you redisable back
to 16M.


					Terry Lambert
					terry@icarus.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me