View Single Post
Old 07 September 2021, 23:07   #33
saimo
Registered User
 
saimo's Avatar
 
Join Date: Aug 2010
Location: Italy
Posts: 787
I finally returned to this.
I have rewritten the routines once again, and I have no idea of what happens on real machines. Therefore, I have prepared a proper test suite to have the routines tested... by anyone who feels like giving it a go on a real Amiga CD³² Any feedback will be much appreciated!

The test suite can be downloaded from https://www.retream.com/_temporary/NVRAMRTS.lha.

This short video shows what the test suite does:

[ Show youtube player ]

(Note: the operations will be surely slower on real machines.)

Code:
--------------------------------------------------------------------------------
OVERVIEW

This is a test suite that purposes to verify whether my custom routines for
direct access to the Amiga CD³² NVRAM work.
Developing them is quite challenging because:
 · I do not have an Amiga CD³², so I have to rely on emulation, which is not
   100% exact;
 · different machines mount different EEPROM chips, which behave differently;
 · there is no official documentation (my references are the documentation that
   has been thankfully produced by who studied the behaviour of Akiko and the
   EEPROM datasheet from ATMEL, the maker of the EEPROM).
The routines work perfectly under emulation, but that is no guarantee that they
work also on real machines. Indeed, previous versions worked under emulation and
on a couple of machines, but failed on another machine.


--------------------------------------------------------------------------------
WHAT DOES THIS DO?

This suite will perform several read/write operations from/to the NVRAM, whose
DATA WILL THUS BE ALTERED (unless the routines fail to access the NVRAM
altogether). At the end, it will attempt to restore the NVRAM data exactly as it
was at the beginning.
Given that the routines are experimental, though, first it will check if a
backup of the NVRAM items exists and ask you whether to make a (new) backup, so
that the NVRAM items can be restored after the tests if the custom restore does
not succeed or execute at all (only OS-compliant NVRAM items will be backed up;
the backup and restore operations are done by means of the OS-legal, reliable,
third-party tools DumpNVRAM and RestoreNVRAM - check out NVRAM_Tools.doc).
You will be informed about the backup status and asked what to do and whether to
continue.


--------------------------------------------------------------------------------
REQUIREMENTS

· An Amiga CD³² with a writable media drive (DO NOT TRY ON OTHER MACHINES)
· The AmigaDOS Copy, Delete and Execute commands in the commands path.


--------------------------------------------------------------------------------
INSTRUCTIONS

To perform the tests:
 1. copy the NVRAMRTS directory from the archive to anywhere on the drive;
 2. from shell, enter the NVRAMRTS directory;
 3. run the "test" script and follow the on-screen instructions.

At the end of the tests or if the tests hung:
 1. reboot the machine;
 2. if the NVRAM data is not restored correctly or you are not sure, and a
    backup exists:
     2.1. from shell, enter the NVRAMRTS directory;
     2.2. run the "restore" script;
 3. pack the NVRAMRTS directory into an archive;
 4. send your Amiga CD³²'s specifications(*), the archive and, if the tests
    hung, the color of the screen at that point to postmaster@retream.com.

(*)The marking on the EEPROM would be particularly helpful, but, since that
requires opening the machine, do not worry if you do not feel like going that
far.

Thank you!


--------------------------------------------------------------------------------
THE CORE TOOL

The tests are performed by means of a tool called WriteReadNVRAM. It is a shell
program that allows to access any arbitrary chunk of the Amiga CD³² NVRAM.
It works as follows:
 1. if requested, it writes some data from an input file to the NVRAM;
 2. if requested, it saves some data from NVRAM to an output file.

The shell arguments are:
 · INPUTFILE=IF/K     : input file (unspecified = do not write data to NVRAM)
 · WRITEADDRESS=WA/K/N: NVRAM address in [0, 1023] to start writing from
 · WRITESIZE=WS/K/N   : number of bytes in [1, 1024-WRITEADDRESS] to write
 · OUTPUTFILE=OF/K    : output file (unspecified = do not read data from NVRAM)
 · READADDRESS=RA/K/N : NVRAM address in [0, 1023] to start reading from
 · READSIZE=RS/K/N    : number of bytes in [1, 1024-READADDRESS] to read
 · QUIET/S            : do not print any information to the standard output

These values are used for unspecified arguments:
 · WRITEADDRESS: 0
 · WRITESIZE   : 1024
 · READADDRESS : 0
 · READSIZE    : 1024

These values are used for invalid arguments:
 · WRITEADDRESS: 0
 · WRITESIZE   : 1024-WRITEADDRESS
 · READADDRESS : 0
 · READSIZE    : 1024-READADDRESS

If QUIET is not specified, the following information gets printed:
 · startup code : <NVRAM startup code (see below)>
 · input file   : <input file path, if specified>
 · write address: <(corrected) NVRAM address for writing>
 · write size   : <(corrected) number of bytes for writing>
 · load code    : <load code (see below)>
 · output file  : <output file path, if specified>
 · read address : <(corrected) NVRAM address for reading>
 · read size    : <(corrected) number of bytes for reading>
 · save code    : <save code (see below)>
 · elapsed time : <elapsed time expressed in color clocks>

Operation code:
 :| = no operation
 :( = operation failed
 :) = operation succeeded

No data is written to the NVRAM if loading fails.
No data is read from the NVRAM and saved to file if the NVRAM startup fails.

During execution, AmigaOS is disabled entirely. Also, the screen gets blanked
and repainted dynamically as follows:
 · blue : writing;
 · cyan : preparing to read;
 · green: reading;
 · red  : starting an operation.

THIS TOOL IS BASED ON THE CUSTOM ROUTINES WHOSE VALIDITY IS TO BE VERIFIED WITH
THIS SUITE, SO IT IS BY NO MEANS RELIABLE.

Last edited by saimo; 10 September 2021 at 21:46. Reason: Improved test script and documentation
saimo is offline  
 
Page generated in 0.04596 seconds with 11 queries