Changes

FlashGordon

232 bytes added, 17:50, 29 April 2020
/* Writing to flash memory */
==The ROM managers==
* The most comprehensive utility for the management of the ROMs is [[ROManager]] for [[FutureOS]]. For the native OS there are [[Roman]] and the [[MegaFlashROManager]]. A "booster" is included in both of these, enabling the initialization of ROMs 16-31 which are not scanned by the firmware.
==The rescue disk==
The memory chip used is an SST 39SF040. This is a flash memory chip that is smarter than a simple ROM or RAM. You talk to it by sending commands to exectute execute (but reading works as usual).
Also, the MegaFlash will accept write operations both in the C000-FFFF and 8000-BFFF ranges because of an hardware limitation. So, avoid reading and writing to 8000-BFFF while trying to program a ROM. We're sorry for the inconvenience, but fixing that would require an extra chip on the board, a bigger board, and more complex wiring which we tried to avoid.
 
 
The newer batch of the FlashGordon does decode A14, which is an great advantage over the MegaFlash, because you can use the stack at the place where it's usually located.
*Connect ROM number 1 and write 0xAA to address 0xD555
*Connect ROM number 2 and write 0x55 to address 0xEAAA
*At this point, the flahs flash is waiting for a command to execute. The available commands are ERASE (0x80), IDENTIFY (0x90), BYTE PROGRAM (0xA0) and RESET (0xF0)
*To erase a sector, send the ERASE command by writing 0x80 to address 0xD555 in ROM 1. Now write once again 0xAA to address 0xD555 in ROM number 1 and 0x55 to address 0xEAAA in ROM number 2. Then, write 0x30 anywhere in the sector you want to erase. Erasing will take up to 20 milliseconds, so wait to make sure the flash is ready to accept another command.
*To write a byte, write 0xA0 (BYTE PROGRAM) to address 0xD555 in ROM 1. Then, connect the ROM you want to program and write one byte at the needed address. There is a delay of 20 NOPs after a write operation, that should be no problem as you can use them to prepare the write operation for the next byte (by the time you're ready to execute the next write to the ROM, it will be ready to listen).
*If you enter identify mode, you can read two bytes to learn about the manufacturer and model of the flash chip. This can be used to identify FlashGordon versus the MegaFlash (which will return different values), a Ramcard (too late, you already corrupted some data), or a plain old romboard (all your attemps attempts to write are vain and bound to fail).
*There is also a command for a complete chip erase if you want to clear everything.
2,002
edits