home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
util
/
misc
/
set040
/
set040.doc
< prev
next >
Wrap
Text File
|
1993-12-21
|
43KB
|
988 lines
PROGRAM
Set040 (2nd Release)
The command syntax of this new release of Set040
is not compatible with the older V1.xx releases of
Set040. Please read this entire document file so you
can become familiar with the new syntax.
SOURCE
Written in Assembly Language using Macro68 V3.170
AUTHOR
Nic Wilson
Nic Wilson Software
P.O. Box 1164
TOOWOOMBA QUEENSLAND 4350
Australia
EMAIL cbmaus!cbmozq!wilson!nicw@cbmvax.commodore.com
CBMNET nicw@wilson.adsp.sub.org
TELEPHONE/FAX +61 76 358539 After Hours Australian Time
DISTRIBUTION
This release of Set040 is shareware and freely distributable.
Electronic distribution is allowed.
DISTRIBUTION
Permission is hereby granted to distribute this program on the
condition that no profit is gained gained from its distribution.
All document files must accompany it and remain unchanged. If the
document files are crunched, then a suitable de-cruncher must also
be supplied with them that works on ALL CPU version Amigas.
It MAY NOT be distributed on those so called 'copyright' non
distributable PD disks. It MAY be distributed on a BBS as long as
that BBS does NOT have individual charges for downloading of files.
Please send any bug reports or ideas to the address at the top of
this file.
Commercial companies may also distribute the program without
permission, but I would appreciate being notified so I can
inform you of updates.
* * * DONATIONS * * *
---------------------
TO DATE THE DISTRIBUTION AND USAGE HAS BEEN LARGE, BASED ON THE
AMOUNT OF EMAIL AND UPGRADE ENQUIRIES I HAVE RECEIVED, AND YET I
HAVE RECEIVED VERY FEW CONTRIBUTIONS. COME ON GUYS, I SPENT 12
MONTHS WRITING THIS PROGRAM AND I AM STILL UPDATING AND ENHANCING
IT.
A dontation of $25.00 American or equivalent is suggested, OR if
you cannot afford that, any amount will be gratefully accepted.
Overseas users, please DO NOT send personal or EuroChecks. They
are very difficult and expensive to cash. Please send an overseas
bank draft in Australian Dollars drawn on any Australian bank. Your
local bank should be able to help you with this.
Any cash currency is acceptable as it is very easy to convert to
Australian.
The following credit cards are accepted.
OVERSEAS -> MASTERCARD, VISA.
AUSTRALIA -> BANKCARD, MASTERCARD, VISA.
These cards can be accepted by mail, email or phone. Confidentiality
is guaranteed. If using credit card, please include the card number,
the expiry date and the name as it appears on the card.
Donations in the form of software or hardware is also acceptable. I
write many reviews here in Australia and quite often give free plugs
to companies that have been generous enough to donate to my work.
COPYRIGHT
This program, and its source code & document files are
Copyright (C) Nic Wilson Software 1991-1993.
FUNCTION
1. To remap Kickstart V2.04 or greater from ROM into
FAST RAM on an Amiga equipped with a 68040 CPU, using
the MMU, with options for various functions.
This remapped kickstart gives a vast improvement in
the speed the 68040 can access kickstart, and faster than
any hardware re-mapping of Kickstart.
2. To remap Kickstart V2.04 or greater on an Amiga equipped
with an A3640 card such as the A4000 and to survive a
reboot without using the MMU.
3. FASTROM can be done in a default memory efficient mode,
or a full map addressing mode.
4. To allow the FASTROM remap to be removed and
all resources reclaimed.
5. To load and remap, a different Kickstart from disk or file
and use the MMU to boot into this Kickstart. Kickstarts
1.2, 1.3. 2.04, 3.0 or greater are supported. An option
to completely survive a reboot is supported.
6. To manipulate both the 68040 caches and the various modes.
7. To display brief or verbose information regarding the
setting of the MMU remap, and 68040 registers and modes.
8. To switch between the 68040 and 68030 on any Progressive
Peripherals & Software 68040 card.
9. To sum up, this program gives the user of a 68040 the
facilities he lost when ROMS were fitted, plus some
extra ones and with greater flexibility.
Page 1
CONTENTS
Disclaimer.............................................. 2
Acknowledgements........................................ 2
Archive................................................. 2
Requirements............................................ 2
Other info.............................................. 2
Usage................................................... 3
Default................................................. 3
Option availability..................................... 3
A4000 MAPROM............................................ 3
Example of A4000 startup-sequence entry................. 3
Full definitions........................................ 4
FULLMAP OPTION.......................................... 6
Kickstart logical and physical Write-Protection......... 7
Kickstart 1.2 and 1.3................................... 7
Kickstart 2.0x.......................................... 8
KICKROM to FASTROM...................................... 8
Reset survival.......................................... 8
Program examples........................................ 9
Example of installing FASTROM........................... 9
Example of installing KICKROM........................... 9
Example of converting a KICKROM to FASTROM.............. 9
Example of converting a KICKROM to FASTROM FULLMAP...... 9
Example of installing the reset handler................. 9
Example of startup-sequence entry....................... 10
Example of removing the reset handler................... 10
Example of Cache manipulation........................... 10
Example of removing a FASTROM........................... 10
Example of switching from 68040 to 68030................ 11
Improvements............................................ 11
Technical notes......................................... 12
The DEFAULT setup....................................... 13
The FULLMAP setup....................................... 14
Trademarks and References............................... 14
DISCLAIMER
Although I beleive this software performs the functions
described in this document file, the program is supplied
"as is" without any warranty on performance of any kind,
either implied or expressed. Nic Wilson Software will not
be liable for any damages, including lost profits, lost
savings or other incidental or consequential damages arising
from the use or inability to use such software, even if
Nic Wilson Software has been advised of the possibility
of such damages, or for any claim by any other party.
This disclaimer supercedes any other document or disclaimer
on previous versions either written or verbal.
ACKNOWLEDGEMENTS
Thank you to Dave Haynie and Michael Sinz for their answers
to my questions regarding the 68040 over EMAIL.
Thank you to Progressive and Peripherals and Software for
their generosity with the A3000/68040 cards.
Thank you to my friend Paul Coward (Digisoft) for a brilliant
assembler, Macro68 V3.170. Set040 assembles with an average
pass time of 0.41 secs to executable, and without it 68040
code in new syntax would have been difficult.
Thank you to William J Coldwell for his enhancement suggestions
and for information on errata documents on the 68040 CPU.
REQUIREMENTS
Depending on the function, the requirements to launch
particular functions are different and are as follows:-
FASTROM AmigaDOS V2.04 or greater, 68040 CPU, 1MB FAST RAM minimum
KICKROM AmigaDOS V2,04 or greater, 68040 CPU, 1MB CHIP RAM minimum
KICKROM
to FASTROM AmigaDOS V1.2 or greater, 68040 CPU, 1MB FAST RAM minimum
MAPROM AmigaDOS V2.04 or greater and an A3640 card or A4000.
TOGGLECPU AmigaDOS V2.04 or greater, with any PP&S 68040 card *
* If an A3000 card, the A3000 must be a 25MHZ model, NOT 16MHZ.
OTHER INFO
This program was written and tested on an Amiga A3000 with a
Progressive Peripherals & Software 68040 25MHZ card and with a
PP&S Mercury card. More recent versions are written and tested on
the Amiga 4000. It is currently working on, and being regularly
tested on a CSA 40/4 Magnum Pro. If it works on your card please
let me know. If it doesn't, let me know too and maybe we can rectify
it for yours and other 68040 cards.
Page 2
USAGE
Set040 [FASTROM option option ...]
[KICKROM [path|DFx: FORCE]]
[MAPROM path/file FORCE]]
[option option ...]
FULLMAP [NO]REVERSE, [NO]DCACHE, [NO]ICACHE, [NO]CACHE [NO]ZCACHE,
[NO]RESET, [NO]COPYBACK, [NO]ATCCBACK, [NO]DTT0CBACK, [NO]DTT1CBACK,
NOCLICK, NOTITLE, TOGGLECPU, NOFASTROM, VERBOSE, HELP
All options can be supplied in either upper or lower case.
Command line examples are given on Page 9.
Some options can only be used with certain settings and are
shown below.
DEFAULT:
If no options are supplied, Set040 will display its default
brief information on the current settings. Copyback modes are
not shown in this display. They are shown in full with the
'VERBOSE' option.
OPTION AVAILABILITY
These options are only valid as sub-options to FASTROM or KICKROM
NOCLICK, NOTITLE, [NO]RESET
This option is only valid as a sub-option to KICKROM
FORCE
These options are only valid as sub-options to FASTROM
FULLMAP [NO]REVERSE
These options are available as sub-options to FASTROM or KICKROM,
or separately after a FASTROM or KICKROM installation to modify
current settings.
[NO]DCACHE, [NO]ICACHE, [NO]CACHE [NO]ZCACHE, [NO]COPYBACK,
[NO]ATCCBACK, [NO]DTT0CBACK, [NO]DTT1CBACK
These options are only valid separately.
TOGGLECPU, HELP, VERBOSE
This option is only valid after ROM-FASTROM installation.
NOFASTROM
Page 3
DEFINITIONS
FASTROM - Remaps the current ROM or KICKROM kickstart to FAST
RAM. Without any further options the default
configuration of CACHE NOZCACHE COPYBACK will be
installed. If other options are used, they must
follow this option. The setup can be either the
default mapping for FULLMAP mapping.
FULLMAP - Installs complete mapping for the entire 4 Gig space
If you are using 68040.library 37.10 or greater, this
option is redundant and will just waste memory. Use a
default setup when using these versions of the library.
See the 'FULLMAP OPTION' heading on Page 6 for more
information on this option.
NOFASTROM - Remove the FASTROM setup and free all resources.
This option is not valid for KICKROM-FASTROM.
[NO]REVERSE - Allocate memory for FASTROM from either the top
(REVERSE) of the memory map or from the bottom
(NOREVERSE) of the map. If this option is not
specified, it will default to REVERSE. Always use
the default first, unless you have trouble surviving
a reset, and then try the NOREVERSE option.
[NO]DCACHE - Enable or disable the DATA CACHE.
[NO]ICACHE - Enable or disable the INSTRUCTION CACHE.
[NO]CACHE - Enable or disable both the INSTRUCTION & DATA CACHES.
[NO]ZCACHE - Enable or disable caching the ZorroII address area.
[NO]RESET - Install or remove the reset handler.
[NO]COPYBACK - Enable or disable Copyback globally (DTT0, DTT1 & ATC).
[NO]ATCCBACK - Enable or disable Copyback for:
default - $01000000-$03FFFFFF.
FULLMAP - $01000000-$3FFFFFFF.
[NO]DTT0CBACK - Enable or disable Copyback for:
default - $08000000-$0FFFFFFF.
FULLMAP - $40000000-$7FFFFFFF.
[NO]DTT1CBACK - Enable or disable Copyback for:
default - $04000000-$07FFFFFF.
FULLMAP - $80000000-$FFFFFFFF.
NOCLICK - Stop the floppy drives from clicking. This is a
better way than the various noclick programs that
are around (including my own), as experience shows
that changing the flags in the TDU_ structure actually
slows the response time of the drive seeing a diskchange.
NOTITLE - Disable changing the Workbench title.
TOGGLECPU - Toggle the 030 & 040 modes (PP&S 040 CARD ONLY).
HELP or ? - Displays brief help on various options.
VERBOSE - Verbose listing of current settings. This option will
display the current settings, the type of caching for
memory areas, some of the 68040 registers and the
kickstart mapping addresses.
FORCE - This is an option to KICKROM, it forces a new KICKROM
to be installed, when a KICKROM is already installed.
This saves the long process that used to be required to
do this. This has been done as an option, so that the
kickrom line in your startup-sequence will not take
effect on subsequent resets.
MAPROM Takes a single parameter, of the kickstart file to be
loaded. This function requires an A3640 card or A4000.
If no parameter is specified then a default of
'DEVS:kickstart' will be loaded. If the current version
of kickstart is the same as the file and error will result
unless the FORCE option is specified.
NOTE. The MMU *must* be off for this option to
work, boot with no startup-sequence before attempting
it, or place is conditionally before 'setpatch' in
the startup-sequence.
EXAMPLE OF STARTUP-SEQUENCE ENTRY
IF EXISTS C:Set040
Set040 MAPROM DEVS:kickstart
ENDIF
SetPatch QUIET
Page 4
KICKROM [path|DFx:] -
Loads and remaps a kickstart to CHIP RAM then reboots into the
new kickstart. This option is always valid, except, when KICKROM
is already installed the FORCE option must be specified. After
installation, it may be moved to fast ram by using the FASTROM
option. If you have a board that has hardware fastrom ability,
this must be disabled before any attempt to use the KICKROM option.
The KICKROM option is capable of remapping a kickstart to any
address. This is transparent to the user as the program checks the
kickstart and extracts the address it is destined for, and maps it
to that address. You do not need memory at this address, it will
be mapped to that address with the MMU. Set040 has the ability to
use the kickstart files that come supplied on the "Kickfile" disk,
although if these are used on an A3000 the hard disk will not boot
and your fast memory will not be available. A3000 users should make
kickstart files from superkickstart disks, using the 'Update2.x'
program.
This function requires an Amiga with at least 1MB of chip memory
for it to work. It will attempt to allocate about 576k of
memory within the chip memory area as high as possible. The
allocated chip memory from this allocated block to the end of
the next one megabyte boundary, will be hidden from exec after
the reboot. When Set040 is used again, to convert KICKROM to
FASTROM, this hidden memory will be added to the free pool. If
your chip memory usage is large, Set040 may not be able to obtain
the required memory. If this happens I suggest closing as many
programs as possible or re-booting with a minimum set-up so that
Set040 can allocate the memory it requires.
Even though we are about to re-boot, into a new kickstart, Set040
will NOT just take the ram required, as this may cause a crash.
If the memory allocated, falls within the first megabyte on an Amiga
with two megabytes of chip ram, the second megabyte will be lost
completely unless added in with the 'addmem' command. This should
not happen under normal circumstances, as Exec normally allocates
memory from lower addresses first. This means that the memory
allocated by Set040 should always fall within the highest one
megabyte block. Although when this KICKROM is converted to FASTROM,
all the chip memory will be added back to the free pool, including
the top megabyte.
When installing the kickstart, a screen showing a 68040 CPU picture
informing you of the loading will be shown , then it will inform you
that the kickstart is being patched to prevent the MMU from being
disabled, and then, that system will be rebooted. During this reboot,
there will be a 3 second delay and then the power light will flash
rapidly to inform you that this function is operating successfully.
See 'FORCE' option also.
path =
If a path/filename or DFx: is not given, then Set040 will attempt
to load a default kickstart file 'DEVS:kickstart'.
Full path and filename to a Kickstart file.
The Kickstart file can be a 256K file (1.2 or 1.3) or a
512k file (2.0x) as saved by the "Update2.x" or "Update1.3"
program supplied with your A3000.
DFx: =
Instead of a filename, the kickstart can be loaded from an
A3000 SuperKickstart disk or an A1000 Kickstart disk. If a
SuperKickstart is used a requester window will open and prompt you
for the Kickstart version you require. These choices will be "V1.3"
or "V2.0". If the drive you specified does not have a disk in it,
you will be prompted for a disk via a requester.
Page 5
FULLMAP OPTION
This option required more explanation than could be given in the
definitions above. The 'FULLMAP' option is valid as a sub-option
to the FASTROM option, for a ROM remap or a KICKROM remap.
*********************************************************************
If you are using 68040.library 37.10 or greater, this option is
redundant and a default setup should be used. If this option is used
on these version of the library, it will only waste memory, as the
68040.library replaces Set040's MMU setup and does the entire mapping
itself.
*********************************************************************
The default mapping is limited and was a compromise as explained
in the Technical notes on page 12. The FULLMAP option allows for
a full mapping of the entire 4 Gigabyte address space of the 68040
processor. I suggest you read the Technical notes so you may
understand the compromises that had to be made for a default setup.
The FULLMAP option has addressed the mapping in an entirely
different way to the default setup. This full setup will require
just over one megabyte of fast memory in order to install the
FASTROM. This megabyte includes the room required for the
Kickstart image, and will be allocated from the highest address
possible, (unless the NOREVERSE option is given) with the highest
priority memory in the map. This memory however must be 'LOCAL'
memory. If not enough LOCAL memory is available, the attempt will
fail.
LOCAL memory is that type of memory that does not "disappear" upon
a reset, and gets it name because it is usually local to the CPU.
Set040 tries to allocate this type of memory by adding the
MEMF_LOCAL bit to the attributes when calling AllocMem.
One quarter of the memory map is controlled by the ATC, and these
addresses are $0 to $3FFFFFFF. These addresses include those locations
known as 24 Bit address space, Commodore Reserved areas, A3000 Mother
board Fast ram, CoProcessor Slot Expansion, and a portion of the
ZorroIII Expansion area. This means that the ATC is now contolling
all areas that the default setup allowed altogether, plus a portion of
the map that was invalid in the default setup.
The rest of the ZorroIII Expansion area, from address $40000000 to
$7FFFFFFF is controlled by the DTT0/ITT0 registers. The rest of the
address space from addresses $80000000 to $FFFFFFFF are controlled by
the DTT1/ITT1 registers and this area is known as 'Reserved by
Commodore'.
All areas above the 24 Bit address space will default to
cachable copyback unless other options are specified. Remember
that the options to control ATC, DTT0 and DTT1 copyback are
still valid with this option, but they will be controlling
different areas of the map as explained above. Normally these
options will not be required, because the default settings on boot-up
will be the same as Kickstart normally uses for the 68040. If these
options are given after the installation, the 'VERBOSE' option
will show the changes that will take affect on a certain area
of the map. After a reset, all modes will be restored to standard,
so these will require changing again, if you do not use default
values.
The FULLMAP option allows the Kickstart image to be protected from
writes, in the physical location as well as the logical location
as in the default mode, but due to technical difficulties the physical
area is only writeprotected, after each reset, when the FASTROM command
is given. Even though FASTROM is already installed, when it is
launched again in the startup, Set040 will recognise that the FASTROM
is still installed and will make certain tests. One of these tests
includes setting the physical location as writeprotected. The
VERBOSE option of Set040 shows the logical and physical area settings
for you to check. See below (Page 7) for more on this subject.
* * * IMPORTANT * * *
You MUST read the document file for the SetPatchPatch program supplied.
Page 6
KICKSTART WRITE-PROTECTION
The logical address of kickstart will always be marked as write-
protected and the error handler will trap any write accesses. The
logical addresses will be marked as write-protected on a FASTROM
FULLMAP installation. The default mapping mode does not support
write-protection of the physical area. During a reset, this write-
protection must be removed, otherwise an exception would occur during
the Kickstart memory test and SCRAM test routines. The removal of
the write-protection is transparent to the user, and is handled by
the reset handler. The write-protection can be re-installed by Set040
if the FASTROM option is given. This would normally happen in the
startup-sequence (See Page 10). When this option is given, Set040
will recognise that a FASTROM is already installed and will check to
see if it is write-protected at its physical location. If not, the
MMU setup will be modified to reflect the write-protected state. If
your startup-sequence entries are similar to the example on Page 10,
this process will be automatic and transparent to the user.
KICKSTART 1.2 - 1.3
************************************************************
** USE 1.3 or 1.2 WITH CAUTION, THEY ARE NOT FULLY COMPATIBLE **
************************************************************
Kickstart 1.2 and 1.3 should not be used on the 68040 without
extreme caution. These kickstart were not designed for the
special cache modes of the 68040. The ability to install them
in Set040 has been supplied for testing purposes, incase a
programmer does not have a 1.3 Kickstart Amiga to test on.
Watch out for 1.3 'SetClock' commands, they will guru the
A3000/68040 every time. Make sure you delete them or replace
them with your A3000 'SetClock' command.
If the new Kickstart is 1.2 or 1.3, only the remaining chip
memory will be available after booting. Any FAST RAM on the
A3000 mother board will not be available. This memory must be
added to the system with the "addmem" command. It has been done
this way incase the fast memory is not required for some reason.
The usage for the 'addmem' command for different memory sizes is
shown below.
When the FAST ram has been added, you may run Set040 again with
optional arguments (See KICKROM to FASTROM).
AddMem usage for A3000 32bit wide fast ram are as follows:
A3000 4MB 32 bit ram = AddMem 7C00000 7FFFFFF
A3000 8MB 32 bit ram = AddMem 7800000 7FFFFFF
A3000 12MB 32 bit ram = AddMem 7400000 7FFFFFF
A3000 16MB 32 bit ram = AddMem 7000000 7FFFFFF
Page 7
KICKSTART 2.0x
If the new Kickstart is 2.0x (V37+) your FASTRAM will still be
available and your hard disk would have booted. The addmem
command will not be required. This set-up will still be in
CHIP ram though, and can be moved to fast memory by running Set040
with the FASTROM and other options.
NOTE:
FOR COMPATIBILITY REASONS, WHEN THE KICKROM to FASTRAM CONVERSION
IS PERFORMED, THE DATA CACHE WILL ONLY BE ENABLED FOR V2.0X
KICKSTARTS, AND WILL BE DISABLED FOR OTHER KICKSTARTS. IF YOU
WISH TO CHANGE THIS, OR MANIPULATE THE OTHER CACHES, USE THE
CACHE OPTIONS.
ONCE THIS KICKROM KICKSTART IS INSTALLED IT CANNOT BE REMOVED WITH
THE NOFASTROM OPTION. ANY ATTEMPT TO DO SO WILL GIVE AN ERROR.
SEE 'NORESET' OR 'FORCE' OPTIONS, OR SEE 'RESET REMOVAL' BELOW.
KICKROM to FASTROM
When a KICKROM set up is first installed, the kickstart
will be in chip memory. In this mode you have three options.
Firstly, may leave it as it is, and it will be lost on the next
reboot. Secondly you may install the reset handler, and the
kickstart will remain in CHIP memory and survive a reboot, or
thirdly you may use the FASTROM option(s) to move it to FAST
memory with a default, or FULLMAP setting, and optionally survive
a reboot.
RESET SURVIVAL
The KICKROM function, by default will not survive a hardware
(keyboard) reset. This can however be installed by using the
RESET option.
Separate installation allows you to install it should you forget,
when doing a KICKROM to FASTROM conversion, or allows you make
a CHIP ram KICKROM setup survive a reboot, without ever converting
to FAST ram. This is useful in situations where enough FAST ram is
not available or the FAST memory does not come on-line early enough
in the reset-boot sequence. If you find that the KICKROM-FASTROM
does not survive a reboot or crashes, then try a CHIP ram KICKROM
setup.
Once installed the current KICKROM kickstart will survive every
reboot until removed with the NORESET option, or changed with the
FORCE option.
PLEASE NOTE THAT THIS HANDLER USES THE COLDCAPTURE VECTOR, AND THE
COOLCAPTURE VECTOR DURING THE RESET PROCESS. SOME ANTI-VIRUS
PROGRAMS (INCLUDING MY OWN NoVirus, PRIOR TO BRAINFILE 066) MAY SEE
SOME POSSIBLE NEW VIRUS IN MEMORY, BUT DO NOT WORRY, IT IS ONLY
THIS RESET HANDLER. THESE VECTORS WERE CHOSEN SO THAT RAD: TYPE
DEVICES MAY ALSO SURVIVE A REBOOT AND NOT CONFLICT WITH Set040.
THE ACCESS FAULT EXCEPTION VECTOR IS ALSO MODIFIED, TO PREVENT
ATTEMPTED WRITES TO THE KICKSTART FROM CAUSING A SOFTWARE FAILURE.
THE FASTROM KICKSTART IS WRITEPROTECTED WITHIN THE MMU TABLES.
For other anti-virus authors, it is easy to identify this handler
by fetching the pointer stored in coldcapture, subtracting four from
this address pointer and testing for the following value at that
memory location:
Hex value=$52535448 = RSTH in ascii
Page 8
PROGRAM EXAMPLES
*************************************************************************
***********************************************************************
NOTE IN ALL THE FOLLOWING EXAMPLES, IF YOU ARE USING 68040.LIBRARY
37.10 OR GREATER, THEN THE SETPATCH COMMAND MUST COME AFTER THE
SET040 ENTRIES, AND THE SETPATCHPATCH COMMAND MUST BE DELETED AND
NOT USED AT ALL.
CHECK THE VERSION OF 68040.LIBRARY YOU ARE USING AND MAKE SURE
YOU INSTALL CORRECTLY, OR IT WILL NOT WORK.
EXAMPLE OF INSTALLING A FASTROM (68040.library 37.10 or greater)
To remap the rom, to fast ram with noclick drives:
Set040 fastrom noclick
setpatch QUIET <----Commodore's setpatch must come after
<----Delete the setpatchpatch entry
***********************************************************************
*************************************************************************
EXAMPLE OF INSTALLING A FASTROM (Kickstarts up to and beyond V2.04)
To remap the rom, to fast ram with noclick drives:
Set040 fastrom noclick
SetPatchPatch <-- the standard 'SetPatch' must already
be installed.
EXAMPLE OF INSTALLING A KICKROM
To install a KICKROM setup from a default file "DEVS:kickstart".
Set040 kickrom
To install a KICKROM as above, when KICKROM already installed.
Set040 kickrom force
To install a KICKROM as above, when KICKROM already installed.
Set040 kickrom devs:kick force
To install a kickrom option from a kickstart disk in df1:
Set040 kickrom df1:
EXAMPLE OF CONVERTING KICKROM TO FASTROM
To convert the KICKROM to FASTROM, with reset handler, and
noclick drives.
Set040 fastrom reset noclick
SetPatchPatch
EXAMPLE OF CONVERTING KICKROM TO FASTROM WITH THE FULLMAP OPTION
To convert the KICKROM to FASTROM, with reset handler, and
noclick drives and install a FULLMAP type remap. This option
will require 1067570 bytes of LOCAL memory.
Set040 fastrom fullmap reset noclick
SetPatchPatch
EXAMPLE OF INSTALLING RESET HANDLER SEPERATELY
The reset survival trap handler can be installed without
performing the KICKROM to FASTROM conversion by using RESET option.
If this option is given, the kickstart will remain in CHIP memory
and be able to survive a reboot.
Set040 reset
NOTE, This option cannot be done after installation if you
are using kickstart 3.0, 68040.library 37.10 or greater.
The reset option must be given when installing Set040.
Page 9
EXAMPLE OF KICKROMMING IN THE STARTUP-SEQUENCE
If you want to use a different kickstart in the startup-
sequence and have this survive a reset and be in fast memory,
all that is required is three lines.
The first line will only load the kickstart once, After this is
done the next boot will cause the first line to fail, as the output
goes to nil: it is transparent to the user. The second line will
then map it to fast ram and install the reset handler and no-click
patch once. After this both lines will transparently fail each boot.
This saves you having to use IF/WARN/ENDIF statements.
For KICKROM-FASTROM survival you could use:-
SetPatch quiet <--- Normal Setpatch command
Set040 >nil: kickrom kickstartfile
Set040 >nil: fastrom fullmap reset noclick
SetPatchPatch >nil:
For CHIP ram KICKROM survival you could use:-
SetPatch quiet <--- Normal Setpatch command
Set040 >nil: kickrom kickstartfile
Set040 >nil: reset
SetPatchPatch >nil: <--- MUST be after Setpatch and
AFTER Set040
EXAMPLE OF RESET REMOVAL
Set040 noreset
Removes the reset handler so that the next boot will
return to your ROM based kickstart.
EXAMPLE OF CACHE MANIPULTION
Disable both caches - Set040 nocache
Enable both caches - Set040 cache
Disable Data Cache - Set040 nodcache
Enable Data Cache - Set040 dcache
Enable Both Caches and disable Copyback - Set040 cache nocopyback
Enable Both Caches and enable Copyback - Set040 cache copyback
Disable Both Caches and disable Copyback - Set040 nocache nocopyback
EXAMPLE OF REMOVING FASTROM
SET040 nofastrom
NOTE: This function is not possible on a KICKROM or KICKROM-FASTROM
setup.
Page 10
EXAMPLE OF SWITCHING FROM 68030-68040 OR VICE-VERSA
Set040 togglecpu
One of the following cards must be installed.
PP&S A3000-68040 card.
PP&S A3000 Mercury card.
* PP&S A2000-68040 card.
* PP&S A2000 Zeus card.
* TO DATE, THIS FUNCTION HAS ONLY BE TESTED ON THE FIRST TWO ENTRIES.
THIS SWITCH IS NOT PERMITTED ON 16MHZ A3000'S, AND SHOULD NOT
BE ATTEMPTED.
TOGGLECPU is the only option that is permitted on a 68030 CPU. All
other options will display an error. When this option is given,
a requester will open and will prompt you to either 'CHANGE' or
'ABORT' via two gadgets. If aborted, no further action takes
place and the program will exit. If 'CHANGE' is selected, another
requester will open and prompt you to reboot the computer. This
requester will have a single 'ABORT' gadget, giving you a final
chance to abort. The actual reboot must be done by hand, using
the keyboard, because the PP&S 68040 card requires a hardware reset
to switch modes. This cannot be generated with software. (NO,
the reset instruction will not work!) :-(
IMPROVEMENTS
All suggestions will be carefully considered.
All bugs will be rectified A.S.A.P.
I will attempt to overcome all incompatibilities
if sufficient information on your particular board
is supplied ie. amount of onboard ram, address of such
ram, A3000 or A2000 board, full description of other
hardware you use, full description of any plug in cards,
full description of your Amiga, OS version numbers, etc!!
Page 11
TECHNICAL NOTES
The average user may not completely understand the following
notes, suffice to say an understanding of how this program
works is not required. Information given here is mainly
for the benefit of the experienced user or interested programmer.
These notes may be of some help if you experience problems
with certain 68040 cards.
NOTE: The termination for certain address has been taken from
the latest information I have available on the memory map
for the A3000 series of computers and is dated July 1991.
I wrote this program for a few reasons. To gain knowledge
in programming the 68040 processor in assembler and to discover
the differences from its older brothers. I wanted to test Macro68
assembler in 68040 instructions. When I ran a test of the difference
in speed between reading the ROMS and reading FAST RAM, I realized a
68040 MMU program was a necessity. I found that while reading the
ROMS the 68040 was only marginally faster than the 68030, yet in
FAST RAM the 68040 leaves the 68030 standing.
The MMU set-up remaps the kickstart ROMS to FAST RAM, and allows
for instruction caching of the address areas the same as for the
data areas mentioned below. This set-up protects the new kickstart
by marking this area of memory as write-protected in the ATC table
entries. This remap is faster than the hardware FASTROM that
is being done on some 68040 cards. Testing has shown that a MMU
remap is between two and three times the speed of a hardware map.
Re-mapping kickstart to FAST RAM poses a few problems because of
the design of the 68040 MMU. Most of the first 16MB of the Amiga
memory map must be set for non-cachable serialized. The rest of
the 4 gigabyte space can be set for cachable copyback, but because
of limitations of the 68040 MMU, programming this is not easy. The
standard V2.04 or PP&S set-up manages this by using both of the Data
Transparent Translation registers. This works fine but does not
allow for re-mapping of the kickstart. The 68040 MMU looks at
Transparent Translation registers first, and if an address matches,
the ATC tables are not accessed. Therefore a remap of the kickstart
would not be seen if we used the same values in the transparent
registers as PP&S, or Commodore uses.
The 68040 has a simple 3 level ATC table and page sizes of either
4k or 8k. Our set-up discussed here uses the 8k page size.
If the ATC is used, each entry in the first table covers 32MB.
This means that we must at least have entries in this table
for that address space. If we want this entire 32MB to be valid
we must have complete entries in the second and third tables to
cater for it. This is not a large problem but does use around
17k of memory for each 32MB space covered in the table. The
problem is enhanced due to the fact the 68040 does not support
'early termination descriptors' as the 68030 did.
The next problem exists because, two of each data and instruction
transparent translation registers are not enough to control the
rest of the space. We could put all entries in the ATC tables,
but this would mean very large tables and make it difficult to
control the copyback mode over a large area. A mode similar to
this has been catered for by Set040 as an option and still allows.
for compatibility with the CPU040 program from PP&S, CPU from
Commodore and any other 68040 cache manipulation program that uses
the OS routines for manipulation of the caches and modes.
Page 12
Set040 allows for two different setups. These allow for either a
smaller memory efficient setup, or a full setup that requires just
over one megabyte of memory.
THE DEFAULT SETUP
The first 16MB is set in the tables as non-cachable serialized.
Copyback mode for the second, third and fourth 16MB spaces can be
conrolled globally between copyback or writethrough before or after
installation, by command line options. The addresses of this 48MB
space is $1000000 - $3FFFFFF.
The next 64MB address space ($4000000 - $7FFFFFF) is controlled
by one each of the two data and instruction transparent translation
registers for the data and instruction spaces respectively. The
data register is set for cachable copyback unless the NODTT1CBACK
option is used at installation. This can be changed after
installation with the various copyback options. The instruction
registers are set for cachable.
The above caters for the first 16MB and the area defined as
'A3000 mother board space'. Above this area we have a 128MB
space which is defined as "CoProcessor Slot Expansion". This is
controlled by the second data and instruction transparent translation
registers and can be optionally switched between copyback or
writethrough before or after installation by command line options.
This area will default to copyback at installation unless NODTT0CBACK
option is given.
All the ATC entries except for the kickstart remap entries actually
get transparently translated. The 68040 users guide states that if
the physical address equals the logical address in a page entry, then
that entry is transparently translated. Transparent translation means
that there is no CPU overhead to do the translation. The kickstart
remap routine makes use of the new 'MOVE16' instruction to copy the ROM
image into ram. This allows for a very fast copy and saves having to
call OS routines to flush the caches after the copy, as the Move16
instruction does not permit caching of the data copied and invalidates
any entries in the cache for the destination addresses.
The rest of the map which ranges from $10000000-$FFFFFFFF has been
set as invalid, simply to conserve memory. The default set-up should
allow for the good compatibility between different 68040 cards with
the least use of memory.
Page 13
THE FULLMAP SETUP
This mode allows for mapping of the entire 4 gigabyte space with
memory usage of a little over a megabyte, including the Kickstart
image.
The first one gigabyte of address space is controlled by the ATC.
The second gigabyte is controlled by the DTT0 and ITT0 transparent
translation registers, and the third and fourth gigabytes are
controlled by the DTT1 and ITT1 registers. Caches for the first
16MB of the address space is set the same as the default setup.
All of the remaining address space is set for cachable copyback,
but this can be somewhat controlled by various command line options.
For further information see the FULLMAP description on page 6.
When programming these setups, I attempted to keep them fully
compatible with the standard programs from Commodore and PP&S.
This was done in the way of a stand alone program called SetPatchPatch.
This 'patch' allows the CPU, CPUSet, CPU040 and other correctly
written programs to be fully aware of the MMU setup that Set040 has
installed. In cases where the program that was supplied with your
card is not written correctly, I suggest you either use Set040 or one
of the above programs for cache manipulation. Yours can be tested
by using one of the above, and taking note of the effect it has
when the 'Set040 verbose' command is issued. Your program should
have EXACTLY the same effect as one of the above or Set040 does,
otherwise it is not correctly written.
TRADEMARKS
AmigaDOS, Amiga and Kickstart are trademarks of Commodore Amiga Inc.
PP&S is an abbreviation for Progressive Peripherals and Software.
MC68030, MC68040 and Motorola are trademarks of Motorola Inc.
REFERENCES
M68000PM/AD Programmers Reference Manual (inc. CPU32)
Published by Motorola Literature Distribution USA.
M68000UM/AD 8-/16-/32-Bit MicroProcessor User's Manual Eighth Edition.
Published by PRENTICE HALL, Englewood Cliffs, N.J. 07632
MC68040UM/AD 32-Bit MicroProcessor User's Manual
Published by Motorola Literature Distribution USA.
MC68030UM/AD 32-Bit MicroProcessor User's Manual
Published by Motorola Literature Distribution USA.
MC68040 Errata notes supplied by William J Coldwell.
Page 14