MultiROM
Author
Publisher
Description
From Sam Users Mailing List November 1994:
MultiROM Technical Data v 1.0
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copyright (c) 1994 Rooksoft and Entropy.
The MultiROM is a trademark of Rooksoft.
HARDWARE:
This data sheet is a pre-release document for the new MultiROM with hardware from ROOKSOFT and software from ENTROPY. This document is intended to provide programmers with sufficient information to enable them to write software that will operate within the MultiROM.
The MultiROM is an add-on unit which plugs into the SAM Coupe expansion socket and can override the SAM’s internal ROM. It will provide an environment external from the normal SAM operating area from which programmers toolkits can function, such as assemblers, debuggers, disc repair/recovery toolkits etc.
The MultiROM will have either a 128K, 256K or 512K byte ROM (depending upon the amount of software to be included), and a user choice of either 32K or 128K battery backed static RAM. Both the RAM and ROM are sectioned into 16K pages which are selected by writing to either port DE or DF hex. Port DE controls which RAM/ROM page is paged in inplace of ROM0, while DF does the same for ROM1. Each port is identical except that they each control ROM0 or ROM1; the bits are as follows:
bit 0 Page select bit 0
bit 1 ” ” bit 1
bit 2 ” ” bit 2
bit 3 ” ” bit 3
Bit 4 ” ” bit 4
bit 5 ” ” bit 5 (only used if ROM > 512K)
bit 6 ROM/RAM select (set= RAM)
bit 7 Internal/external ROM select (set = internal ROM)
On power up or RESET the MultiROM’s registers are set to zero, which causes the MultiROM to take control of the SAM by paging in page zero of its ROM. This page holds the Entropy software which initialises the SAM and presents the main options menu.
In order to ensure that the MultiROM is totally software compatible the MultiROM can be switched out enabling the internal ROM to operate undisturbed (ie as if the MultiROM was not plugged in). This is done by setting bit 7 of both ports and calling address 0000; this will cause the SAM to boot up as normal. The MultiROM can be re-entered by either switching off (all data lost), pressing reset or clearing both ports to zero and calling address zero again.
When the MultiROM’s ROM is selected it will only respond when ROM0 or ROM1 (as appropriate) is selected within the ASIC. The MultiROM RAM, however, will respond whenever it is selected within the MultiROM and regardless of whether the SAM’s internal ROM or RAM is selected in the ASIC. This can cause contention between the two sets of RAM. To prevent this it is essential that when RAM is selected in port DE that ROM0 is selected in the ASIC, and accordingly when RAM is selected in port &DF that ROM1 is selected in the ASIC. This is due the fact that we would not normally want to replace the ROMs with RAMs which we can write to. Hence, the programmers are required to ensure that the ROM0 or ROM1 are selected when accessing the MultiROMs RAM.
SOFTWARE:
Currently the software specifications of the MultiROM remain fluid; we have not formally defined any of the system details. However, the following information IS important.
Systems Variable data
In page 0 of the RAM of the MultiROM, the MultiROM systems variables are kept. These are as follows:
&0000 MRALLOCT MultiROM memory allocation table.
As for the BASIC ALLOCT table, but keeps track of the MultiROM’s memory usage. Ends with an &FF terminator.
&0009 SYSINFO Systems info. Bits correspond to the following data:
0 - If BASIC is valid, set, if not, reset.
1 - External memory present if set.
2 - Two disc drives if set, one if reset.
3 - Hard-drive present if set.
4 - Comms interface present if set.
5 - SAM Mouse interface present if set.
6 - Real-time clock present if set.
7 - 128k MultiROM memory if set, 32k if reset.
&000A CLKPRT Clock base port - usually &E9
&000B CLKTYP Clock type - usually 0 (OKI chip)
&000C DOSINF DOS type:
0 - No DOS
1 - SAMDOS
2 - MasterDOS
3 - EDOS
4 - Other
Bit 3 set if MasterBASIC installed.
&000D EXMEM Number of 16k pages, external memory.
&000F HDBIOS If 0, uses MultiROM as the hard-drive DOS/BIOS (if present). If NZ, uses currently loaded DOS.
&0010 INITSTAT DM “MultiROM System Page”
- Loaded on first switch on - if this is corrupted, then the system will re-initialise the defaults.
&0024 LINEFEED As with MasterBASIC and SAM BASIC - whether or not linefeeds follow carriage returns on print-out.
&0025 BOOTUP Decides what to do on boot up (drop
into BASIC).
Bitwise:
0 - Install DOS
1 - Install Mouse driver
2 - Install DUMP driver
3 - Install Comms driver
4 - Boot disc in drive
Bit 5 decides whether or not a disc
in the drive at switch on / RESET
will be booted, before dropping
into the main MultiROM menu.
Bit 6-15 Undefined as of yet.
&0027-&00FF RESERVED for MultiROM systems.
&0100-&3FFF RESERVED for third-party sys variables.
The systems variables are held in battery-backed RAM. It will be necessary for software writers to provide the following information:
Configuration restart address — this will be called if the battery backed memory has to be reconfigured. NB: if your program does not need its own configuration details to be kept, then this address is not needed.
Entry point — where to call the program if it has to be started.
Any other information which you think may be necessary to integrate your software with the MultiROM.
NB: Programs MUST use the memory allocation tables, unless BASIC has been corrupted, in which case pretty much anything goes. This information is available as one of the MultiROM system bytes. If BASIC has been corrupted, then some programs may be denied access. Programs should always use the MultiROM and External Memory allocation tables to avoid contention with other programs memory space.
The rest of the system has yet to be defined. Programs may use the following as guidelines:
All programs should scan for the CNTRL+CAPS+EDIT key combination, and if it is found, set port &DE to 0, page ROM into section A and then do an RST 0. This is the quick reset combination.
New Allocation Table Guidelines
There are three memory page allocation tables in the SAM system. These are:
ALLOCT: This holds the internal memory allocation data.
MRALLOCT: This holds the multiROM memory page allocation data.
XMALLOCT: This holds the external memory page allocation data, and is in the first page of Meg 0. (&80 and &82 both set to zero).
The XMALLOCT is new; previously this was handled by MasterDOS, however, the MasterDOS allocation was deemed to be a little “empty”, as it was bitwise instead of byte per page. It is specified as:
&0000 “XMALLOCT” 8 bytes memory page header
&0008 “MROMv1.2” Name of program which
initialised it (max 8 bytes).
&0010 XMSIZE 2 bytes, size of external memory.
&0012-&00FF Reserved for later expansion.
&0100-&08FF XMALLOCT 2048 byte page allocation table. Allows for up to 32Mb of external memory.
XMSIZE is given by the MultiROM on initialisation; it gives the last page present of external memory in the system. This enables quicker page allocation on systems with large memory.
These new guidelines are needed because of the introduction of a new piece of SAM hardware which allows up to potentially 1 gigabyte of external memory. This memory is paged in using ports &82 and &83. They work in conjunction with the existing external memory ports (&80 and &81) by providing the most-significant byte of a 16-bit page number. Thus, there are now 65536 possible external memory pages.
For speed, and due to costs of memory, it is assumed that the maximum that can be present on the system is 32Mb.
To recap, external memory control ports are now:
&80,&82 - LSB and MSB respectively of section C external memory page.
&81,&83 - LSB and MSB respectively of section D external memory page.
Proposal for page identification system
I would like to propose a system for handling page addresses; this is a 16-bit number which holds the current page to be paged into UPPER memory. Its values are thus:
0-31 Normal internal memory page.
32-2079 External memory page.
2080-2087 MultiROM RAM page.
This is the system used internally in the MultiROM by the assembler.
Important Note: Software details in this document are very definitely subject to change. If you are interested in providing software for inclusion in the MultiROM then please let us know your program memory details so that we can allocate an area exclusive for your use both in ROM and RAM. We can then, also, keep you up to date with any changes to the details listed above.
Please Note that the target date for the first MultiROM release is late November 1994 (in time for Xmas). Hence we would like any third party software to be provided in early to mid November.