-
Notifications
You must be signed in to change notification settings - Fork 0
ROMs
Basically all retro machines comes with some parts of their operating system placed in ROM chips. These contain at least the very basic boot code required to load the main system code from floppy or hard disk. Some systems even come with their entire operating system in ROM.
FPGA boards like the Minimig or the MiST load system ROMs at boot time from SD card into RAM. This is done by the on-board MCU which also loads cores themselves from SD card.
The various MiSTle setups are based on off-the-shelf FPGA boards. These typically aren't loaded via some MCU but boot from an embedded flash memory. The support MCU running the FPGA Companion is not involved in this very early boot stage of the FPGA and both components start independently until they have progressed far enough into the boot process to start communication.
These flash memories are typically bigger than required to store the FPGAs cores. The remaining space is usually unused. On the Tang Nano 20k the cores are e.g. slightly less than 1 Megabyte in size while the flash memory has a capacity of 8 Megabytes. The remaining 7 Megabytes are potentially available for other uses once the FPGA has booted up.
The MiSTle cores use this to store the original machine ROMs. This has the advantage that the cores usually boot into a usable state even with no FPGA Companion connected at all. In some cases this may even be needed to generate a valid video signal which in turn is a requirement for the FPGA Companions on-screen-display (OSD) to display properly and to be usable at all.
The cores may different use of the flash memory. Some cores like the Atari ST or the Apple Macintosh use this in the same way the original machine would use its ROM by reading data from it as needed during runtime. This is a very tight solution as the serial SPI flash memories used by FPGAs are not very fast, and it's barely possible to achieve a random access time below around 120ns per single access. This is in the same range as the retro machine ROMs were and works when the memory timing of the core is close to the one of the original machine.
In some cases like the Amiga/Minimig, the core expects a faster memory timing than the real device. The resulting requirements cannot be fulfilled by the SPI flash. The ROM is thus copied to the faster RAM as system boot time. During runtime the flash memory is then not used at all and data is only being read from the copy placed in RAM.
The core sizes vary from FPGA to FPGA and so does the size of the flash memory. The same memory locations can thus not be used on all setups. So far we've been trying to give each core its own flash space. This allows to change cores without the need to exchange the flash ROM contents as well.
Flash areas from 0x800000 up are only available on boards with more than 8 Megabytes flash. According to the specification this should be true for all Tang boards with 60k or 138k FPGAs. In fact some of the 138k boards have been spotted with 8 Megabytes flash only.
Flash areas from 0x000000 to 0x0fffff are being used by all FPGAs to store the core. Flash areas up to 0x23ffff are used by 60k and 138k FPGAs to store the core. Flash areas up 0x47ffff are used by 138k FPGAs to store the core. Areas required to store the core are unavailable for ROM usage.
The table below summarizes the current flash ROM usage.
| Address range | Size | FPGA size | Usage |
|---|---|---|---|
| 0x000000 - 0x0fffff | 1M | 20k, 25k | Core |
| 0x000000 - 0x23ffff | 2.25M | 60k | Core |
| 0x000000 - 0x47ffff | 4.5M | 138k | Core |
| 0x100000 - 0x13ffff | 256k | 20k, 25k | Atari ST Primary TOS |
| 0x140000 - 0x17ffff | 256k | 20k, 25k | Atari STE Primary TOS |
| 0x180000 - 0x1affff | 256k | 20k, 25k | Atari ST Secondary TOS |
| 0x1c0000 - 0x1fffff | 256k | 20k, 25k | Atari STE Secondary TOS |
| 0x200000 - 0x207fff | 32k | 20k, 25k | C1541 Dolphin DOS 2 |
| 0x20c000 - 0x20ffff | 16k | 20k, 25k | C1541 CBM DOS 2.6 |
| 0x214000 - 0x217fff | 16k | 20k, 25k | C1541 Speed DOS Plus |
| 0x21c000 - 0x21ffff | 16k | 20k, 25k | C1541 Jiffy DOS |
| 0x400000 - 0x47ffff | 512k | 20k, 25k, 60k | Amiga |
| 0x480000 - 0x49ffff | 128k | 20k | Apple Macintosh |
| 0x500000 - 0x53ffff | 256k | 60k | Atari ST Primary TOS |
| 0x540000 - 0x57ffff | 256k | 60k | Atari STE Primary TOS |
| 0x580000 - 0x5affff | 256k | 60k | Atari ST Secondary TOS |
| 0x5c0000 - 0x5fffff | 256k | 60k | Atari STE Secondary TOS |
| 0x600000 - 0x67ffff | 512k | 138k | Amiga |
| 0x700000 - 0x707fff | 32k | 60k | C1541 Dolphin DOS 2 |
| 0x70c000 - 0x70ffff | 16k | 60k | C1541 CBM DOS 2.6 |
| 0x714000 - 0x717fff | 16k | 60k | C1541 Speed DOS Plus |
| 0x71c000 - 0x71ffff | 16k | 60k | C1541 Jiffy DOS |
| 0x900000 - 0x93ffff | 256k | 138k | Atari ST Primary TOS |
| 0x940000 - 0x97ffff | 256k | 138k | Atari STE Primary TOS |
| 0x980000 - 0x9affff | 256k | 138k | Atari ST Secondary TOS |
| 0x9c0000 - 0x9fffff | 256k | 138k | Atari STE Secondary TOS |
| 0x700000 - 0x707fff | 32k | 138k | C1541 Dolphin DOS 2 |
| 0x70c000 - 0x70ffff | 16k | 138k | C1541 CBM DOS 2.6 |
| 0x714000 - 0x717fff | 16k | 138k | C1541 Speed DOS Plus |
| 0x71c000 - 0x71ffff | 16k | 138k | C1541 Jiffy DOS |