Subject: New Booter, which should fix IIvx booting problems
To: None <port-mac68k@NetBSD.ORG>
From: None <nigel@ind.tansu.com.au>
List: port-mac68k
Date: 08/29/1997 05:49:52
	OK folks, I have a new Booter for testing.

* I was unable to ftp to puma (I guess 5am here is a peak time over there)
  so I will try to put it in /pub later today. The file will be called
  "Booter 1.10.3b1.sea.hqx" unless I decide to take the space out!

* Anyone who is itching to get it can send me some mail, and I will mail
  them back the 95KB hqx file.

* I will release source code, change logs, and some new doco (there are a
  few minor interface changes) when the program earns its non-beta status.
  That will happen once I am sure that it works on a few different types
  of machines (i.e. not just IIvx-s).


	For the curious (or just in case I get hit by a bus or something)
the problem seems to be in a function TurnCachesOff() in ufs_test.c.

	Now, Booter 1.9.3b3 had an assembler version of TurnCachesOff().
Booter 1.9.4 had both the assembler and a new C version of this function,
selected by a #if block. Booter 1.9.6 and later had just the assembler
one again (this was about the time Brian Gaeke stopped maintaining the
Booter source code).

	The really strange part:

1) A few people reported that Booters _earlier_ than 1.9.4 also worked.

2) Why would the assembler code not work [stop working?] _just_ on the
   IIvx machines? They are not the only machines with an '030 and FPU.

  	Anyway, for your edification, here is the code in question -
from Booter 1.9.4's ufs_test.c:

/* Switch the caches off. */
#if USE_KERNEL_CACHE_DISABLING
static INLINE ASMFUNC void
TurnCachesOff(void)
{
	ASMBLOCKBEGIN

	MOVE.L	#0x00000808,	D0
#if defined(__MWERKS__)
/* Someone with a terminal brain deficiency at metrowerks forgot MOVEC. */
	DC.W	0x4E7B   /* MOVEC D0, CACR */
	DC.W	0x0002
#else
	MOVEC	D0, 	CACR
#endif
	RTS

	ASMBLOCKEND
}
#else /* USE_KERNEL_CACHE_DISABLING */
/* Use Apple's routines which will automagically detect '020/'030/'040,
 * as suggested by Mikael Forselius <mikaelf@olando.se>
 */
static void
TurnCachesOff(void)
{
	FlushInstructionCache();
	FlushDataCache();

	SwapInstructionCache(false);
	SwapDataCache(false);
}
#endif

-- 
| Nigel Pearson, nigel@ind.tansu.com.au |"People say I'm strange, does it  |
|  Telstra IN Platforms, Sydney, Aust.  | make me a stranger?              |
| Office: 9206 3468    Fax:  9212 6329  | My best friend was born ...      |
| Mobile: 014 611 322  Home: 9579 3293  | in a manger" Jesus Freak, DC Talk|