[comp.sources.amiga] v90i223: SetCPU 1.60 - identify and adjust parameters based on cpu type, Part03/04

amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator) (08/15/90)

Submitted-by: daveh@cbmvax.commodore.com (Dave Haynie)
Posting-number: Volume 90, Issue 223
Archive-name: util/setcpu-1.60/part03

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 4)."
# Contents:  SetCPU.c SetCPU.txt
# Wrapped by tadguy@abcfd20 on Tue Aug 14 17:35:36 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'SetCPU.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'SetCPU.c'\"
else
echo shar: Extracting \"'SetCPU.c'\" \(23981 characters\)
sed "s/^X//" >'SetCPU.c' <<'END_OF_FILE'
X/*
X	SetCPU V1.60
X	by Dave Haynie, April 13, 1990
X	Released to the Public Domain
X
X	MAIN PROGRAM
X
X	This program is a CPU identification and MMU support tool for the
X	Amiga operating system.  It will identify various CPU system 
X	elements, and allow decisions to be made based on those elements
X	in script files.  It will also use the MMU on systems so equipped
X	to translate system ROM, or alternate system ROMs, into system
X	memory, with preference given to any 32 bit memory it might be
X	able to detect.
X
X	While this program does attempt to support the 68040, it hasn't
X	been tested on a 68040 yet.  It doesn't attempt to support any
X	of the MMU setups on a 68040 system just yet.
X*/
X
X#define MAIN_MODULE
X
X#include "setcpu.h"
X
X/* ====================================================================== */
X
X/* Global options */
X
XBOOL	tags[CHECKS],			/* Check system tags */
X	verbose 	= FALSE,	/* Display lots of info? */
X	helpmode	= FALSE,	/* Do we just want help? */
X	handler		= TRUE,		/* Install trap handler? */
X	allochead	= FALSE,	/* Allocate from head of memory */
X	keepexec	= FALSE,	/* Preserve ExecBase on KICKROM? */
X	stack		= TRUE,		/* Try a stack translation? */
X	aliens		= FALSE;	/* MMU setup from space? */
X        
Xshort	fastrom 	= 0,		/* Set up the FASTROM? */
X	wrapbits	= 8,		/* How does the MMU wrap addresses? */
X	forcewrap	= -1,		/* Forced addressing size */
X	quitcode	= 0;		/* Termination code */
X
Xchar	*romfile	= NULL;		/* Where to look for a kick image */
X
XULONG 	bootdelay	= 0x00400000,	/* Basic reboot-loop delay */
X	cpu,				/* CPU type */
X	fpu,				/* FPU type */
X	mmu,				/* MMU type */
X	oldCACR,			/* CACR when we start. */
X	newCACR;			/* New CACR value. */
X
X/* Do we want autoconfig?  I think a default level 2 makes more sense. */
X
Xshort	configlevel 	= 2;		
XBOOL	configset	= FALSE;
X
X/* ====================================================================== */
X
X/* This is the termination routine, which also displays numbered errors. */
X
Xvoid quit(err)
Xint err;
X{
X   if (err >= 10) printf("Error: ");
X   switch(err) { 
X      case 1:
X         printf("Usage: SetCPU [INST|DATA] [[NO]CACHE|[NO]BURST] [CONFIG n] [BITS n] [TRAP n]\n");
X         printf("              [KICKROM path|dfN: [DELAY n] [KEEPEXEC]] [CARDROM path] [VERBOSE]\n");
X         printf("              [[NO]FASTROM [path] [KEYPATCH n] [HEAD] [NOSTACK]] [ROMBOOT]\n");
X         printf("              [CHECK 680x0|68851|6888x|MMU|FPU|MMUON|MMUROM|MMUALIEN]\n");
X         break;   
X      case 11: printf("Invalid numeric parameter value\n");	break;
X      case 12: printf("Illegal Command Line Option\n");		break;
X      case 13: printf("KICKROM translation can't be removed\n");break;
X      case 14: printf("Can't get memory for FASTROM\n");	break;
X      case 15: printf("Can't locate specified file\n");		break;
X      case 16: printf("Invalid device specified\n");		break;
X      case 17: printf("KEYPATCH requires FASTROM\n");		break;
X      case 18: printf("Can't get memory for KICKROM\n");	break;
X      case 19: printf("Option requires a file name argument\n");break;
X      case 20: printf("System is already FASTKICKed\n");	break;
X      case 21: printf("File/ROM version mismatch, use KICKROM\n"); break;
X      case 22: printf("KICKROM file format invalid\n");		break;
X      case 23: printf("KICKROM file too short\n");		break;
X      case 24: printf("KICKROM file not found\n");		break;
X      case 25: printf("ROMBOOT can't be used with other options\n"); break;
X      case 26: printf("68040 MMU setups not supported\n");	break;
X      case 27: printf("Alien MMU setup prevents FASTROM\n");	break;
X      default:  break;
X   }
X
X   if (ExpansionBase) CloseLibrary(ExpansionBase);
X
X   if (cpu >= 68020L) SetCACR(((err>10)?oldCACR:newCACR) | CACR_FIXED);
X   exit((err>10)?10:err);
X}
X
X/* ====================================================================== */
X
X/* A bit of magic for the smart reset code. */
X
X#define COLDREBOOTVECT -726L
X
X/* This routine installs the given valid rom image as a fast ROM.  It will
X   install any I/O translations that are appropriate, and also apply the
X   system patch list to the ROM image, before engaging the MMU. */
X
Xstatic BOOL CreateFastROM(tag,wrapbits)
Xstruct systag *tag;
Xshort wrapbits;
X{
X   ULONG *VBR = GetVBR();
X   struct ExecBase *eb = *((struct ExecBase **)4L);
X
X   if (!tag) return FALSE;
X
X   tag->wrapup = (wrapbits < tag->wrapdown) ? wrapbits : tag->wrapdown;
X
X  /* Here I'll add in subtables for any I/O devices that we've been told
X     about, that I can locate. */
X
X   MakeExpTable(tag);
X
X  /* Here I apply the patches to this ROM. */
X
X   AddPatch((UWORD *)tag->romhi,SystemPatch,tag);
X   tag->patchlist = lastpatch;   
X
X  /* How 'bout that exception handler.  I get the Vector Base Register,
X     save the old vector, allocate space for the new one if needed, copy it
X     from my SetCPU code, and assign it.  The tag keeps track of all of this
X     so that I can easily remove the whole thing if FASTROM is turned off. */
X  
X   if (handler) {
X      tag->OldBerr = (char *)VBR[2];
X      tag->BerrSize = BerrCodeSize;
X      tag->BerrHandler = (char *)AllocMem(tag->BerrSize,MEMF_PUBLIC);
X      MemCopy(BerrCode,tag->BerrHandler,tag->BerrSize);
X      VBR[2] = (ULONG)tag->BerrHandler;
X   }
X
X  /* Should we have a smart reset bit? */
X
X   if (eb->LibNode.lib_Version >= 36) {
X      tag->ResetCode = (char *)AllocMem(tag->ResetSize = ResetCodeSize,0L);
X      MemCopy((char *)ResetCode,tag->ResetCode,tag->ResetSize);
X      tag->OldReset = SetFunction(eb,COLDREBOOTVECT,tag->ResetCode);
X   } 
X
X  /* Bang the MMU my way */
X
X   SetMMURegs(tag);
X   Disable();
X   SetMMUTag(tag);
X
X  /* How about that system stack. This is done here, since the MMU is already
X     on, and I need to do supervisor-mode stuff to turn it on, but no to set
X     up the fast stack. */
X
X   if (stack) MakeFastStack(tag);
X
X   Enable();
X   return TRUE;
X}
X
X/* This routine creates a kickable ROM, based on the image in the systag.
X   If the Kick ROM can't be allocated, the routine returns FALSE, otherwise,
X   TRUE. */
X
Xstatic BOOL CreateKickROM(temptag,wrapbits) 
Xstruct systag *temptag;
Xshort wrapbits;
X{
X   struct systag *tag;
X   ULONG *VBR = GetVBR();
X
X   if (!temptag || LoadErr) return FALSE;
X
X  /* We disable so that nothing else is running; the RAMBoot() routine
X     counts on the instruction cache, so we might as well turn that on
X     now as well. */
X
X   Forbid();
X   Disable();
X 
X  /* Now I need a new tag, based on safe memory.  Note that calling the safe
X     allocator will very likely crash the system if we're not disabled. */
X
X   if (!(tag = AllocSAFEImage(temptag))) {
X      Enable(); 
X      return FALSE;
X   }
X
X   tag->wrapup = (wrapbits < tag->wrapdown) ? wrapbits : tag->wrapdown;
X   
X   if (configlevel == 1 || configlevel == 0) {
X      tag->maintable[0xe80000L/ROMROUND] = PD_ADDR(0x800000)|PD_DT_PAGE;
X      tag->config = FALSE;
X   }
X
X  /* How 'bout that exception handler.  I get the Vector Base Register,
X     save the old vector, allocate space for the new one if needed, copy it
X     from my SetCPU code, and assign it.  The tag keeps track of all of this
X     so that I can easily remove the whole thing if FASTROM is turned off. */
X
X   if (handler) {
X      tag->BerrSize = BerrCodeSize;
X      MemCopy(BerrCode,tag->BerrHandler,tag->BerrSize);
X      VBR[2] = (ULONG)tag->BerrHandler;
X   }
X   SetMMURegs(tag);
X   RAMBoot(tag,(LONG)keepexec,bootdelay);
X   return FALSE;
X}
X
X/* This routine removes the Fast ROM, and re-claims the memory previously
X   allocated.  We've already checked to make sure that the MMU was 
X   switched on. */
X
Xstatic void DeleteFastROM(tag)
Xstruct systag *tag;
X{
X   ULONG *VBR;
X   struct MemChunk *mem, *del;
X   struct ExecBase *eb = *((struct ExecBase **)4L);
X
X  /* First off, turn off the MMU and caches.  This lets us muck with the table 
X     and reclaim memory without any trouble. */
X
X   if (tag->romtype != ROM_FAST) quit(13);
X   if (tag->sysstack) FreeFastStack(tag);
X   SetTC(0L);
X
X  /* First I free any subtable stuff that was allocated. */
X   FreeExpROM(tag->devs);
X
X  /* Now I delete the patches for any patch lists I've got.  They only get
X     deleted if they've been applied. */
X   mem = tag->patchlist;
X   while (mem) {
X      del = mem;
X      mem = mem->mc_Next;
X      FreeMem(del,del->mc_Bytes);
X   }
X
X  /* Remove the bus error handler, if there is one. */
X   if (tag->BerrHandler) {
X      VBR = GetVBR();
X      VBR[2] = (ULONG)tag->OldBerr;
X      if (tag->OldBerr) FreeMem(tag->BerrHandler,tag->BerrSize);
X   }
X
X  /* Did we have a smart reset bit? */
X
X   if (tag->ResetCode && tag->OldReset) {
X      SetFunction(eb,COLDREBOOTVECT,tag->OldReset);
X      FreeMem(tag->ResetCode,tag->ResetSize);
X   }
X
X  /* Now I just free up table and ROM image memory, and I'm done!  I can free
X     the table I built for any subtable here, and then the main table and
X     image. */
X  
X   FreeMMUTable(tag);
X
X   if (tag->tagsize <= 66L || !tag->romlo)
X      FreeMem(tag->romhi,SMALLROMSIZE);
X   else if (tag->romlo)
X      FreeMem(tag->romlo,tag->romsize);
X   FreeMem(tag,tag->tagsize);
X}
X
X/* This routine displays the ROM image information. */
X
Xstatic void PrintFastROM() {
X   struct systag *tag;
X   struct ExpROMData *dev;
X   struct ExecBase *eb = *((struct ExecBase **)4L);
X
X   if (!(tag = GetSysTag())) return;
X
X   printf("TABLE : (PADDR: $%8lx) (SIZE: %ld) (WRAP: %d)\n",
X      tag->maintable,tag->tablesize/4,tag->wrapup);
X
X   if (tag->romlo)
X      printf("KERNEL: (PADLO: $%8lx) (PADHI: $%8lx) (VADDR: $%8lx) (SIZE: %ldK)\n",
X         tag->romlo,tag->romhi,tag->romloc,tag->romsize/1024);
X   else
X      printf("KERNEL: (PADDR: $%8lx) (VADDR: $%8lx) (SIZE: %ldK)\n",
X         tag->romhi,tag->romloc,tag->romsize/1024);
X   if (tag->sysstack)
X      printf("SSTACK: (PADDR: $%8lx) (VADDR: $%8lx) (SIZE: %ldK)\n",
X         tag->sysstack,eb->SysStkLower,((ULONG)eb->SysStkUpper - (ULONG)eb->SysStkLower + 1)/1024);
X   if (tag->ResetCode)
X      printf("REBOOT: (NVECT: $%8lx) (OVECT: $%8lx) (SIZE: $%lx)\n",
X         tag->ResetCode,tag->OldReset,tag->ResetSize);
X
X  /* Now we'll explain any device stuff that's here. */
X   for (dev = tag->devs; dev; dev = dev->next) {
X      printf("DEVICE: %sE\n",dev->name);
X      printf("        (PADDR: $%8lx) (TABLE: $%8lx) (SIZE: %ldK)\n",
X             dev->imagebase, dev->tablebase, dev->ROMsize/1024);
X   }
X}
X
X/* Basic "Do I do configuration" logic */
X
Xvoid SetupConfig(tag)
Xstruct systag *tag;
X{
X   if (configlevel > 0) {
X      tag->maintable[0xe80000L/ROMROUND] = PD_ADDR(0xe80000L)|PD_DT_PAGE;
X      if (configlevel > 1) SafeConfigDevs();
X   }
X}
X
X/* ====================================================================== */
X
X/* This function scopes out the two key expansion devices, Bridge Card or
X   known-to-be-32-bit memory. */
X
Xvoid SnoopDevs() {
X   struct ConfigDev *cd;
X
X   if ((cd = FindConfigDev(NULL,0x201L,0x01L)) || (cd = FindConfigDev(NULL,0x201L,0x02L))) {
X      Bridge.Addr = (ULONG)cd->cd_BoardAddr;
X      Bridge.Size = (ULONG)cd->cd_BoardSize;
X   }
X
X   if ((cd = FindConfigDev(NULL,0x202L,0x50L)) || (cd = FindConfigDev(NULL,0x202L,0x51L))) {
X      A26x0.Addr = (ULONG)cd->cd_BoardAddr;
X      A26x0.Size = (ULONG)cd->cd_BoardSize;
X   } 	
X}
X
X/* ====================================================================== */
X
X/* Codes for the FASTROM action. */
X
X#define	FR_NO_ACTION	0
X#define	FR_DELETE	1
X#define	FR_MKFAST	ROM_FAST
X#define FR_MKKICK	ROM_KICK
X
X/* Command line tokens */
X
Xstatic char *CLITokens[] = 
X   { "68000","68010","68020","68030","68040","68851","68881","68882","FPU",
X     "MMU","MMUON","MMUROM","MMUALIEN","CHECK", "FASTROM", "NOFASTROM",
X     "NOPATCH","KEYPATCH","TRAP", "DATA", "INST", "CACHE", "NOCACHE", "BURST",
X     "NOBURST","VERBOSE", "KICKROM", "CARDROM", "CONFIG", "HEAD", "DELAY",
X     "KEEPEXEC","ROMBOOT","NOSTACK","BITS","?" };
X   
X#define CT_CHECK	CHECKS+0
X#define CT_FASTROM	CHECKS+1
X#define CT_NOFROM	CHECKS+2
X#define CT_NOPATCH	CHECKS+3
X#define CT_KEYPAT	CHECKS+4
X#define CT_TRAP		CHECKS+5
X#define CT_DATA		CHECKS+6
X#define CT_INST		CHECKS+7
X#define CT_CACHE	CHECKS+8
X#define CT_NOCACHE	CHECKS+9
X#define CT_BURST	CHECKS+10
X#define CT_NOBURST	CHECKS+11
X#define CT_VERBOSE	CHECKS+12
X#define CT_KICKROM	CHECKS+13
X#define CT_CARDROM	CHECKS+14
X#define CT_CONFIG	CHECKS+15
X#define CT_HEAD		CHECKS+16
X#define CT_DELAY	CHECKS+17
X#define CT_KEEPEX	CHECKS+18
X#define CT_ROMBOOT	CHECKS+19
X#define CT_NOSTACK	CHECKS+20
X#define CT_BITS		CHECKS+21
X#define CT_HELP		CHECKS+22
X
X/* This function fetches a bounded numeric value, or takes the error trap
X   for numeric arguments if things aren't right. */
X   
Xshort getnumber(arg,low,high)
Xchar *arg;
Xshort low, high;
X{
X   short num;
X
X   if (!arg || !isdigit(*arg) || (num = atoi(arg)) < low || num > high) 
X      quit(11);
X   return num;
X}
X
X/* This is basically the DiskSalv command-line parser re-written for the
X   SetCPU command set. */
X
Xstatic USHORT ParseCommandLine(argc,argv)
Xint argc;
Xchar **argv;
X{
X   short i,j, trapmode = 0, bitcnt;
X   struct patch *p;
X   BPTR lock;
X   ULONG mode = CACR_INST | CACR_DATA;
X   char *file;
X   BOOL f_FASTROM = FALSE, f_KEYPAT = FALSE;
X   
X   for (i = 1; i < argc; i++) {
X      for (j = 0; CLITokens[j] && !striequ(argv[i],CLITokens[j]); ++j);
X      if (j < CHECKS) {
X         if (quitcode != WARNING) return 12;
X         tags[j] = TRUE;
X      } else switch (j) {
X         case CT_CHECK	: quitcode = WARNING;			break;
X         case CT_NOFROM	: fastrom = FR_DELETE;			break;
X         case CT_DATA	: mode = CACR_DATA;			break;
X         case CT_INST   : mode = CACR_INST;			break;
X         case CT_CACHE	: newCACR |=   mode << CACR_ENABLE;	break;
X         case CT_NOCACHE: newCACR &= ~(mode << CACR_ENABLE);	break;
X         case CT_BURST	: newCACR |=   mode << CACR_BURST;	break;
X         case CT_NOBURST: newCACR &= ~(mode << CACR_BURST);	break;
X         case CT_VERBOSE: verbose = TRUE;			break;
X         case CT_HEAD	: allochead = TRUE;			break;
X         case CT_KEEPEX	: keepexec = FALSE;			break;
X         case CT_HELP	: helpmode = TRUE;			break;
X         case CT_NOSTACK: stack = FALSE;			break;
X         case CT_ROMBOOT: 
X            if (argc != 2) 
X               quit(25);
X            else 
X               CleanBoot();
X         case CT_TRAP	: 
X            if (argv[i+1] && isdigit(argv[i+1][0]))
X               trapmode = getnumber(argv[++i],0,2);
X            if (trapmode == 0) wrapbits = 0;
X            handler = (trapmode == 2);
X            break;
X         case CT_BITS	:
X            if (argv[i+1] && isdigit(argv[i+1][0]))
X               bitcnt  = getnumber(argv[++i],24,32);
X            forcewrap = 32-bitcnt;
X            break;
X         case CT_CONFIG	: 
X            configset = TRUE;
X            configlevel = getnumber(argv[++i],0,2);
X            break;
X         case CT_DELAY:
X            bootdelay = 0x60000L*(ULONG)getnumber(argv[++i],0,100);
X            break;
X         case CT_KEYPAT	:
X             SetKeyDelay(100L * (ULONG)getnumber(argv[++i],1,100));
X             for (p = SystemPatch; p; p = p->next)
X                if (p->list[KEYPATCH].Type == PT_KEYBOARD) {
X                   p->list[KEYPATCH].Length = KeyCodeSize;
X                   p->list[KEYPATCH].Code = (UWORD *)KeyCode;
X                   p->list[KEYPATCH].Type = PT_JSR;
X                }
X            f_KEYPAT = TRUE;
X            break;
X         case CT_NOPATCH: 
X            for (p = SystemPatch; p; p = p->next) {
X               j = 0;
X               while (p->list[j].Type != PT_END) {
X                  if (j != KEYPATCH && p->list[j].Type < PT_END)
X                     p->list[j++].Type = PT_IGNORE;
X                  else
X                     ++j;                        
X               }
X            }
X            break;
X         case CT_FASTROM: 
X            fastrom = FR_MKFAST;
X            if (i+1 < argc && (lock = Lock(argv[i+1],ACCESS_READ))) {
X               UnLock(lock);
X               romfile = argv[++i];
X            }
X            f_FASTROM = TRUE;
X            break;
X         case CT_KICKROM:
X            fastrom = FR_MKKICK;
X            if (!(romfile = argv[++i])) return 19;
X            break;
X         case CT_CARDROM:
X            if (!(file = argv[++i])) return 19;
X            if (!ReadExpDevs(file)) return 15;
X            break;
X
X         default: return 12;
X      }
X   }
X   if (f_KEYPAT && !f_FASTROM) return 17;
X
X   return 0;
X}
X
X
X/* ====================================================================== */
X
X/* This routine prints FPU codes and sets things accordingly. */
X
Xvoid PrintFPU()
X{
X   if (fpu == 68881L) {
X      printf("68881 ");
X      if (tags[CK68881]) quitcode = 0;
X   } else if (fpu == 68882L) {
X      printf("68882 ");
X      if (tags[CK68882]) quitcode = 0;
X   }
X   if (fpu && tags[CKFPU]) quitcode = 0;
X}
X
X/* This program displays the system CPU setup and sets any appropriate check
X   flags. */
X
Xvoid PrintSystem() {
X   ULONG mmuon,dmask = CACR_DATA,imask = CACR_INST,shft = CACR_ENABLE;
X   struct systag *tag;
X
X   printf("SYSTEM: ");
X
X   /* If they're not on a 68020/68030, we can't set anything.  For 
X      compatibility across systems, I don't consider a cache setting 
X      request an error, just ignore it. */
X
X   if (cpu <= 68010L) {
X      if (cpu == 68010L) {
X         printf("68010 ");
X         if (tags[CK68010]) quitcode = 0;
X      } else {
X         printf("68000 ");
X         if (tags[CK68000]) quitcode = 0;
X      }
X      PrintFPU();
X      printf("\n");
X      return;
X   }
X
X   /* The 32 bit system might have ROMs and things... */
X
X   if (cpu == 68040L) {
X      dmask = CACR_DATA40;
X      shft = CACR_ENABLE40;
X      printf("68040 ");
X      if (tags[CK68040]) quitcode = 0;
X   } else if (cpu == 68030L) {
X      printf("68030 ");
X      if (tags[CK68030]) quitcode = 0;
X   } else {
X      printf("68020 ");
X      if (tags[CK68020]) quitcode = 0;
X   }
X
X   PrintFPU();
X
X   if (mmu == 68851L) {
X      printf("68851 ");
X      if (tags[CK68851]) quitcode = 0;
X   }
X   if (mmu && mmu != BOGUSMMU && mmu != 68040) {
X      mmuon = (GetTC() & TC_ENB);
X      if (tags[CKMMU]) quitcode = 0;
X      if (tags[CKMMUON] && mmuon) quitcode = 0;
X      if (tag = GetSysTag()) {
X         if (tags[CKMMUROM]) quitcode = 0;
X         switch (tag->romtype) {
X            case ROM_FAST:
X               printf("FASTROM "); break;
X            case ROM_KICK:
X               printf("SLOWKICK "); break;
X            case ROM_FKICK:
X               printf("FASTKICK "); break;
X            default:
X               printf("NEWKICK? "); break;
X         }
X      } else if (mmuon) {
X         if (tags[CKMMUALIEN]) quitcode = 0;
X         printf("ALIENMMU ");
X      }
X   } else if (mmu == BOGUSMMU)
X      printf("(FPU LOGIC ERROR) ");
X
X   /* We always print the results, even if nothing has changed. */
X
X   SetCACR(newCACR | CACR_FIXED);
X   newCACR = GetCACR();
X   printf("(INST: ");
X   if (!(newCACR & (imask << shft))) printf("NO");
X   printf("CACHE");
X
X   if (cpu >= 68030L) {
X      if (cpu == 68030) {
X         printf(" ");
X         if (!(newCACR & (CACR_INST << CACR_BURST))) printf("NO");
X         printf("BURST");
X      }
X      printf(") (DATA: ");
X      if (!(newCACR & (dmask << shft))) printf("NO");
X
X      printf("CACHE");
X      if (cpu == 68030) {
X         printf(" ");
X         if (!(newCACR & (CACR_DATA << CACR_BURST))) printf("NO");
X         printf("BURST");
X      }
X   }
X   printf(")\n");
X
X}
X
X/* ====================================================================== */
X
X/* This function returns TRUE is the tag ROM passed is the same version
X   as the actual ROM in use, FALSE otherwise. */
X   
XBOOL CheckVersion(tag)
Xstruct systag *tag;
X{
X   UWORD *tagver,*kickver = (UWORD *)(0x100000C - (*(ULONG *)0xFFFFEC));
X   ULONG *rom = (ULONG *)((ULONG)tag->romhi);
X   
X   tagver = (UWORD *)(((ULONG)rom + SMALLROMSIZE + 0x0C) - rom[0xfffb]);
X   return (BOOL) (kickver[0] == tagver[0] && kickver[1] == tagver[1]);
X}
X
X/* This function deals with the FASTROM/KICKROM patches and the like. */
X
Xvoid DoROMStuff(tag)
Xstruct systag *tag;
X{
X   struct systag *newtag;
X
X   switch (fastrom) {
X      case FR_MKFAST:
X         if (tag) switch (tag->romtype) {
X            case ROM_FAST:
X               DeleteFastROM(tag);
X               if (romfile) {
X                  if (!(newtag = AllocDISKImage(ROM_FAST,romfile))) 
X                     if (LoadErr) quit(LoadErr); else quit(14);
X                  if (!CheckVersion(newtag)) {
X                     DeleteFastROM(newtag);
X                     quit(21);
X                  }
X               } else
X                  newtag = AllocROMImage(ROM_FAST);
X               if (!CreateFastROM(newtag,wrapbits)) quit(14);
X               break;
X            case ROM_KICK:
X               SetupConfig(tag);
X               if (!CreateFastROM(AllocROMImage(ROM_FKICK),wrapbits)) quit(14);
X               FreeSAFEImage(tag);
X               break;
X            case ROM_FKICK:
X               quit(20);
X         } else {
X            if (cpu == 68040) quit(26);
X            if (aliens) quit(27);
X            if (romfile) {
X               if (!(newtag = AllocDISKImage(ROM_FAST,romfile))) 
X                  if (LoadErr) quit(LoadErr); else quit(14);
X               if (!CheckVersion(newtag)) {
X                  DeleteFastROM(newtag);
X                  quit(21);
X               }
X            } else
X               newtag = AllocROMImage(ROM_FAST);
X            if (!CreateFastROM(newtag,wrapbits)) quit(14);
X         }
X         break;
X      case FR_MKKICK:
X         if (tag) switch (tag->romtype) {
X            case ROM_FAST:
X               DeleteFastROM(tag);
X            case ROM_FKICK:
X               if (!CreateKickROM(AllocDISKImage(ROM_KICK,romfile),wrapbits)) 
X                  if (LoadErr) quit(LoadErr); else quit(18);
X            case ROM_KICK:
X               SetupConfig(tag);
X               if (!CreateFastROM(AllocROMImage(ROM_FKICK),wrapbits)) quit(14);
X               FreeSAFEImage(tag);
X               break;
X         } else {
X            if (cpu == 68040) quit(26);
X            if (!CreateKickROM(AllocDISKImage(ROM_KICK,romfile),wrapbits)) 
X               if (LoadErr) quit(LoadErr); else quit(18);
X         }
X         break;
X      case FR_DELETE:
X         if (fastrom == FR_DELETE && tag) {
X            if (tag->romtype != ROM_FAST) quit(13);
X            DeleteFastROM(tag);
X         }
X         break;
X      case FR_NO_ACTION:
X         if (configset && tag) SetupConfig(tag);
X         break;
X   }
X}
X
X/* ====================================================================== */
X
X/* This be the main program. */
X
Xint main(argc,argv)
Xint argc;
Xchar *argv[];
X{
X   struct systag *tag;
X   USHORT i,err;
X
X  /* First we parse the command line.  The default cache operation acts 
X     on both data and instruction caches.  The way all the cache control
X     functions are defined, they're just NOPs on machines without the
X     appropriate caches. */
X
X   if ((cpu = GetCPUType()) >= 68020L) {
X      newCACR = oldCACR = GetCACR();
X      SetCACR(CACR_FIXED|(CACR_INST<<CACR_CLEAR)|(CACR_DATA<<CACR_CLEAR));
X   }
X   for (i = 0; i < CHECKS; ++i) tags[i] = FALSE;
X
X   if (argc > 1 && (err = ParseCommandLine(argc,argv))) quit(err);
X
X   /* If they're just asking for help */
X
X   if (verbose || helpmode)
X      printf("\23333mSetCPU V%1.2f by Dave Haynie\2330m\n",
X             ((float)PROGRAM_VERSION)/100.0);
X
X   if (helpmode) quit(1);
X
X  /* The FastROM routine uses the expansion library.  It's possible to have
X     an old version of the OS without this, so I'll be careful to avoid
X     using any ExpansionBase function without checking for the base being
X     valid. */
X
X   if (ExpansionBase = (struct ExpansionBase *)OpenLibrary("expansion.library",0L))
X      SnoopDevs();
X   
X  /* Let's find out what we have, and perform the ROM translation, if it's
X     requested and hasn't been done already. */
X
X   fpu = GetFPUType();
X   if ((mmu = GetMMUType()) && mmu != BOGUSMMU) {
X      tag = GetSysTag();
X      aliens = (GetTC() & TC_ENB) && !tag;
X   }
X
X   if (mmu && mmu != BOGUSMMU) DoROMStuff(tag);
X   PrintSystem();
X   if (verbose && cpu >= 68020 && (GetTC() & TC_ENB)) PrintFastROM();
X   quit(quitcode);
X}
X
END_OF_FILE
if test 23981 -ne `wc -c <'SetCPU.c'`; then
    echo shar: \"'SetCPU.c'\" unpacked with wrong size!
fi
# end of 'SetCPU.c'
fi
if test -f 'SetCPU.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'SetCPU.txt'\"
else
echo shar: Extracting \"'SetCPU.txt'\" \(20967 characters\)
sed "s/^X//" >'SetCPU.txt' <<'END_OF_FILE'
X
X			 SetCPU V1.60
X			by Dave Haynie
X			June 15, 1990
X
X	SetCPU V1.60 is a program designed for identification and
Xmodification of system parameters roughly related to different versions 
Xof the Motorola 68000 family processors.  The program will identify the 
Xvarious types of processors and coprocessors in any 680x0 system.  It also
Xmakes an attempt to correctly identify an incorrectly designed but still
Xpossibly functional 68020 system, several of which are known to exist as
XAmiga coprocessor boards.  It contains MMU code to locate kernel ROM in
Xwrite protected 32 bit ROM.
X
X	In any case, the syntax of the program is given as follows:
X
X	SetCPU [INST|DATA] [[NO]CACHE|[NO]BURST] [CONFIG n]  [BITS n] [TRAP n]
X	       [KICKROM path|dfN: [DELAY n] [KEEPEXEC]] [CARDROM path] [VERBOSE]
X	       [[NO]FASTROM [path] [KEYPATCH n] [HEAD] [NOSTACK]] [ROMBOOT]
X	       [CHECK 680x0|68851|6888x|MMU|FPU|MMUON|MMUROM|MMUALIEN]
X
Xwhere "[]" indicates an optional parameter, "|" indicates a choice of
Xparameters.  Typing "SetCPU ?" will retrieve this same syntax diagram.
XTyping SetCPU alone will result in the SYSTEM configuration being 
Xsend to the console, my current system returns this:
X 
X    SYSTEM: 68030 68882 FASTROM (INST: CACHE NOBURST) (DATA: CACHE NOBURST)
X
XThis indicates I have a 68030/68882 system, I've previously installed the 
XFASTROM translation, and both caches are turned on.  Issuing the command
X"SetCPU FASTOM CACHE" would recreate such a setup.  Note that any parameters
Xthat don't make sense to the real system configuration, such as asking to
Xmodify the data cache on a 68020 system or install the FASTROM translation 
Xon a 68000 system are just ignored.
X
X[0] CHANGES
X
X	Since the V1.50 release of SetCPU, the following changes have been
Xmade to the SetCPU program:
X
X	- FASTROM now supports loading of a ROM image file.
X
X	- The patch manager has been removed, except for the KEYPATCH
X	  option.
X
X	- ROMs beyond 256K are now supported, from both file and special
X	  KickStart disk.
X
X	- ROM images are supported assembled for various memory locations,
X	  so that Commodore's developer files assembled at $00F00000, for
X	  example, will work.  SetCPU determines the size, base, and
X	  jump address of a ROM independently.
X
X	- ExecBase can be erased on KICKROM resets to prevent Chip RAM
X	  sizing problems and other OS switching errors.
X
X	- A programmable KICKROM DELAY option allows KICKROM to work on
X	  better on some machines with extremely slow 8520 startup times.
X
X	- Caching for any Bridge Card memory will always be disabled.
X
X	- The system stack, if found in Chip memory, is relocated to Fast
X	  memory for FASTROM translations.
X
X	- Some 2.0 functions are activated when run under the 2.0 OS, so
X	  that most if not all of the basic SetCPU functions operate 
X	  properly.
X
X	- The MMU code is intelligent enough to avoid trashing an MMU setup
X	  not generated by SetCPU.
X
X[1] DISTRIBUTION
X
X	This program is placed in the public domain, and may be used or
Xdistributed as you like.
X
X
X[2] CPU IDENTIFICATION
X
X	There are two basic types of functions performed by SetCPU.  The 
Xfirst of these is CPU system identification and cache control.  SetCPU will 
Xtell about the type of CPU setup in your machine, which consists of the CPU
Xitself and sometimes FPU or MMU coprocessors.  If the CPU supports caches,
XSetCPU will let you switch these caches, and associated cache line burst mode,
Xon and off.  Finally, SetCPU can be used in a Startup-Sequence or other script
Xto make decisions based on the system that's running.  This is quite useful 
Xwith accelerator cards like the Commodore A2620 that let you boot the machine
Xwith either 68020 or 68000 in charge.  The individual CPU group commands are 
Xgiven below in detail:
X
X[NO]CACHE
X	This command will switch on or off 68020 and 68030 caches.  If not 
X	qualified, it'll act on both instruction and data caches of the 68030.
X
X[NO]BURST
X	This command will switch on or off the burst cache line fill request 
X	of the 68030.  If not qualified, it'll act on both instruction and 
X	data caches.
X
XINST
X	This qualifies a CACHE or BURST operation to restrict its application
X	to the instruction cache only.
X
XDATA
X	This qualifies a CACHE or BURST operation to restrict its application
X	to the data cache only.
X
XCHECK 
X	This option lets you check for the existence of a particular CPU 
X	system component in a script.  It works like this:
X
X		SetCPU CHECK 68020
X		If WARN
X			echo "No 68020 here!"
X		Else
X			echo "Sho nuff got a 68020 here!"
X		Endif
X
X	The arguments to CHECK can be any of:
X
X		68000	    Matches the obvious
X		68010	    "
X		68020	    "
X		68030	    "
X		68040	    "
X		68851	    "
X		68881	    "
X		68882	    "
X		FPU	    Matches 68881, 68882, or 68040
X		MMU	    Matches 68851, 68030, or 68040
X	        MMUON	    Matches any case in which the MMU is enabled
X		MMUROM	    Matches an active SetCPU ROM translation
X		MMUALIEN    Matches any MMU setup no created by SetCPU
X
XIf any cache parameter doesn't apply to the system in use, it'll just be
Xignored.  Use the data cache and all burst modes with caution.  Some 
X68030 systems aren't designed to correctly support the data cache, so
Xswitching it on may cause an instant system crash.  Even on systems that
Xcorrectly support the 68030 data cache, some device drivers, especially
Xthose for DMA devices, may not work properly with the data cache enabled.
XYou may wish to check with your system vendors to make sure before using
Xthe data cache in your standard system setup.  The Commodore A2091's device
Xdriver does correctly support data caching.  However, the use of the data
Xcache is not recommended without an MMU setup, such as FASTROM or one of
Xthe KICK setups, invoked.  The Amiga OS uses memory that's the same in
Xboth Supervisor and User modes of the 680x0.  This requires the setting
Xof the 68030's Write Allocate bit for safe operation, and SetCPU will
Xalways insure that Write Allocate is set.  However, this mode causes the
Xdata cache to be updated on longword writes even for locations that are
Xdriven noncacheable in hardware.  So data caching without a proper MMU
Xsetup can cause problems with some I/O devices.  With the MMU setup, 
XSetCPU will map the standard Amiga I/O regions as noncachable.
X
X	SetCPU may report a "FPU Logic Error" on certain 68020 systems.  
XThis is indicating a hardware problem with that board's floating point 
Xcoprocessor decoding, which results in the FPU responding to the MMU 
Xaddresses as well as its own.  SetCPU knows how to handle such a board,
Xbut future software using the MMU may not, so it's a good idea to report
Xthis problem to the board vendor for repair.
X
X
X[3] ROM TRANSLATIONS
X
X	The second thing that SetCPU V1.60 manages are ROM translations.  
XUsing the MMU on systems so equipped, it can locate the Kernel ROM in the
Xmuch faster 32 bit wide memory provided on many 32 bit systems.  It can
Xalso boot a ROM based system with an alternate version of KickStart.
XMost of the options here relate to MMU translation setup and various 
Xmodifications of the basic translation premise.
X
X	As of this release, SetCPU's MMU configurations will support
Xmemory outside of the 68000's 24 bit address space, when it is present.
XSuch memory will be automatically recognized and supported by SetCPU if
Xit is linked into the free memory lists when SetCPU builds its FASTROM
Xor KICKROM.  Alternatively, the number of significant bits of address
Xin the system can be specified by the BITS command, and SetCPU will
Xbuild the appropriate MMU table for such a system.
X
X	Another feature of this release is support for ROM images of either 
X256K or 512K in size.  KickROMs may be assembled for locations other than the
X$00FC0000 or $00F80000 base used by physical systems.  SetCPU will compute
Xthe size, base address, and start address for any KickROM image.  ROM
Ximages can now be loaded from disk for FASTROM translations as well as
XKICKROM translations, though a FASTROM image must be the same KickStart
Xrelease as the current ROM in the system.  This facility's main purpose is
Xto support loading of patched ROMs with the necessity of rebooting via
XKICKROM.  As a result of this, the only patch now done by SetCPU itself is
Xthe optional KEYPATCH, which may be required for proper operation of the
Xaccelerated ROM code on some systems. 
X
X
X[NO]FASTROM
X	This activates the FASTROM translation on or off an MMU equipped 
X	system.  When switching on, it first allocates at least 256K of 
X	memory for the ROM image, then at least 512 bytes of memory for the
X	MMU table.  It copies the ROM into the image area, then applies the 
X	translation by pointing the MMU at the table and activating it.  The 
X	NOFASTROM option will switch off the MMU and reclaim the memory used 
X	for the ROM image and MMU table.  If any other program set up the MMU
X	for something, invoking this option could be a very bad thing to do.
X	In general, until there's some level of OS support for the MMU in 
X	Amiga systems, you're really safe using only one MMU tool at a time.
X	If you have an A2620 or A2630 system, this option will always get 32
X	bit memory for you; if not, you'll have to make sure that your 32 bit
X	memory is the first MEMF_FAST memory in the memory list for it to be 
X	used for the ROM image.  Also, that ROM image will be allocated as far
X	back on that memory list as possible unless the "HEAD" option is 
X	specified.  The SetCPU "SYSTEM" line will report this setup as a
X	"FASTROM" setup.
X
XSuboptions are:
X
X	file
X		Specifying a file with a valid ROM image will load that ROM
X		image instead of the system's physical ROM image.  The one
X		restriction is that the disk-loaded ROM image must be the
X		same ROM revision as the current system ROM.  If they aren't
X		the same revision, the KICKROM option can be used instead,
X		but that'll require a reboot.  This option can be used to
X		load a patched version of the current ROM without reboot in
X		most cases. 
X
X	KEYPATCH n
X		This will patch the keyboard scanning routine for machines 
X		that have Cherry keyboards (small function keys).  The "n"
X		parameter allows a variable delay between 1 and 100 to be
X		specified; the delay depends on the keyboard, but should
X		be pretty independent of CPU speed.
X
X	NOSTACK
X		This will prevent the attempted translation of supervisor
X		stack into 32 bit memory.  By default, such translation will
X		be done if the supervisor stack is found in Chip memory.
X	
X
XCARDROM path
X
X	When used in conjunction with the FASTROM option, this allows ROMs
X	from expansion cards to be located in fast memory as well.  The
X	path should reference a file containing lists of expansion cards
X	that should be translated if found.  It's necessary to read this
X	from a user-defined file, rather than from the expansion environment
X	itself, since an expansion device's ROM could be located close to
X	that device's registers; there's no way for SetCPU to know it's
X	safe to translate a card ROM image unless you tell it.  On my system
X	I read a file called CardROMList, which currently contains the single
X	line:
X
X		0x202 0x01 0x10000 0x8000 0x4000 CBM_2090A_Disk_Controller
X
X	All the numbers given are in C language hex format.  The parameters
X	are, in order, the device's manufacturer code, product code, the
X	device's size (in bytes), the ROM's offset from the configured board's
X	base address (in bytes), and the size of the ROM area to be
X	translated (in bytes).  The final item is text string to identify
X	the device; this'll be displayed by the VERBOSE option if the ROM
X	translation does in fact take place.  The "_" characters in the
X	name will be translated to " " characters.  Note that the CardROM
X	translations are currently based on 16K chunks, and SetCPU will
X	ignore requests for translations of less than 16K, and round down to
X	16K boundaries for larger translation requests.  
X
XHEAD
X	This option causes the SetCPU memory allocator to attempt memory
X	allocation for its translated objects from the start of 32 bit
X	memory instead from the end, as it usually does.  Allocation from 
X	the end usually results in less fragmentation than from the start
X	(due to the alignment restrictions of MMU objects), though this
X	option is useful when dealing with merged memory lists.  It is
X	ignored when the ROM image and tables are in chip/$00C00000 memory.
X
XKICKROM path|dfN:
X
X	The KickROM option allows the system to be restarted with an
X	alternate ROM image.  This can be from a KickStart disk in a
X	specified floppy drive, or from a given file name.  If the
X	ROM image is accessible, this command will cause the system to
X	be immediately rebooted into the new OS.  Note that pre-1.3
X	versions of the Amiga operating system will probably have some
X	trouble with expansion cards, especially autoboot cards.  For
X	that reason there's the CONFIG 0 option, which is explained
X	later.
X
X	The KICKROM command will reboot the machine with the new OS, but
X	that ROM image will be physically located in either memory at
X	$00C00000, if it's available, otherwise it'll use Chip memory.  Once 
X	the new OS has started up, issuing either "SetCPU FASTROM ..." or
X	"SetCPU KICKROM..." will cause that image to be moved into fast
X	memory, and the slow memory will be given back to the system.  The
X	SetCPU "SYSTEM" line will report a 16 bit KICKROM image as a
X	"SLOWKICK", and a 32 bit KICKROM image as a "FASTKICK".  A machine
X	running from a SLOWKICK kernel can't be re-KICKROMed, but can be
X	from a FASTKICK kernel.
X
XSuboptions are:
X
X	DELAY n
X		This option sets the delay after reset before any code is
X		run.  The parameter may be set from 0 to 100, where 0 sets
X		no delay.  The default value is 10, which sets the delay
X		value used in SetCPU V1.50.  The need for a delay depends
X		on the machine you're on.  If your machine hangs after
X		SetCPU loads KickStart, there's a real good chance that
X		you need a longer delay.
X
X	KEEPEXEC
X		Normally, KICKROM will clear the ExecBase pointer, to cause a
X		the new version of the ROM to be rebuild from a cold boot
X		condition.  This option prevents that clearing action.
X		
XCONFIG n
X	This option controls if and how expansion devices are recognized on 
X	a KICKROM boot.  At the default configuration level, level 2, the
X	expansion cards are left alone, allowing the new Kernel to try and
X	configure them.  Since some older operating system will choke on 
X	autoboot devices, this option will allow suppression of them for the
X	rebooting process.  When requesting a KICKROM boot, a CONFIG level
X	of 0 or 1 will prevent the devices from being recoginzed.
X
X	Once rebooted in the new OS, moving from a SLOW	to a FAST Kick image,
X	as described above, the CONFIG status will be honored.  If the
X	devices weren't suppressed, nothing special happens.  If they were,
X	they'll stay suppressed, and you very likely won't have the memory
X	to support a FAST Kick image.  Specifying a CONFIG level of 2 at
X	this point will attempt to configure the devices without autobooting.
X	At level 1, the devices will be made visable to the system again,
X	but nothing will be done with them.
X
X	As of the latest release, CONFIG 0 appears to be required with the 
X	1.2 operating system, at least if there's any autoboot device, even if
X	you're attempting to move from a slow to fast kick image.  The next 
X	release will attempt to allow 1.2 to configure non-autobooting devices
X	at this point.
X
XTRAP n
X	This option controls the level of error trapping handled for 
X	you by the SetCPU system.  The numeric parameter is actually 
X	optional for compatibility with SetCPU V1.4.  If no TRAP is 
X	specified, the default level 2 is enacted.  If the TRAP command is 
X	given without a parameter, trap level 0 will be setup.  
X
X	Trap level 0 causes the MMU to look at all 32 bits of address;
X	access to any memory outside of the 24 bit space will result
X	in an exception, which if unhandled, results in a GURU 2.  Trap
X	level 1 will set up the MMU to only look at 24 bits of address space. 
X	Trap level 2 works like level 1, but additionally sets up a trap
X	handler for the Bus Error exception (which usually surfaces as a
X	GURU #2).  For normal operation (eg, running other people's code),
X	Trap level 2 is probably what you want.  For final testing of your
X	own code, levels 0 or 1 can catch things which would go unnoticed
X	on a 68000 machine, such as writing to ROM space or out of the 24
X	bit address space.
X
X	The exception handler used for level 2 trapping catches things like
X	writes to protected areas of memory.  It just tells the bus machine
X	not to complete the write, and signals no error.  There's a slight
X	chance that this won't be enough repair for a program doing something
X	really outlandish -- at that point, running at level 1 will let the
X	GURU happen, which might help if you're debugging your own code.  
X	Other that that, there's probably nothing you can do to get such a
X	program working with the MMU turned on, other than having it fixed.
X	The other thing to consider is that this exception handler could
X	conflict with another system-level handler installed by a GOMF-like
X	program.  That shouldn't cause a big problem, since you'll the one
X	that was installed later, both of which presumably trap the error,
X	but it's something to be aware of.
X
X	Under V1.3 and earlier releases, a DOS bug can cause invalid accesses,
X	which cause the exception, when running the EndCLI or NewCLI/NewShell 
X	programs; running at level 1 or 2 will avoid gurus with these commands.
X
X
XBITS	n
X	This option forces the MMU table for KICKROM or FASTROM to be built
X	to support a specific number of bits, regardless of the actual bits
X	apparently used by the system.  Valid significant bits range from 24
X	through 32.
X
XROMBOOT
X	This option forces a reset to physical ROM without hanging the system,
X	even when the MMU is active.
X
XVERBOSE	
X	This option more fully describes the system translations. 
X
X
X[4] ROM FILE FORMATS
X
X	The 256K KickStart disk the KICKROM option will look for is the
Xstandard Commodore KickStart format, which is a standard format floppy
Xwith the work "KICK" at the start of the disk, followed by 512 blocks of
X512 bytes each, a plain dump of the ROM image.  512K KickStart disks 
Xlook just the same, only, of course, with 512K of ROM.  The KickStart
Xloader will actually check the first 32 blocks of disk for the start of
XROM.
X
X	The size of the KickStart image is determined by the first longword
Xof the file.  Optionally, disk files can contain two extra longwords at the
Xbeginning of the file, the first being a $00000000, second the expected 
Xsize of the ROM image.  That expected size will be compared with the expected
Xbased on the first longword in the ROM image and the actual length of the
Xloaded file, in the case of a disk file rather than a KickStart. The base
Xaddress and starting address are determined from the ROM image, and SetCPU
Xwill attempt to use them.  Some ROM images can cause a conflict with other
Xsystem resources.
X
X[5] CREDITS
X
X	While this program is an entirely original work, nothing happens in
Xvaccuum, this one included.  I'd like to mention folks who, directly or
Xindirectly, helped make this thing happen, by providing example MMU code,
Xsuggestions, and incentives.  These folks include Neil Katin, Jez San,
XGVP Inc., Dale Luck, Bryce Nesbitt, Andy Finkel, and the other Commodore-Amiga 
Xsoftware people, and the Commodore-Amiga Technical Support folks.
X
X[6] POTENTIAL BUGS AND OTHER NOTES
X
X	I should point out here that much of what SetCPU does is of a rather
Xdubious nature.  Everything that's possible to do correctly under the 2.0 
Xrelease of the OS, including CPU/FPU identifications and cache control, is
Xdone via the approved 2.0 methods when running in 2.0, and via my own tricks
Xwhen run under 1.3 or earlier releases.  
X
X	While it's impossible for an application to correctly use the MMU under
X1.3 or 2.0, SetCPU attempts to be intelligent about its use of the MMU.  It 
Xwill check for the use of the MMU by an agent other than SetCPU, and refuse to
Xmodify the current MMU setup if such an alien MMU setup is found.  For systems
Xwith an unused MMU, SetCPU will do it's best to be safe about the modifications
Xit makes to the memory map.  There may be problems with this program's MMU
Xcode on the Amiga 3000, but based on the SuperKickStart and CPU programs that
Xare shipped with the first A3000s, this should not be of immediate concern,
Xsince the A3000 comes with equivalent functionality.  Should an A3000-safe 
Xversion of SetCPU eventually become needed, I'll make the attempt to track
Xdown any A3000 bugs I can find.  Just because you help design a machine doesn't
Xnecessarily mean you have one to code and test on at home.
X
X	Finally, if you wish to contact me regarding bug reports, new
Xreleases, contributions of cash or macadamia nuts, or pretty much anything
Xelse, I can be reached at the below addresses.  
X
X
X			-Dave Haynie
X
X		Logical Address:
X			 PLINK:		hazy
X			 bix:		hazy
X			 usenet:	{uunet,rutgers}!cbmvax!daveh
X
X		Physical Address:
X
X			 284 Memorial Drive
X			 Gibbstown, NJ
X			 08027
END_OF_FILE
if test 20967 -ne `wc -c <'SetCPU.txt'`; then
    echo shar: \"'SetCPU.txt'\" unpacked with wrong size!
fi
# end of 'SetCPU.txt'
fi
echo shar: End of archive 3 \(of 4\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.